incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bows...@apache.org
Subject [33/50] git commit: Change based on new message passing API in IPlugin
Date Tue, 03 Jan 2012 18:57:10 GMT
Change based on new message passing API in IPlugin


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/9409caad
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/9409caad
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/9409caad

Branch: refs/heads/master
Commit: 9409caad69f812564c2a83db3099ff72cb41e525
Parents: 29c7e12
Author: Joe Bowser <joe.bowser@nitobi.com>
Authored: Wed Nov 16 14:50:26 2011 -0800
Committer: Joe Bowser <joe.bowser@nitobi.com>
Committed: Wed Nov 16 14:50:26 2011 -0800

----------------------------------------------------------------------
 framework/src/com/phonegap/DroidGap.java |   29 ++++++++++++++++++++++++-
 1 files changed, 28 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/9409caad/framework/src/com/phonegap/DroidGap.java
----------------------------------------------------------------------
diff --git a/framework/src/com/phonegap/DroidGap.java b/framework/src/com/phonegap/DroidGap.java
index 0826c50..812cb0e 100755
--- a/framework/src/com/phonegap/DroidGap.java
+++ b/framework/src/com/phonegap/DroidGap.java
@@ -51,6 +51,8 @@ import android.os.Bundle;
 import android.util.Log;
 import android.view.Display;
 import android.view.KeyEvent;
+import android.view.Menu;
+import android.view.MenuItem;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.Window;
@@ -1499,7 +1501,7 @@ public class DroidGap extends PhonegapActivity {
         // If menu key
         else if (keyCode == KeyEvent.KEYCODE_MENU) {
             this.appView.loadUrl("javascript:PhoneGap.fireDocumentEvent('menubutton');");
-            return true;
+            return super.onKeyDown(keyCode, event);
         }
 
         // If search key
@@ -1825,4 +1827,29 @@ public class DroidGap extends PhonegapActivity {
         return false;
     }
 
+    /* 
+     * Hook in DroidGap for menu plugins
+     * 
+     */
+    
+    @Override
+    public boolean onCreateOptionsMenu(Menu menu)
+    {
+        this.onMessage("onCreateOptionsMenu", menu);
+        return super.onCreateOptionsMenu(menu);
+    }
+    
+    @Override
+    public boolean onPrepareOptionsMenu(Menu menu)
+    {
+        this.onMessage("onPrepareOptionsMenu", menu);
+        return super.onPrepareOptionsMenu(menu);
+    }
+    
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item)
+    {
+        this.onMessage("onOptionsItemSelected", item);
+        return true;
+    }
 }


Mime
View raw message