You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bo...@apache.org on 2013/02/21 19:46:04 UTC

[4/6] android commit: [CB-2504] Allow the disabling of overscroll glow.

[CB-2504] Allow the disabling of overscroll glow.

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

Branch: refs/heads/master
Commit: f415664b6da7be1c262c580057c12d40f04e284e
Parents: cb19205
Author: Max Woghiren <ma...@gmail.com>
Authored: Thu Feb 21 12:43:53 2013 -0500
Committer: Max Woghiren <ma...@gmail.com>
Committed: Thu Feb 21 12:47:59 2013 -0500

----------------------------------------------------------------------
 framework/src/org/apache/cordova/Config.java   |    5 +++++
 framework/src/org/apache/cordova/DroidGap.java |    8 ++++++++
 2 files changed, 13 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/f415664b/framework/src/org/apache/cordova/Config.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/Config.java b/framework/src/org/apache/cordova/Config.java
index 01eb2bb..a9411ff 100644
--- a/framework/src/org/apache/cordova/Config.java
+++ b/framework/src/org/apache/cordova/Config.java
@@ -143,6 +143,11 @@ public class Config {
                         boolean value = xml.getAttributeValue(null, "value").equals("true");
                         action.getIntent().putExtra(name, value);
                     }
+                    else if(name.equals("disallowOverscroll"))
+                    {
+                        boolean value = xml.getAttributeValue(null, "value").equals("true");
+                        action.getIntent().putExtra(name, value);
+                    }
                     else
                     {
                         String value = xml.getAttributeValue(null, "value");

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/f415664b/framework/src/org/apache/cordova/DroidGap.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/DroidGap.java b/framework/src/org/apache/cordova/DroidGap.java
index 9a7be4e..6b890f6 100755
--- a/framework/src/org/apache/cordova/DroidGap.java
+++ b/framework/src/org/apache/cordova/DroidGap.java
@@ -28,6 +28,7 @@ import org.apache.cordova.api.LOG;
 import org.json.JSONException;
 import org.json.JSONObject;
 
+import android.annotation.SuppressLint;
 import android.app.Activity;
 import android.app.AlertDialog;
 import android.app.Dialog;
@@ -332,6 +333,7 @@ public class DroidGap extends Activity implements CordovaInterface {
      * @param webViewClient
      * @param webChromeClient
      */
+    @SuppressLint("NewApi")
     public void init(CordovaWebView webView, CordovaWebViewClient webViewClient, CordovaChromeClient webChromeClient) {
         LOG.d(TAG, "DroidGap.init()");
 
@@ -349,6 +351,12 @@ public class DroidGap extends Activity implements CordovaInterface {
                 ViewGroup.LayoutParams.MATCH_PARENT,
                 1.0F));
 
+        if (this.getBooleanProperty("disallowOverscroll", false)) {
+            if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.GINGERBREAD) {
+                this.appView.setOverScrollMode(CordovaWebView.OVER_SCROLL_NEVER);
+            }
+        }
+
         // Add web view but make it invisible while loading URL
         this.appView.setVisibility(View.INVISIBLE);
         this.root.addView(this.appView);