minor updates for ActionBarSherlock support

This commit is contained in:
n8fr8 2012-10-21 15:32:04 +05:30
parent 15ce48cf10
commit 46bf5dd6be
3 changed files with 23 additions and 7 deletions

View File

@ -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>

View File

@ -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);

View File

@ -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;