X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2FMainWebViewActivity.java;h=c9130db8259f7d36867b4620f8b15454fa01c879;hp=61b208a84b589b13e7142d7911050aeaa9d73aa8;hb=7be94bb0402710b112f269a07674a2f19150b54c;hpb=fed0059091902592606bfb3c449f445b454f4432 diff --git a/app/src/main/java/com/stoutner/privacybrowser/MainWebViewActivity.java b/app/src/main/java/com/stoutner/privacybrowser/MainWebViewActivity.java index 61b208a8..c9130db8 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/MainWebViewActivity.java @@ -226,9 +226,7 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateHome */ // Set the one flag supported by API >= 14. - if (Build.VERSION.SDK_INT >= 14) { - view.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); - } + view.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); // Set the two flags that are supported by API >= 16. if (Build.VERSION.SDK_INT >= 16) { @@ -270,11 +268,10 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateHome // Add the URL as the description for the download. requestUri.setDescription(url); - // Show the download notification after the download is completed if the API is 11 or greater. - if (Build.VERSION.SDK_INT >= 11) { - requestUri.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED); - } + // Show the download notification after the download is completed. + requestUri.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED); + // Initiate the download and display a Snackbar. downloadManager.enqueue(requestUri); Snackbar.make(findViewById(R.id.mainWebView), R.string.download_started, Snackbar.LENGTH_SHORT).show(); } @@ -283,10 +280,8 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateHome // Allow pinch to zoom. mainWebView.getSettings().setBuiltInZoomControls(true); - // Hide zoom controls if the API is 11 or greater. - if (Build.VERSION.SDK_INT >= 11) { - mainWebView.getSettings().setDisplayZoomControls(false); - } + // Hide zoom controls. + mainWebView.getSettings().setDisplayZoomControls(false); // Initialize the default preference values the first time the program is run. PreferenceManager.setDefaultValues(this, R.xml.preferences, false); @@ -414,8 +409,6 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateHome } @Override - // @TargetApi(11) turns off the errors regarding copy and paste, which are removed from view in menu_webview.xml for lower version of Android. - @TargetApi(11) // Remove Android Studio's warning about the dangers of using SetJavaScriptEnabled. @SuppressLint("SetJavaScriptEnabled") // removeAllCookies is deprecated, but it is required for API < 21.