add new background graphics state change to main UI

This commit is contained in:
Nathan Freitas 2014-03-03 10:37:20 -05:00
parent 714af31a20
commit 4e1357bcca
1 changed files with 8 additions and 2 deletions

View File

@ -68,6 +68,7 @@ public class Orbot extends SherlockActivity implements TorConstants, OnLongClick
private TextView mTxtOrbotLog = null; private TextView mTxtOrbotLog = null;
private SlidingDrawer mDrawer = null; private SlidingDrawer mDrawer = null;
private boolean mDrawerOpen = false; private boolean mDrawerOpen = false;
private View mViewMain = null;
/* Some tracking bits */ /* Some tracking bits */
private int torStatus = TorServiceConstants.STATUS_OFF; //latest status reported from the tor service private int torStatus = TorServiceConstants.STATUS_OFF; //latest status reported from the tor service
@ -95,6 +96,7 @@ public class Orbot extends SherlockActivity implements TorConstants, OnLongClick
{ {
setContentView(R.layout.layout_main); setContentView(R.layout.layout_main);
mViewMain = findViewById(R.id.viewMain);
lblStatus = (TextView)findViewById(R.id.lblStatus); lblStatus = (TextView)findViewById(R.id.lblStatus);
lblStatus.setOnLongClickListener(this); lblStatus.setOnLongClickListener(this);
imgStatus = (ImageProgressView)findViewById(R.id.imgStatus); imgStatus = (ImageProgressView)findViewById(R.id.imgStatus);
@ -718,6 +720,7 @@ public class Orbot extends SherlockActivity implements TorConstants, OnLongClick
{ {
imgStatus.setImageResource(R.drawable.toron); imgStatus.setImageResource(R.drawable.toron);
mViewMain.setBackgroundResource(R.drawable.onionrootonly);
// hideProgressDialog(); // hideProgressDialog();
String lblMsg = getString(R.string.status_activated); String lblMsg = getString(R.string.status_activated);
@ -761,6 +764,8 @@ public class Orbot extends SherlockActivity implements TorConstants, OnLongClick
imgStatus.setImageResource(R.drawable.torstarting); imgStatus.setImageResource(R.drawable.torstarting);
mViewMain.setBackgroundResource(R.drawable.onionrootonlygold);
if (lblStatus != null && torServiceMsg != null) if (lblStatus != null && torServiceMsg != null)
if (torServiceMsg.indexOf('%')!=-1) if (torServiceMsg.indexOf('%')!=-1)
lblStatus.setText(torServiceMsg); lblStatus.setText(torServiceMsg);
@ -776,6 +781,7 @@ public class Orbot extends SherlockActivity implements TorConstants, OnLongClick
// hideProgressDialog(); // hideProgressDialog();
mViewMain.setBackgroundResource(R.drawable.onionrootonlygrey);
imgStatus.setImageResource(R.drawable.toroff); imgStatus.setImageResource(R.drawable.toroff);
lblStatus.setText(getString(R.string.status_disabled) + "\n" + getString(R.string.press_to_start)); lblStatus.setText(getString(R.string.status_disabled) + "\n" + getString(R.string.press_to_start));