incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bows...@apache.org
Subject [10/10] android commit: add volumeupbutton/volumedownbutton events
Date Mon, 11 Jun 2012 17:29:05 GMT
add volumeupbutton/volumedownbutton events


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/b323f329
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/b323f329
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/b323f329

Branch: refs/heads/master
Commit: b323f329cc185fba87ace193d6fd7e93373b1af2
Parents: 2625a57
Author: Julien Bouquillon <julien@bouquillon.com>
Authored: Thu May 10 02:04:11 2012 +0200
Committer: Julien Bouquillon <julien@bouquillon.com>
Committed: Thu May 10 02:06:31 2012 +0200

----------------------------------------------------------------------
 framework/src/org/apache/cordova/DroidGap.java |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/b323f329/framework/src/org/apache/cordova/DroidGap.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/DroidGap.java b/framework/src/org/apache/cordova/DroidGap.java
index 107eb52..a8b9df5 100755
--- a/framework/src/org/apache/cordova/DroidGap.java
+++ b/framework/src/org/apache/cordova/DroidGap.java
@@ -1087,6 +1087,18 @@ public class DroidGap extends Activity implements CordovaInterface
{
             return true;
         }
 
+        // If volumedown key
+        else if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {
+            this.appView.loadUrl("javascript:cordova.fireDocumentEvent('volumedownbutton');");
+            return super.onKeyUp(keyCode, event);
+        }
+
+        // If volumeup key
+        else if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) {
+            this.appView.loadUrl("javascript:cordova.fireDocumentEvent('volumeupbutton');");
+            return super.onKeyUp(keyCode, event);
+        }
+
         return false;
     }
 


Mime
View raw message