mirror of
https://github.com/apache/cordova-android.git
synced 2026-02-21 00:02:46 +08:00
Moving LinearLayoutSoftKeyboardDetect out into its own class and making it more plugin-like
This commit is contained in:
34
framework/src/com/phonegap/KeyboardHandler.java
Normal file
34
framework/src/com/phonegap/KeyboardHandler.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package com.phonegap;
|
||||
|
||||
import org.json.JSONArray;
|
||||
|
||||
import com.phonegap.api.Plugin;
|
||||
import com.phonegap.api.PluginResult;
|
||||
|
||||
public class KeyboardHandler extends Plugin {
|
||||
|
||||
|
||||
/*
|
||||
* This will never be called!
|
||||
* (non-Javadoc)
|
||||
* @see com.phonegap.api.Plugin#execute(java.lang.String, org.json.JSONArray, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public PluginResult execute(String action, JSONArray args, String callbackId) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessage(String id, Object data)
|
||||
{
|
||||
if(id.equals("keyboardHidden"))
|
||||
{
|
||||
super.sendJavascript("PhoneGap.fireDocumentEvent('hidekeyboard');");
|
||||
}
|
||||
else if(id.equals("keyboardVisible"))
|
||||
{
|
||||
super.sendJavascript("PhoneGap.fireDocumentEvent('showkeyboard');");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user