OSDN Git Service

CaptivePortal: login activity UI improvements
authorHugo Benichi <hugobenichi@google.com>
Thu, 11 May 2017 00:58:14 +0000 (09:58 +0900)
committerHugo Benichi <hugobenichi@google.com>
Fri, 12 May 2017 03:07:42 +0000 (12:07 +0900)
Similarly to commit 2e0915f14384901f25a41d698b39ef0add201550 for the
carrier portal login, this patch changes the default settings of the
webview used for the system captive portal login activity to allow
better user experience on "wide" login pages designed for desktop.

Differently from commit 2e0915f14384901f25a41d698b39ef0add201550, the
zooming buttons are not displayed (i.e zooming is possible only with
gesture).

Test: manually tested with captive portals.
Bug: 318139361922894636532213
Change-Id: I2579994da37f3b0f4c08e24e59c81f31835ab832

packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java

index 6394c64..34465e9 100644 (file)
@@ -122,6 +122,11 @@ public class CaptivePortalLoginActivity extends Activity {
         WebSettings webSettings = myWebView.getSettings();
         webSettings.setJavaScriptEnabled(true);
         webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_COMPATIBILITY_MODE);
+        webSettings.setUseWideViewPort(true);
+        webSettings.setLoadWithOverviewMode(true);
+        webSettings.setSupportZoom(true);
+        webSettings.setBuiltInZoomControls(true);
+        webSettings.setDisplayZoomControls(false);
         mWebViewClient = new MyWebViewClient();
         myWebView.setWebViewClient(mWebViewClient);
         myWebView.setWebChromeClient(new MyWebChromeClient());