]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/commitdiff
Set `mainWebView` to use a wide viewport. Fixes https://redmine.stoutner.com/issues...
authorSoren Stoutner <soren@stoutner.com>
Tue, 2 May 2017 21:40:05 +0000 (14:40 -0700)
committerSoren Stoutner <soren@stoutner.com>
Tue, 2 May 2017 21:40:05 +0000 (14:40 -0700)
app/src/main/assets/es/guide_domain_settings.html
app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java
app/src/main/res/layout/main_webview.xml

index 9c6b61603043bee1da39252bfa2e34cb7ee27bf7..0c9478f144d60443bcfa59f7efb96f7dd96b44f4 100644 (file)
@@ -49,7 +49,7 @@
 
         <p><img class="center" src="images/domain_settings.png"></p>
 
-        <p>When visiting a domain that has domain settings specified, the background of the URL text box is green.</p>
+        <p>Al visitar un dominio que tiene la configuraciĆ³n de dominio especificada, el fondo de la casilla de texto de la URL es verde.</p>
 
         <p><img class="center" src="../en/images/green_url_bar.png"></p>
     </body>
index 25e61890f907c1f0f04659016dec1a0d82e9e793..0701a162a0fa9aecf83d7c719f0f3ad51ba1e712 100644 (file)
@@ -822,6 +822,12 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation
         // Hide zoom controls.
         mainWebView.getSettings().setDisplayZoomControls(false);
 
+        // Set `mainWebView` to use a wide viewport.  Otherwise, some web pages will be scrunched and some content will render outside the screen.
+        mainWebView.getSettings().setUseWideViewPort(true);
+
+        // Set `mainWebView` to load in overview mode (zoomed out to the maximum width).
+        mainWebView.getSettings().setLoadWithOverviewMode(true);
+
         // Initialize cookieManager.
         cookieManager = CookieManager.getInstance();
 
index d395ac594eb97088106b21018264f3b12a41d622..1269da69111f280d41700b087adb775aadf277e5 100644 (file)
@@ -23,8 +23,8 @@
     android:id="@+id/main_webview_relativelayout"
     xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
     android:layout_height="0dp"
+    android:layout_width="match_parent"
     android:layout_weight="1"
     tools:context="com.stoutner.privacybrowser.activities.MainWebViewActivity"
     tools:showIn="@layout/main_drawerlayout" >
@@ -44,8 +44,8 @@
         <!-- Google does not currently want to support hiding the AppBar on scroll for a WebView child with the Support Toolbar.  https://code.google.com/p/android/issues/detail?id=200394 -->
         <WebView
             android:id="@+id/main_webview"
-            android:layout_width="match_parent"
             android:layout_height="match_parent"
+            android:layout_width="match_parent"
             android:focusable="true"
             android:focusableInTouchMode="true"/>
     </android.support.v4.widget.SwipeRefreshLayout>