From e3dd6d8c883a0a9bfbde91f0abfc845d49a74e47 Mon Sep 17 00:00:00 2001 From: Andrew Grieve Date: Fri, 30 Jan 2015 11:17:08 -0500 Subject: [PATCH] CB-8387 Address TODO and have DisallowOverscroll preference set by AndroidWebView instead of CordovaActivity Now the preference will work even when not using CordovaActivity --- framework/src/org/apache/cordova/AndroidWebView.java | 4 ++++ framework/src/org/apache/cordova/CordovaActivity.java | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/framework/src/org/apache/cordova/AndroidWebView.java b/framework/src/org/apache/cordova/AndroidWebView.java index 66d17649..d0b6d05c 100755 --- a/framework/src/org/apache/cordova/AndroidWebView.java +++ b/framework/src/org/apache/cordova/AndroidWebView.java @@ -144,6 +144,10 @@ public class AndroidWebView extends WebView implements CordovaWebView { } exposeJsInterface(); + + if (preferences.getBoolean("DisallowOverscroll", false)) { + setOverScrollMode(View.OVER_SCROLL_NEVER); + } } @SuppressLint("SetJavaScriptEnabled") diff --git a/framework/src/org/apache/cordova/CordovaActivity.java b/framework/src/org/apache/cordova/CordovaActivity.java index 18bc43d9..e4ec1b53 100755 --- a/framework/src/org/apache/cordova/CordovaActivity.java +++ b/framework/src/org/apache/cordova/CordovaActivity.java @@ -154,11 +154,6 @@ public class CordovaActivity extends Activity implements CordovaInterface { protected void init() { appView = makeWebView(); - - // TODO: Have the views set this themselves. - if (preferences.getBoolean("DisallowOverscroll", false)) { - appView.getView().setOverScrollMode(View.OVER_SCROLL_NEVER); - } createViews(); // Wire the hardware volume controls to control media if desired.