CB-2504: Merged overscroll disallowance, needed to deal with merge conflict with the InAppStorage toggle

This commit is contained in:
Joe Bowser 2013-02-21 10:45:50 -08:00
commit a30c2b6a75
2 changed files with 13 additions and 0 deletions

View File

@ -148,6 +148,11 @@ public class Config {
boolean value = xml.getAttributeValue(null, "value").equals("true"); boolean value = xml.getAttributeValue(null, "value").equals("true");
action.getIntent().putExtra(name, value); action.getIntent().putExtra(name, value);
} }
else if(name.equals("disallowOverscroll"))
{
boolean value = xml.getAttributeValue(null, "value").equals("true");
action.getIntent().putExtra(name, value);
}
else else
{ {
String value = xml.getAttributeValue(null, "value"); String value = xml.getAttributeValue(null, "value");

View File

@ -28,6 +28,7 @@ import org.apache.cordova.api.LOG;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import android.annotation.SuppressLint;
import android.app.Activity; import android.app.Activity;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.Dialog; import android.app.Dialog;
@ -332,6 +333,7 @@ public class DroidGap extends Activity implements CordovaInterface {
* @param webViewClient * @param webViewClient
* @param webChromeClient * @param webChromeClient
*/ */
@SuppressLint("NewApi")
public void init(CordovaWebView webView, CordovaWebViewClient webViewClient, CordovaChromeClient webChromeClient) { public void init(CordovaWebView webView, CordovaWebViewClient webViewClient, CordovaChromeClient webChromeClient) {
LOG.d(TAG, "DroidGap.init()"); LOG.d(TAG, "DroidGap.init()");
@ -349,6 +351,12 @@ public class DroidGap extends Activity implements CordovaInterface {
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT,
1.0F)); 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 // Add web view but make it invisible while loading URL
this.appView.setVisibility(View.INVISIBLE); this.appView.setVisibility(View.INVISIBLE);
this.root.addView(this.appView); this.root.addView(this.appView);