X-Git-Url: https://gitweb.stoutner.com/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Ffragments%2FSettingsFragment.java;h=784996d6137f712990826aadad1b0d0236077fe7;hb=17174f4ceb49bbdb01e2700b2c4d3b3aa670e18e;hp=0f7330bb83010555acafd6be440d24d2d47b3e2d;hpb=61a76e491469916f2f30aebb47b98cda7cceb557;p=PrivacyBrowserAndroid.git diff --git a/app/src/main/java/com/stoutner/privacybrowser/fragments/SettingsFragment.java b/app/src/main/java/com/stoutner/privacybrowser/fragments/SettingsFragment.java index 0f7330bb..784996d6 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/fragments/SettingsFragment.java +++ b/app/src/main/java/com/stoutner/privacybrowser/fragments/SettingsFragment.java @@ -79,16 +79,15 @@ public class SettingsFragment extends PreferenceFragment { thirdPartyCookiesEnabled.setEnabled(savedPreferences.getBoolean("first_party_cookies_enabled", false)); - // We need an inflated `WebView` to get the default user agent. + // We need to inflated a `WebView` to get the default user agent. LayoutInflater inflater = getActivity().getLayoutInflater(); - // `@SuppressLint("InflateParams")` removes the warning about using `null` as the `ViewGroup`, which in this case makes sense because we don't want to display `bare_webview` on the screen. - // `false` does not attach the view to the root. + // `@SuppressLint("InflateParams")` removes the warning about using `null` as the `ViewGroup`, which in this case makes sense because we don't want to display `bare_webview` on the screen. `false` does not attach the view to the root. @SuppressLint("InflateParams") View bareWebViewLayout = inflater.inflate(R.layout.bare_webview, null, false); final WebView bareWebView = (WebView) bareWebViewLayout.findViewById(R.id.bare_webview); // Set the current user-agent as the summary text for the "user_agent" preference when the preference screen is loaded. switch (savedPreferences.getString("user_agent", "PrivacyBrowser/1.0")) { - case "Default user agent": + case "WebView default user agent": // Get the user agent text from the webview (which changes based on the version of Android and WebView installed). userAgentPreference.setSummary(bareWebView.getSettings().getUserAgentString()); break; @@ -188,8 +187,8 @@ public class SettingsFragment extends PreferenceFragment { torJavaScriptEnabledSearchCustomURLPreference.setEnabled(proxyThroughOrbot && torJavaScriptEnabledSearchString.equals("Custom URL")); - // Set the homepage URL as the summary text for the `Homepage` preference when the preference screen is loaded. The default is `https://www.duckduckgo.com`. - homepagePreference.setSummary(savedPreferences.getString("homepage", "https://www.duckduckgo.com")); + // Set the homepage URL as the summary text for the `Homepage` preference when the preference screen is loaded. The default is `https://duckduckgo.com`. + homepagePreference.setSummary(savedPreferences.getString("homepage", "https://duckduckgo.com")); // Set the default font size as the summary text for the `Default Font Size` preference when the preference screen is loaded. The default is `100`. defaultFontSizePreference.setSummary(defaultFontSizeString + "%%"); @@ -219,7 +218,7 @@ public class SettingsFragment extends PreferenceFragment { String userAgentString = sharedPreferences.getString("user_agent", "PrivacyBrowser/1.0"); switch (userAgentString) { - case "Default user agent": + case "WebView default user agent": // Display the user agent as the summary text for `userAgentPreference`, and disable `customUserAgent`. userAgentPreference.setSummary(bareWebView.getSettings().getUserAgentString()); customUserAgent.setEnabled(false);