From db04c398139d9b73e664e03dc894823a0c5c6dee Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Tue, 2 May 2017 14:40:05 -0700 Subject: [PATCH] Set `mainWebView` to use a wide viewport. Fixes https://redmine.stoutner.com/issues/113. --- app/src/main/assets/es/guide_domain_settings.html | 2 +- .../privacybrowser/activities/MainWebViewActivity.java | 6 ++++++ app/src/main/res/layout/main_webview.xml | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/src/main/assets/es/guide_domain_settings.html b/app/src/main/assets/es/guide_domain_settings.html index 9c6b6160..0c9478f1 100644 --- a/app/src/main/assets/es/guide_domain_settings.html +++ b/app/src/main/assets/es/guide_domain_settings.html @@ -49,7 +49,7 @@

-

When visiting a domain that has domain settings specified, the background of the URL text box is green.

+

Al visitar un dominio que tiene la configuración de dominio especificada, el fondo de la casilla de texto de la URL es verde.

diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java index 25e61890..0701a162 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java @@ -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(); diff --git a/app/src/main/res/layout/main_webview.xml b/app/src/main/res/layout/main_webview.xml index d395ac59..1269da69 100644 --- a/app/src/main/res/layout/main_webview.xml +++ b/app/src/main/res/layout/main_webview.xml @@ -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 @@ -- 2.45.2