incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bows...@apache.org
Subject [4/17] git commit: Editing a comment about LinearLayoutSoftKeyboardDetect
Date Mon, 23 Jan 2012 23:05:54 GMT
Editing a comment about LinearLayoutSoftKeyboardDetect


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/7904bcc0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/7904bcc0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/7904bcc0

Branch: refs/heads/master
Commit: 7904bcc05404983f04246424865df3f231ba5247
Parents: c7e3b46
Author: Joe Bowser <bowserj@apache.org>
Authored: Mon Jan 23 14:01:07 2012 -0800
Committer: Joe Bowser <bowserj@apache.org>
Committed: Mon Jan 23 14:01:07 2012 -0800

----------------------------------------------------------------------
 .../phonegap/LinearLayoutSoftKeyboardDetect.java   |   20 ++++----------
 1 files changed, 6 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/7904bcc0/framework/src/com/phonegap/LinearLayoutSoftKeyboardDetect.java
----------------------------------------------------------------------
diff --git a/framework/src/com/phonegap/LinearLayoutSoftKeyboardDetect.java b/framework/src/com/phonegap/LinearLayoutSoftKeyboardDetect.java
index 32a7f6e..c1e455d 100644
--- a/framework/src/com/phonegap/LinearLayoutSoftKeyboardDetect.java
+++ b/framework/src/com/phonegap/LinearLayoutSoftKeyboardDetect.java
@@ -20,8 +20,7 @@ public class LinearLayoutSoftKeyboardDetect extends LinearLayout {
         super(context);     
         screenWidth = width;
         screenHeight = height;
-        if(context.getClass().getSimpleName().equals("DroidGap"))
-            app = (DroidGap) app;
+        app = (DroidGap) context;
     }
 
     @Override
@@ -30,9 +29,7 @@ public class LinearLayoutSoftKeyboardDetect extends LinearLayout {
      * gets smaller fire a show keyboard event and when height gets bigger fire 
      * a hide keyboard event.
      * 
-     * Note: We are using callbackServer.sendJavascript() instead of 
-     * this.appView.loadUrl() as changing the URL of the app would cause the 
-     * soft keyboard to go away.
+     * Note: We are using app.postMessage so that this is more compatible with the API
      * 
      * @param widthMeasureSpec
      * @param heightMeasureSpec
@@ -43,10 +40,11 @@ public class LinearLayoutSoftKeyboardDetect extends LinearLayout {
         LOG.v(TAG, "We are in our onMeasure method");
 
         // Get the current height of the visible part of the screen.
-        // This height will not included the status bar.
-        int height = MeasureSpec.getSize(heightMeasureSpec);
-        int width = MeasureSpec.getSize(widthMeasureSpec);
+        // This height will not included the status bar.\
+        int width, height;
 
+        height = MeasureSpec.getSize(heightMeasureSpec);
+        width = MeasureSpec.getSize(widthMeasureSpec);
         LOG.v(TAG, "Old Height = %d", oldHeight);
         LOG.v(TAG, "Height = %d", height);             
         LOG.v(TAG, "Old Width = %d", oldWidth);
@@ -76,12 +74,6 @@ public class LinearLayoutSoftKeyboardDetect extends LinearLayout {
         else if (height < oldHeight) {
             if(app != 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


Mime
View raw message