mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-26 20:33:07 +08:00
Editing a comment about LinearLayoutSoftKeyboardDetect
This commit is contained in:
parent
c7e3b46e2e
commit
7904bcc054
@ -20,8 +20,7 @@ public class LinearLayoutSoftKeyboardDetect extends LinearLayout {
|
|||||||
super(context);
|
super(context);
|
||||||
screenWidth = width;
|
screenWidth = width;
|
||||||
screenHeight = height;
|
screenHeight = height;
|
||||||
if(context.getClass().getSimpleName().equals("DroidGap"))
|
app = (DroidGap) context;
|
||||||
app = (DroidGap) app;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -30,9 +29,7 @@ public class LinearLayoutSoftKeyboardDetect extends LinearLayout {
|
|||||||
* gets smaller fire a show keyboard event and when height gets bigger fire
|
* gets smaller fire a show keyboard event and when height gets bigger fire
|
||||||
* a hide keyboard event.
|
* a hide keyboard event.
|
||||||
*
|
*
|
||||||
* Note: We are using callbackServer.sendJavascript() instead of
|
* Note: We are using app.postMessage so that this is more compatible with the API
|
||||||
* this.appView.loadUrl() as changing the URL of the app would cause the
|
|
||||||
* soft keyboard to go away.
|
|
||||||
*
|
*
|
||||||
* @param widthMeasureSpec
|
* @param widthMeasureSpec
|
||||||
* @param heightMeasureSpec
|
* @param heightMeasureSpec
|
||||||
@ -43,10 +40,11 @@ public class LinearLayoutSoftKeyboardDetect extends LinearLayout {
|
|||||||
LOG.v(TAG, "We are in our onMeasure method");
|
LOG.v(TAG, "We are in our onMeasure method");
|
||||||
|
|
||||||
// Get the current height of the visible part of the screen.
|
// Get the current height of the visible part of the screen.
|
||||||
// This height will not included the status bar.
|
// This height will not included the status bar.\
|
||||||
int height = MeasureSpec.getSize(heightMeasureSpec);
|
int width, height;
|
||||||
int width = MeasureSpec.getSize(widthMeasureSpec);
|
|
||||||
|
|
||||||
|
height = MeasureSpec.getSize(heightMeasureSpec);
|
||||||
|
width = MeasureSpec.getSize(widthMeasureSpec);
|
||||||
LOG.v(TAG, "Old Height = %d", oldHeight);
|
LOG.v(TAG, "Old Height = %d", oldHeight);
|
||||||
LOG.v(TAG, "Height = %d", height);
|
LOG.v(TAG, "Height = %d", height);
|
||||||
LOG.v(TAG, "Old Width = %d", oldWidth);
|
LOG.v(TAG, "Old Width = %d", oldWidth);
|
||||||
@ -76,12 +74,6 @@ public class LinearLayoutSoftKeyboardDetect extends LinearLayout {
|
|||||||
else if (height < oldHeight) {
|
else if (height < oldHeight) {
|
||||||
if(app != null)
|
if(app != null)
|
||||||
app.postMessage("keyboardVisible", null);
|
app.postMessage("keyboardVisible", null);
|
||||||
/*
|
|
||||||
if (callbackServer != null) {
|
|
||||||
LOG.v(TAG, "Throw show keyboard event");
|
|
||||||
callbackServer.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