X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2FMainWebViewActivity.java;h=104522b600f0b9f467e539d27dc6a69d29d84bce;hp=372d25114d5b20c08946d910836fded6d5b29e36;hb=0abf9642763f1af98af73b2fc3cc44752a342db3;hpb=fd9ff6a6ce478729b4793e9900d7c745a09ee3d8 diff --git a/app/src/main/java/com/stoutner/privacybrowser/MainWebViewActivity.java b/app/src/main/java/com/stoutner/privacybrowser/MainWebViewActivity.java index 372d2511..104522b6 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/MainWebViewActivity.java @@ -89,9 +89,6 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation // It is also used in `onCreate()`, `onOptionsItemSelected()`, `onCreateHomeScreenShortcutCreate()`, and `loadUrlFromTextBox()`. public static String formattedUrlString; - // `customHeader` is public static so it can be accessed from `BookmarksActivity`. It is also used in `onCreate()`, `onOptionsItemSelected()`, and `loadUrlFromTextBox()`. - public static Map customHeaders = new HashMap<>(); - // `sslCertificate` is public static so it can be accessed from `ViewSslCertificate`. It is also used in `onCreate()`. public static SslCertificate sslCertificate; @@ -105,6 +102,9 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation // `cookieManager` is used in `onCreate()`, `onOptionsItemSelected()`, and `onNavigationItemSelected()`, and `onRestart()`. private CookieManager cookieManager; + // `customHeader` is used in `onCreate()`, `onOptionsItemSelected()`, and `loadUrlFromTextBox()`. + private final Map customHeaders = new HashMap<>(); + // `javaScriptEnabled` is also used in `onCreate()`, `onCreateOptionsMenu()`, `onOptionsItemSelected()`, `loadUrlFromTextBox()`, and `applySettings()`. // It is `Boolean` instead of `boolean` because `applySettings()` needs to know if it is `null`. private Boolean javaScriptEnabled; @@ -1073,6 +1073,7 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation cookieManager.setAcceptCookie(firstPartyCookiesEnabled); mainWebView.getSettings().setDomStorageEnabled(domStorageEnabled); mainWebView.getSettings().setSaveFormData(saveFormDataEnabled); + mainWebView.getSettings().setTextZoom(Integer.valueOf(defaultFontSizeString)); // Set third-party cookies status if API >= 21. if (Build.VERSION.SDK_INT >= 21) { @@ -1080,9 +1081,8 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation } } - // Apply the settings from `sharedPreferences`. + // Apply the other settings from `sharedPreferences`. homepage = homepageString; - mainWebView.getSettings().setTextZoom(Integer.valueOf(defaultFontSizeString)); swipeRefreshLayout.setEnabled(swipeToRefreshEnabled); // Set the user agent initial status.