mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-31 17:32:51 +08:00
[CB-2504] Allow the disabling of overscroll glow.
This commit is contained in:
parent
cb192056f8
commit
f415664b6d
@ -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");
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user