From 4e1357bccae60e4f7c65c634803ef2c195659b65 Mon Sep 17 00:00:00 2001 From: Nathan Freitas Date: Mon, 3 Mar 2014 10:37:20 -0500 Subject: [PATCH] add new background graphics state change to main UI --- src/org/torproject/android/Orbot.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/org/torproject/android/Orbot.java b/src/org/torproject/android/Orbot.java index 5eb66fd5..3ddf93c0 100644 --- a/src/org/torproject/android/Orbot.java +++ b/src/org/torproject/android/Orbot.java @@ -68,6 +68,7 @@ public class Orbot extends SherlockActivity implements TorConstants, OnLongClick private TextView mTxtOrbotLog = null; private SlidingDrawer mDrawer = null; private boolean mDrawerOpen = false; + private View mViewMain = null; /* Some tracking bits */ 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); + mViewMain = findViewById(R.id.viewMain); lblStatus = (TextView)findViewById(R.id.lblStatus); lblStatus.setOnLongClickListener(this); imgStatus = (ImageProgressView)findViewById(R.id.imgStatus); @@ -718,6 +720,7 @@ public class Orbot extends SherlockActivity implements TorConstants, OnLongClick { imgStatus.setImageResource(R.drawable.toron); + mViewMain.setBackgroundResource(R.drawable.onionrootonly); // hideProgressDialog(); String lblMsg = getString(R.string.status_activated); @@ -760,7 +763,9 @@ public class Orbot extends SherlockActivity implements TorConstants, OnLongClick { imgStatus.setImageResource(R.drawable.torstarting); - + + mViewMain.setBackgroundResource(R.drawable.onionrootonlygold); + if (lblStatus != null && torServiceMsg != null) if (torServiceMsg.indexOf('%')!=-1) lblStatus.setText(torServiceMsg); @@ -776,7 +781,8 @@ public class Orbot extends SherlockActivity implements TorConstants, OnLongClick // hideProgressDialog(); - + mViewMain.setBackgroundResource(R.drawable.onionrootonlygrey); + imgStatus.setImageResource(R.drawable.toroff); lblStatus.setText(getString(R.string.status_disabled) + "\n" + getString(R.string.press_to_start));