diff --git a/framework/src/org/apache/cordova/Config.java b/framework/src/org/apache/cordova/Config.java index e42d761b..f5de38db 100644 --- a/framework/src/org/apache/cordova/Config.java +++ b/framework/src/org/apache/cordova/Config.java @@ -148,6 +148,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"); diff --git a/framework/src/org/apache/cordova/DroidGap.java b/framework/src/org/apache/cordova/DroidGap.java index 9a7be4e8..6b890f6e 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);