[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [orbot/master] minor updates for ActionBarSherlock support



commit 46bf5dd6be9f1771ae2a10a23f4e4a93eed76449
Author: n8fr8 <nathan@xxxxxxxxxxx>
Date:   Sun Oct 21 15:32:04 2012 +0530

    minor updates for ActionBarSherlock support
---
 res/menu/main.xml                                  |   11 +++++++++++
 src/org/torproject/android/Orbot.java              |   15 +++++++++------
 .../android/settings/SettingsPreferences.java      |    4 +++-
 3 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/res/menu/main.xml b/res/menu/main.xml
index 9dbf9a2..7870c32 100755
--- a/res/menu/main.xml
+++ b/res/menu/main.xml
@@ -22,31 +22,42 @@
  <item android:id="@+id/menu_start"
         android:title="@string/menu_start"
          android:icon="@drawable/ic_action_start"
+          android:showAsAction="ifRoom"
+         
          />
 
  <item android:id="@+id/menu_settings"
         android:title="@string/menu_settings"
          android:icon="@drawable/ic_action_settings"
+         android:showAsAction="always"
          />
 
  <item android:id="@+id/menu_verify"
         android:title="@string/menu_verify"
          android:icon="@drawable/ic_action_browse"
+                  android:showAsAction="always"
+         
          />
  
  <item android:id="@+id/menu_about"
         android:title="@string/menu_about"
          android:icon="@drawable/ic_menu_about"
+                  android:showAsAction="ifRoom"
+         
          />
  
   <item android:id="@+id/menu_wizard"
         android:title="@string/menu_wizard"
          android:icon="@drawable/ic_menu_goto"
+                  android:showAsAction="ifRoom"
+         
          />
  
   <item android:id="@+id/menu_exit"
         android:title="@string/menu_exit"
          android:icon="@drawable/ic_menu_exit"
+                  android:showAsAction="ifRoom"
+         
          />
  
 </menu>
diff --git a/src/org/torproject/android/Orbot.java b/src/org/torproject/android/Orbot.java
index bdad7ae..3a58487 100644
--- a/src/org/torproject/android/Orbot.java
+++ b/src/org/torproject/android/Orbot.java
@@ -12,7 +12,6 @@ import org.torproject.android.settings.ProcessSettingsAsyncTask;
 import org.torproject.android.settings.SettingsPreferences;
 import org.torproject.android.wizard.ChooseLocaleWizardActivity;
 
-import android.app.Activity;
 import android.app.AlertDialog;
 import android.app.NotificationManager;
 import android.content.ComponentName;
@@ -36,9 +35,6 @@ import android.text.Layout;
 import android.text.method.ScrollingMovementMethod;
 import android.util.Log;
 import android.view.LayoutInflater;
-import android.view.Menu;
-import android.view.MenuInflater;
-import android.view.MenuItem;
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.View.OnLongClickListener;
@@ -49,7 +45,13 @@ import android.widget.SlidingDrawer;
 import android.widget.TextView;
 import android.widget.Toast;
 
-public class Orbot extends Activity implements TorConstants, OnLongClickListener
+import com.actionbarsherlock.app.SherlockActivity;
+import com.actionbarsherlock.view.Menu;
+import com.actionbarsherlock.view.MenuInflater;
+import com.actionbarsherlock.view.MenuItem;
+
+
+public class Orbot extends SherlockActivity implements TorConstants, OnLongClickListener
 {
 	/* Useful UI bits */
 	private TextView lblStatus = null; //the main text display widget
@@ -161,9 +163,10 @@ public class Orbot extends Activity implements TorConstants, OnLongClickListener
     * Create the UI Options Menu (non-Javadoc)
     * @see android.app.Activity#onCreateOptionsMenu(android.view.Menu)
     */
+    @Override
     public boolean onCreateOptionsMenu(Menu menu) {
         super.onCreateOptionsMenu(menu);
-        MenuInflater inflater = getMenuInflater();
+        MenuInflater inflater = getSupportMenuInflater();
         inflater.inflate(R.menu.main, menu);
        
         mItemOnOff = menu.getItem(0);
diff --git a/src/org/torproject/android/settings/SettingsPreferences.java b/src/org/torproject/android/settings/SettingsPreferences.java
index 46a2211..fd857fd 100644
--- a/src/org/torproject/android/settings/SettingsPreferences.java
+++ b/src/org/torproject/android/settings/SettingsPreferences.java
@@ -11,6 +11,8 @@ import org.torproject.android.TorConstants;
 import org.torproject.android.service.TorServiceUtils;
 import org.torproject.android.service.TorTransProxy;
 
+import com.actionbarsherlock.app.SherlockPreferenceActivity;
+
 import android.content.Intent;
 import android.content.SharedPreferences;
 import android.content.SharedPreferences.Editor;
@@ -27,7 +29,7 @@ import android.widget.Toast;
 
 
 public class SettingsPreferences 
-		extends PreferenceActivity implements OnPreferenceClickListener {
+		extends SherlockPreferenceActivity implements OnPreferenceClickListener {
 
 	private CheckBoxPreference prefCBTransProxy = null;
 	private CheckBoxPreference prefcBTransProxyAll = null;



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits