]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/MainWebViewActivity.java
Trim white spaces from the beginning and end of the URL before loading. Fixes https...
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / MainWebViewActivity.java
index 993c363b338ee4b5986b3c7f607f66ad911ca72b..e4e68c36957255d62865e3dcfb6087cb34722a6e 100644 (file)
@@ -247,19 +247,7 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation
                  * SYSTEM_UI_FLAG_FULLSCREEN hides the status bar across the top of the screen.
                  * SYSTEM_UI_FLAG_IMMERSIVE_STICKY makes the navigation and status bars ghosted overlays and automatically rehides them.
                  */
-
-                // Set the one flag supported by API >= 14.
-                view.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
-
-                // Set the two flags that are supported by API >= 16.
-                if (Build.VERSION.SDK_INT >= 16) {
-                    view.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN);
-                }
-
-                // Set all three flags that are supported by API >= 19.
-                if (Build.VERSION.SDK_INT >= 19) {
-                    view.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
-                }
+                view.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
             }
 
             // Exit full screen video
@@ -768,8 +756,9 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation
     }
 
     private void loadUrlFromTextBox() throws UnsupportedEncodingException {
-        // Get the text from urlTextBox and convert it to a string.
-        String unformattedUrlString = urlTextBox.getText().toString();
+        // Get the text from urlTextBox and convert it to a string.  trim() removes white spaces from the beginning and end of the string.
+        String unformattedUrlString = urlTextBox.getText().toString().trim();
+
         URL unformattedUrl = null;
         Uri.Builder formattedUri = new Uri.Builder();