mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 15:12:51 +08:00
Minor fix to deal with weird keyboard focus issues and the back button. CB-1146
This commit is contained in:
parent
401584dbd8
commit
893ecec55e
@ -81,6 +81,8 @@ public class CordovaWebView extends WebView {
|
|||||||
|
|
||||||
private boolean volumeupBound;
|
private boolean volumeupBound;
|
||||||
|
|
||||||
|
private boolean handleButton = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
@ -749,7 +751,6 @@ public class CordovaWebView extends WebView {
|
|||||||
return super.onKeyUp(keyCode, event);
|
return super.onKeyUp(keyCode, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Log.d(TAG, "KeyUp has been triggered on the view");
|
Log.d(TAG, "KeyUp has been triggered on the view");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -788,6 +789,7 @@ public class CordovaWebView extends WebView {
|
|||||||
|
|
||||||
public void handlePause(boolean keepRunning)
|
public void handlePause(boolean keepRunning)
|
||||||
{
|
{
|
||||||
|
LOG.d(TAG, "Handle the pause");
|
||||||
// Send pause event to JavaScript
|
// Send pause event to JavaScript
|
||||||
this.loadUrl("javascript:try{cordova.fireDocumentEvent('pause');}catch(e){console.log('exception firing pause event from native');};");
|
this.loadUrl("javascript:try{cordova.fireDocumentEvent('pause');}catch(e){console.log('exception firing pause event from native');};");
|
||||||
|
|
||||||
@ -843,4 +845,8 @@ public class CordovaWebView extends WebView {
|
|||||||
this.pluginManager.onNewIntent(intent);
|
this.pluginManager.onNewIntent(intent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean hadKeyEvent() {
|
||||||
|
return handleButton;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1032,5 +1032,20 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
* @see android.app.Activity#onKeyUp(int, android.view.KeyEvent)
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onKeyUp(int keyCode, KeyEvent event)
|
||||||
|
{
|
||||||
|
if (appView.backHistory() || keyCode != KeyEvent.KEYCODE_BACK)
|
||||||
|
return appView.onKeyUp(keyCode, event);
|
||||||
|
else
|
||||||
|
return super.onKeyUp(keyCode, event);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user