commit 3d1f3912eaa1b4602a82ce59b4e95d011adad265 Author: Nathan Freitas nathan@freitas.net Date: Tue Apr 8 10:46:52 2014 -0400
updates for icons, backgrounds and improved drawing code to solve issues related to outofmemory --- res/drawable/ic_launcher.png | Bin 8751 -> 0 bytes res/drawable/icon.png | Bin 7036 -> 0 bytes res/drawable/onion.png | Bin 93700 -> 77446 bytes res/drawable/onionrootonly.png | Bin 129702 -> 97350 bytes res/drawable/onionrootonlygold.png | Bin 132042 -> 97365 bytes res/drawable/onionrootonlygrey.png | Bin 129862 -> 97377 bytes res/drawable/onionroots.png | Bin 178600 -> 91020 bytes res/drawable/toroff.png | Bin 67176 -> 63700 bytes res/drawable/toron.png | Bin 109520 -> 93076 bytes res/drawable/torstarting.png | Bin 68493 -> 53619 bytes res/layout/layout_wizard_permissions.xml | 33 -------- res/values/strings.xml | 2 + src/org/torproject/android/Orbot.java | 83 ++++++++++---------- .../torproject/android/wizard/TipsAndTricks.java | 4 +- 14 files changed, 46 insertions(+), 76 deletions(-)
diff --git a/res/drawable/ic_launcher.png b/res/drawable/ic_launcher.png deleted file mode 100644 index 05980b5..0000000 Binary files a/res/drawable/ic_launcher.png and /dev/null differ diff --git a/res/drawable/icon.png b/res/drawable/icon.png deleted file mode 100644 index 9e0ed2f..0000000 Binary files a/res/drawable/icon.png and /dev/null differ diff --git a/res/drawable/onion.png b/res/drawable/onion.png index 80e3f94..cf7cd50 100644 Binary files a/res/drawable/onion.png and b/res/drawable/onion.png differ diff --git a/res/drawable/onionrootonly.png b/res/drawable/onionrootonly.png index aac8d01..dcd4116 100644 Binary files a/res/drawable/onionrootonly.png and b/res/drawable/onionrootonly.png differ diff --git a/res/drawable/onionrootonlygold.png b/res/drawable/onionrootonlygold.png index 544aecb..8f80ece 100644 Binary files a/res/drawable/onionrootonlygold.png and b/res/drawable/onionrootonlygold.png differ diff --git a/res/drawable/onionrootonlygrey.png b/res/drawable/onionrootonlygrey.png index 0524f9e..9f89a06 100644 Binary files a/res/drawable/onionrootonlygrey.png and b/res/drawable/onionrootonlygrey.png differ diff --git a/res/drawable/onionroots.png b/res/drawable/onionroots.png index cb80633..10f6327 100644 Binary files a/res/drawable/onionroots.png and b/res/drawable/onionroots.png differ diff --git a/res/drawable/toroff.png b/res/drawable/toroff.png index 4dceca3..4b23e0b 100644 Binary files a/res/drawable/toroff.png and b/res/drawable/toroff.png differ diff --git a/res/drawable/toron.png b/res/drawable/toron.png index 9d338d8..2a0fc65 100644 Binary files a/res/drawable/toron.png and b/res/drawable/toron.png differ diff --git a/res/drawable/torstarting.png b/res/drawable/torstarting.png index a7aae1e..e98c067 100644 Binary files a/res/drawable/torstarting.png and b/res/drawable/torstarting.png differ diff --git a/res/layout/layout_wizard_permissions.xml b/res/layout/layout_wizard_permissions.xml index b61a1f8..5e3b1ed 100644 --- a/res/layout/layout_wizard_permissions.xml +++ b/res/layout/layout_wizard_permissions.xml @@ -5,39 +5,6 @@ android:layout_width="fill_parent" android:layout_height="fill_parent">
-<RelativeLayout - android:layout_width="fill_parent" - android:layout_height="70sp" - android:id="@+id/relativeLayout1" - android:layout_gravity="center_vertical|center_horizontal" - android:background="#000000" - > - <ImageView - android:src="@drawable/icon" - android:id="@+id/orbot_image" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentLeft="true" - android:paddingLeft="20sp" - android:paddingTop="10sp" > - - </ImageView> - - <TextView - android:id="@+id/WizardTextTitle" - android:layout_width="wrap_content" - android:layout_height="fill_parent" - android:layout_alignParentTop="true" - android:layout_centerHorizontal="true" - android:fadingEdge="vertical" - android:gravity="center_vertical" - android:paddingLeft="5sp" - android:singleLine="true" - android:text="TITLE" - android:textColor="#FFFFFF" - android:textSize="10pt" /> - - </RelativeLayout>
<TableLayout android:id="@+id/TableLayout01" android:stretchColumns="*" android:layout_height="fill_parent" android:layout_width="wrap_content">
diff --git a/res/values/strings.xml b/res/values/strings.xml index f6ee084..94e9d36 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -247,5 +247,7 @@
<string name="permission_manage_tor_label">Manage Tor</string> <string name="permission_manage_tor_description">Enable this app to control the Tor service</string> + <string name="it_doesn_t_seem_like_you_have_orweb_installed_want_help_with_that_or_should_we_just_open_the_browser_">It doesn't seem like you have Orweb installed. Want help with that, or should we just open the browser?</string> + <string name="install_apps_">Install apps?</string>
</resources> diff --git a/src/org/torproject/android/Orbot.java b/src/org/torproject/android/Orbot.java index 14a865f..d18cd07 100644 --- a/src/org/torproject/android/Orbot.java +++ b/src/org/torproject/android/Orbot.java @@ -632,9 +632,9 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic else { AlertDialog aDialog = new AlertDialog.Builder(Orbot.this) - .setIcon(R.drawable.icon) - .setTitle("Install apps?") - .setMessage("It doesn't seem like you have Orweb installed. Want help with that, or should we just open the browser?") + .setIcon(R.drawable.onion) + .setTitle(R.string.install_apps_) + .setMessage(R.string.it_doesn_t_seem_like_you_have_orweb_installed_want_help_with_that_or_should_we_just_open_the_browser_) .setPositiveButton(android.R.string.ok, new OnClickListener () {
@@ -759,7 +759,7 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic if (button) { aDialog = new AlertDialog.Builder(Orbot.this) - .setIcon(R.drawable.icon) + .setIcon(R.drawable.onion) .setTitle(title) .setMessage(msg) .setPositiveButton(android.R.string.ok, null) @@ -768,7 +768,7 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic else { aDialog = new AlertDialog.Builder(Orbot.this) - .setIcon(R.drawable.icon) + .setIcon(R.drawable.onion) .setTitle(title) .setMessage(msg) .show(); @@ -785,28 +785,32 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic { try { + int newTorStatus = -1; + //if the serivce is bound, query it for the curren status value (int) if (mService != null) - torStatus = mService.getStatus(); + newTorStatus = mService.getStatus();
//now update the layout_main UI based on the status if (imgStatus != null) {
- if (torStatus == TorServiceConstants.STATUS_ON) + if (newTorStatus == TorServiceConstants.STATUS_ON) { - imgStatus.setImageResource(R.drawable.toron); - - mViewMain.setBackgroundResource(R.drawable.onionrootonly); - // hideProgressDialog(); - - String lblMsg = getString(R.string.status_activated); - - lblStatus.setText(lblMsg); + if (torStatus != newTorStatus) + { + imgStatus.setImageResource(R.drawable.toron); + mViewMain.setBackgroundResource(R.drawable.onionrootonly); + String lblMsg = getString(R.string.status_activated); + lblStatus.setText(lblMsg); + + if (mItemOnOff != null) + mItemOnOff.setTitle(R.string.menu_stop); + + }
if (torServiceMsg != null && torServiceMsg.length() > 0) { - // showAlert("Update", torServiceMsg,xte appendLogTextAndScroll(torServiceMsg); }
@@ -825,9 +829,6 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic
}
- if (mItemOnOff != null) - mItemOnOff.setTitle(R.string.menu_stop); -
if (autoStartFromIntent) { @@ -836,38 +837,38 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic }
} - else if (torStatus == TorServiceConstants.STATUS_CONNECTING) + else if (newTorStatus == TorServiceConstants.STATUS_CONNECTING) { - + if (torStatus != newTorStatus) + { imgStatus.setImageResource(R.drawable.torstarting); - mViewMain.setBackgroundResource(R.drawable.onionrootonlygold); - - if (lblStatus != null && torServiceMsg != null) - if (torServiceMsg.indexOf('%')!=-1) - lblStatus.setText(torServiceMsg); - - appendLogTextAndScroll(torServiceMsg); - + if (mItemOnOff != null) mItemOnOff.setTitle(R.string.menu_stop); + } + + if (lblStatus != null && torServiceMsg != null) + if (torServiceMsg.indexOf('%')!=-1) + lblStatus.setText(torServiceMsg); + + appendLogTextAndScroll(torServiceMsg); +
} - else + else if (torStatus != newTorStatus) { - - - // 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)); - - if (mItemOnOff != null) - mItemOnOff.setTitle(R.string.menu_start); - + mViewMain.setBackgroundResource(R.drawable.onionrootonlygrey); + imgStatus.setImageResource(R.drawable.toroff); + lblStatus.setText(getString(R.string.status_disabled) + "\n" + getString(R.string.press_to_start)); + + if (mItemOnOff != null) + mItemOnOff.setTitle(R.string.menu_start); + } } + + torStatus = newTorStatus;
} catch (RemoteException e) diff --git a/src/org/torproject/android/wizard/TipsAndTricks.java b/src/org/torproject/android/wizard/TipsAndTricks.java index 49bc311..66b08d6 100644 --- a/src/org/torproject/android/wizard/TipsAndTricks.java +++ b/src/org/torproject/android/wizard/TipsAndTricks.java @@ -67,7 +67,7 @@ public class TipsAndTricks extends Activity implements TorConstants { txtTitle.setText(title); ImageView img = (ImageView) findViewById(R.id.orbot_image); - img.setImageResource(R.drawable.icon); + img.setImageResource(R.drawable.onion); Button btnLink = (Button)findViewById(R.id.WizardRootButtonInstallGibberbot); @@ -183,7 +183,7 @@ public class TipsAndTricks extends Activity implements TorConstants {
btn2.setText(getString(R.string.btn_finish)); btn1.setVisibility(Button.VISIBLE); - img.setImageResource(R.drawable.icon); + img.setImageResource(R.drawable.onion); btn1.setOnClickListener(new View.OnClickListener() {
tor-commits@lists.torproject.org