+ defaultFontSizePreference.setSummary(savedPreferences.getString("default_font_size", "100") + "%%");
+
+
+ // Set the `javaScriptPreference` icon.
+ if (javaScriptEnabledBoolean) {
+ javaScriptPreference.setIcon(R.drawable.javascript_enabled);
+ } else {
+ javaScriptPreference.setIcon(R.drawable.privacy_mode);
+ }
+
+ // Set the `firstPartyCookiesPreference` icon.
+ if (firstPartyCookiesEnabledBoolean) {
+ firstPartyCookiesPreference.setIcon(R.drawable.cookies_enabled);
+ } else {
+ firstPartyCookiesPreference.setIcon(R.drawable.cookies_disabled);
+ }
+
+ // Set the `thirdPartyCookiesPreference` icon.
+ if (firstPartyCookiesEnabledBoolean && Build.VERSION.SDK_INT >= 21) {
+ if (thirdPartyCookiesEnabledBoolean) {
+ thirdPartyCookiesPreference.setIcon(R.drawable.cookies_warning);
+ } else {
+ thirdPartyCookiesPreference.setIcon(R.drawable.cookies_disabled);
+ }
+ } else {
+ thirdPartyCookiesPreference.setIcon(R.drawable.cookies_ghosted);
+ }
+
+ // Set the `domStoragePreference` icon.
+ if (javaScriptEnabledBoolean) {
+ if (savedPreferences.getBoolean("dom_storage_enabled", false)) {
+ domStoragePreference.setIcon(R.drawable.dom_storage_enabled);
+ } else {
+ domStoragePreference.setIcon(R.drawable.dom_storage_disabled);
+ }
+ } else {
+ domStoragePreference.setIcon(R.drawable.dom_storage_ghosted);
+ }
+
+ // Set the `saveFormDataPreference` icon.
+ if (savedPreferences.getBoolean("save_form_data_enabled", false)) {
+ saveFormDataPreference.setIcon(R.drawable.form_data_enabled);
+ } else {
+ saveFormDataPreference.setIcon(R.drawable.form_data_disabled);
+ }
+
+ // Set the `customUserAgentPreference` icon.
+ if (customUserAgentPreference.isEnabled()) {
+ customUserAgentPreference.setIcon(R.drawable.custom_user_agent_enabled);
+ } else {
+ customUserAgentPreference.setIcon(R.drawable.custom_user_agent_ghosted);
+ }
+
+ // Set the `blockAdsPreference` icon.
+ if (savedPreferences.getBoolean("block_ads", true)) {
+ blockAdsPreference.setIcon(R.drawable.block_ads_enabled);
+ } else {
+ blockAdsPreference.setIcon(R.drawable.block_ads_disabled);
+ }
+
+ // Set the `incognitoModePreference` icon.
+ if (savedPreferences.getBoolean("incognito_mode", false)) {
+ incognitoModePreference.setIcon(R.drawable.incognito_mode_enabled);
+ } else {
+ incognitoModePreference.setIcon(R.drawable.incognito_mode_disabled);
+ }
+
+ // Set the `doNotTrackPreference` icon.
+ if (savedPreferences.getBoolean("do_not_track", false)) {
+ doNotTrackPreference.setIcon(R.drawable.do_not_track_enabled);
+ } else {
+ doNotTrackPreference.setIcon(R.drawable.do_not_track_disabled);
+ }
+
+ // Set the `proxyThroughOrbotPreference` icon.
+ if (proxyThroughOrbotBoolean) {
+ proxyThroughOrbotPreference.setIcon(R.drawable.orbot_enabled);
+ } else {
+ proxyThroughOrbotPreference.setIcon(R.drawable.orbot_disabled);
+ }
+
+ // Set the `torSearchPreference` and `torSearchCustomURLPreference` icons.
+ if (proxyThroughOrbotBoolean) {
+ // Set the `torHomepagePreference` and `torSearchPreference` icons.
+ torHomepagePreference.setIcon(R.drawable.home_enabled);
+ torSearchPreference.setIcon(R.drawable.search_enabled);
+
+ // Set the `torSearchCustomURLPreference` icon.
+ if (torSearchCustomURLPreference.isEnabled()) {
+ torSearchCustomURLPreference.setIcon(R.drawable.search_custom_url_enabled);
+ } else {
+ torSearchCustomURLPreference.setIcon(R.drawable.search_custom_url_disabled);
+ }
+ } else { // Proxy through Orbot is disabled.
+ torHomepagePreference.setIcon(R.drawable.home_ghosted);
+ torSearchPreference.setIcon(R.drawable.search_ghosted);
+ torSearchCustomURLPreference.setIcon(R.drawable.search_custom_url_ghosted);
+ }
+
+ // Set the `searchCustomURLPreference` icon.
+ if (searchCustomURLPreference.isEnabled()) {
+ searchCustomURLPreference.setIcon(R.drawable.search_custom_url_enabled);
+ } else {
+ searchCustomURLPreference.setIcon(R.drawable.search_custom_url_ghosted);
+ }