From edafc81433534a1b3238b1288398013dd5befd7c Mon Sep 17 00:00:00 2001 From: Steve Slaven Date: Mon, 27 Dec 2010 16:00:31 -0800 Subject: Add real menu so people may see "help" quicker instead of digging in the prefs diff --git a/res/menu/main.xml b/res/menu/main.xml new file mode 100644 index 0000000..6344a33 --- /dev/null +++ b/res/menu/main.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/res/values/strings.xml b/res/values/strings.xml index 36cde24..a3e9fb4 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -2,6 +2,9 @@ SoftKeys + Help + Settings + Recent Tasks: Close diff --git a/src/net/hoopajoo/android/SoftKeys/Keys.java b/src/net/hoopajoo/android/SoftKeys/Keys.java index 2724451..3a30985 100644 --- a/src/net/hoopajoo/android/SoftKeys/Keys.java +++ b/src/net/hoopajoo/android/SoftKeys/Keys.java @@ -40,6 +40,9 @@ import android.os.Handler; import android.preference.PreferenceManager; import android.util.Log; import android.view.KeyEvent; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; @@ -374,7 +377,31 @@ public class Keys extends Activity implements OnClickListener, OnLongClickListen } } - + @Override + public boolean onCreateOptionsMenu( Menu menu ) { + getMenuInflater().inflate( R.menu.main, menu ); + return true; + } + + @Override + public boolean onOptionsItemSelected( MenuItem item ) { + // Handle item selection + switch( item.getItemId() ) { + case R.id.menu_help: + Intent intent = new Intent( this, QuickDoc.class ); + intent.putExtra( "type", "help" ); + startActivity( intent ); + return true; + + case R.id.menu_settings: + generic_click( R.id.settings, false ); + return true; + + default: + return super.onOptionsItemSelected( item ); + } + } + @Override public void onNewIntent( Intent i ) { Globals app = (Globals)getApplication(); @@ -641,10 +668,12 @@ public class Keys extends Activity implements OnClickListener, OnLongClickListen @Override public boolean onKeyDown( int code, KeyEvent k ) { + /* let menu be menu if( code == KeyEvent.KEYCODE_MENU ) { generic_click( R.id.settings, false ); return true; } + */ return super.onKeyDown( code, k ); } -- cgit v0.10.2