]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/commitdiff
Remove app bar scrolling because it broke pinch to zoom and some web pages.
authorSoren Stoutner <soren@stoutner.com>
Thu, 12 Nov 2015 03:38:44 +0000 (20:38 -0700)
committerSoren Stoutner <soren@stoutner.com>
Thu, 12 Nov 2015 03:38:44 +0000 (20:38 -0700)
app/src/main/java/com/stoutner/privacybrowser/Webview.java
app/src/main/res/layout/activity_webview.xml

index ff718ff961bd5a43f83b752bc35f00cec61b1c72..99a27344fd6e8651ceab2fb381f0f25950de7cc8 100644 (file)
@@ -33,7 +33,7 @@ public class Webview extends AppCompatActivity {
     static ProgressBar progressBar;
     static EditText urlTextBox;
     static ImageView favoriteIcon;
-    static final String homepage = "https://www.google.com/";
+    static final String homepage = "https://www.duckduckgo.com/";
 
     // Remove Android Studio's warning about the dangers of using SetJavaScriptEnabled.
     @SuppressLint("SetJavaScriptEnabled")
@@ -41,10 +41,6 @@ public class Webview extends AppCompatActivity {
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-
-        // FEATURE_ACTION_BAR_OVERLAY is required to scroll the actionBar.
-        supportRequestWindowFeature(AppCompatDelegate.FEATURE_SUPPORT_ACTION_BAR_OVERLAY);
-
         setContentView(R.layout.activity_webview);
 
         mainWebView = (WebView) findViewById(R.id.mainWebView);
@@ -62,9 +58,6 @@ public class Webview extends AppCompatActivity {
             favoriteIcon = (ImageView) actionBar.getCustomView().findViewById(R.id.favoriteIcon);
             urlTextBox = (EditText) actionBar.getCustomView().findViewById(R.id.urlTextBox);
             progressBar = (ProgressBar) actionBar.getCustomView().findViewById(R.id.progressBar);
-
-            // Scroll the actionBar.
-            actionBar.setHideOnContentScrollEnabled(true);
         }
 
         mainWebView.setWebViewClient(new WebViewClient() {
index d085905f54cc039cae26715eaf794b2e5845955d..d565fc0bd4418c09ac7acfe382288317ab1ba0dc 100644 (file)
@@ -1,18 +1,14 @@
-<!-- nextedScrollingEnabled is required to enable scrolling of the actionBar. -->
-<ScrollView
-    android:id="@+id/scrollView"
+<RelativeLayout
+    android:id="@+id/relativeLayout"
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:nestedScrollingEnabled="true" >
+    android:layout_height="match_parent">
 
-        <!-- layout_marginTop is required to force the top of the website below the overlayed actionBar. -->
         <WebView
             android:id="@+id/mainWebView"
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"
+            android:layout_height="match_parent"
             android:focusable="true"
-            android:focusableInTouchMode="true"
-            android:layout_marginTop="?attr/actionBarSize"/>
+            android:focusableInTouchMode="true" />
 
-</ScrollView>
+</RelativeLayout>