From: Soren Stoutner Date: Fri, 23 Dec 2016 21:58:24 +0000 (-0700) Subject: Make a note in the settings that hiding the system bars doesn't work well if the... X-Git-Tag: v1.14~5 X-Git-Url: https://gitweb.stoutner.com/?a=commitdiff_plain;h=0d9d2c4b7eb45d9b6a1d68c801d08d522406b23f;p=PrivacyBrowserAndroid.git Make a note in the settings that hiding the system bars doesn't work well if the keyboard is displayed. --- diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebView.java b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebView.java index 345a7060..815d3fa8 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebView.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebView.java @@ -209,6 +209,9 @@ public class MainWebView extends AppCompatActivity implements NavigationView.OnN // `inputMethodManager` is used in `onOptionsItemSelected()`, `loadUrlFromTextBox()`, and `closeFindOnPage()`. private InputMethodManager inputMethodManager; + // `mainWebViewRelativeLayout` is used in `onCreate()` and `onNavigationItemSelected()`. + private RelativeLayout mainWebViewRelativeLayout; + @Override // Remove Android Studio's warning about the dangers of using SetJavaScriptEnabled. The whole premise of Privacy Browser is built around an understanding of these dangers. @SuppressLint("SetJavaScriptEnabled") @@ -256,6 +259,7 @@ public class MainWebView extends AppCompatActivity implements NavigationView.OnN // Get handles for views that need to be accessed. drawerLayout = (DrawerLayout) findViewById(R.id.drawerlayout); rootCoordinatorLayout = (CoordinatorLayout) findViewById(R.id.root_coordinatorlayout); + mainWebViewRelativeLayout = (RelativeLayout) findViewById(R.id.main_webview_relativelayout); mainWebView = (WebView) findViewById(R.id.mainWebView); findOnPageLinearLayout = (LinearLayout) findViewById(R.id.find_on_page_linearlayout); findOnPageEditText = (EditText) findViewById(R.id.find_on_page_edittext); @@ -287,10 +291,10 @@ public class MainWebView extends AppCompatActivity implements NavigationView.OnN // Remove the translucent status bar overlay on the `Drawer Layout`, which is special and needs its own command. drawerLayout.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); - /* SYSTEM_UI_FLAG_FULLSCREEN hides the status bar at the top of the screen. - * SYSTEM_UI_FLAG_HIDE_NAVIGATION hides the navigation bar on the bottom or right of the screen. - * SYSTEM_UI_FLAG_IMMERSIVE_STICKY makes the status and navigation bars translucent and automatically rehides them after they are shown. - */ + /* SYSTEM_UI_FLAG_FULLSCREEN hides the status bar at the top of the screen. + * SYSTEM_UI_FLAG_HIDE_NAVIGATION hides the navigation bar on the bottom or right of the screen. + * SYSTEM_UI_FLAG_IMMERSIVE_STICKY makes the status and navigation bars translucent and automatically rehides them after they are shown. + */ rootCoordinatorLayout.setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); // Set `rootCoordinatorLayout` to fill the whole screen. @@ -1150,7 +1154,6 @@ public class MainWebView extends AppCompatActivity implements NavigationView.OnN customHeaders.clear(); // Detach all views from `mainWebViewRelativeLayout`. - RelativeLayout mainWebViewRelativeLayout = (RelativeLayout) findViewById(R.id.mainWebViewRelativeLayout); mainWebViewRelativeLayout.removeAllViews(); // Destroy the internal state of `mainWebView`. diff --git a/app/src/main/res/layout/main_webview.xml b/app/src/main/res/layout/main_webview.xml index d2feac92..57d70ca5 100644 --- a/app/src/main/res/layout/main_webview.xml +++ b/app/src/main/res/layout/main_webview.xml @@ -20,7 +20,7 @@ Habilitar pantalla completa Doble toque para pantalla completa. Esconder las barras del systema - Esconder las barras de estado y de navegación en el modo de pantalla completa. + Esconder las barras de estado y de navegación en el modo de pantalla completa. Esto causa problems si el teclado se muestra en el modo de pantalla completa. Barra de navegación translúcida Hacer la barra de navegación translúcida en el modo de pantalla completa. General diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c46c6e2e..f3274ce2 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -285,9 +285,9 @@ Enable full screen browsing mode Double-tap to toggle full screen browsing mode. Hide system bars - Hide the status and navigation bars in full screen mode. + Hide the status and navigation bars in full screen browsing mode. This doesn\'t work well if the keyboard is displayed during full screen browsing mode. Translucent navigation bar - Make the navigation bar translucent in full screen mode. + Make the navigation bar translucent in full screen browsing mode. General Homepage Default font size