You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bo...@apache.org on 2012/12/04 21:06:20 UTC

android commit: More back button woes! The Fix for CB-1960 did weird things on both my end and Simon's end, sadly they're both different things. This should simply the code and resolve it. Sadly, all the unit tests pass as usual.

Updated Branches:
  refs/heads/master 8a19769a4 -> 3973f4f95


More back button woes! The Fix for CB-1960 did weird things on both my end and Simon's end, sadly they're both different things.  This should simply the code and resolve it.  Sadly, all the unit tests pass as usual.


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

Branch: refs/heads/master
Commit: 3973f4f9520b0c1d44a02098e2fa520771f04143
Parents: 8a19769
Author: Joe Bowser <bo...@apache.org>
Authored: Tue Dec 4 12:06:05 2012 -0800
Committer: Joe Bowser <bo...@apache.org>
Committed: Tue Dec 4 12:06:05 2012 -0800

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


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/3973f4f9/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 11c3a5f..ecff67a 100755
--- a/framework/src/org/apache/cordova/DroidGap.java
+++ b/framework/src/org/apache/cordova/DroidGap.java
@@ -1010,12 +1010,7 @@ public class DroidGap extends Activity implements CordovaInterface {
     {
         //Get whatever has focus!
         View childView = appView.getFocusedChild();
-    	//Determine if the focus is on the current view or not
-        if (appView.getHitTestResult() != null && childView == null &&
-                appView.getHitTestResult().getType() == WebView.HitTestResult.EDIT_TEXT_TYPE &&
-                (keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_MENU)) {
-                        return appView.onKeyUp(keyCode, event);
-        } else if (appView.isCustomViewShowing() && keyCode == KeyEvent.KEYCODE_BACK) {
+        if ((appView.isCustomViewShowing() || childView != null ) && keyCode == KeyEvent.KEYCODE_BACK) {
             return appView.onKeyUp(keyCode, event);
         } else {
             return super.onKeyUp(keyCode, event);
@@ -1032,10 +1027,10 @@ public class DroidGap extends Activity implements CordovaInterface {
     @Override
     public boolean onKeyDown(int keyCode, KeyEvent event)
     {
+        //Get whatever has focus!
+        View childView = appView.getFocusedChild();
         //Determine if the focus is on the current view or not
-        if (appView.getHitTestResult() != null && 
-            appView.getHitTestResult().getType() == WebView.HitTestResult.EDIT_TEXT_TYPE &&
-            keyCode == KeyEvent.KEYCODE_BACK) {
+        if (childView != null && keyCode == KeyEvent.KEYCODE_BACK) {
                     return appView.onKeyDown(keyCode, event);
         }
         else