mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-22 00:32:55 +08:00
Changing to use JS directly. There are issues with this approach, and it should use the KeyboardHandler
This commit is contained in:
parent
7904bcc054
commit
308a5f1509
@ -19,7 +19,6 @@ public class KeyboardHandler extends Plugin {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onMessage(String id, Object data)
|
public void onMessage(String id, Object data)
|
||||||
{
|
{
|
||||||
if(id.equals("keyboardHidden"))
|
if(id.equals("keyboardHidden"))
|
||||||
|
@ -67,13 +67,13 @@ public class LinearLayoutSoftKeyboardDetect extends LinearLayout {
|
|||||||
// gone away.
|
// gone away.
|
||||||
else if (height > oldHeight) {
|
else if (height > oldHeight) {
|
||||||
if(app != null)
|
if(app != null)
|
||||||
app.postMessage("hideKeyboard", null);
|
app.sendJavascript("PhoneGap.fireDocumentEvent('hidekeyboard');");
|
||||||
}
|
}
|
||||||
// If the height as gotten smaller then we will assume the soft keyboard has
|
// If the height as gotten smaller then we will assume the soft keyboard has
|
||||||
// been displayed.
|
// been displayed.
|
||||||
else if (height < oldHeight) {
|
else if (height < oldHeight) {
|
||||||
if(app != null)
|
if(app != null)
|
||||||
app.postMessage("keyboardVisible", null);
|
app.sendJavascript("PhoneGap.fireDocumentEvent('showkeyboard');");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the old height for the next event
|
// Update the old height for the next event
|
||||||
|
Loading…
Reference in New Issue
Block a user