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.

This commit is contained in:
Joe Bowser 2012-12-04 12:06:05 -08:00
parent 8a19769a47
commit 3973f4f952

View File

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