+ 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);
+ }
+
+ // Set the full screen browsing mode icons.
+ if (fullScreenBrowsingModeBoolean) {
+ // Set the `fullScreenBrowsingModePreference` icon.
+ fullScreenBrowsingModePreference.setIcon(R.drawable.full_screen_enabled);
+
+ if (hideSystemBarsBoolean) {
+ // Set `hideSystemBarsPreference` to use the enabled icon.
+ hideSystemBarsPreference.setIcon(R.drawable.hide_system_bars_enabled);
+
+ // Set `translucentNavigationBarPreference` to use the ghosted icon.
+ translucentNavigationBarPreference.setIcon(R.drawable.translucent_bar_ghosted);
+ } else { // `hideSystemBarsBoolean` is false.
+ // Set `hideSystemBarsPreference` to use the disabled icon.
+ hideSystemBarsPreference.setIcon(R.drawable.hide_system_bars_disabled);
+
+ // Set the correct icon for `translucentNavigationBarPreference`.
+ if (savedPreferences.getBoolean("translucent_navigation_bar", true)) {
+ translucentNavigationBarPreference.setIcon(R.drawable.translucent_bar_enabled);
+ } else {
+ translucentNavigationBarPreference.setIcon(R.drawable.translucent_bar_disabled);
+ }
+ }
+ } else { // `fullScreenBrowsingModeBoolean` is false.
+ fullScreenBrowsingModePreference.setIcon(R.drawable.full_screen_disabled);
+ hideSystemBarsPreference.setIcon(R.drawable.hide_system_bars_ghosted);
+ translucentNavigationBarPreference.setIcon(R.drawable.translucent_bar_ghosted);
+ }
+
+ // Set the `swipeToRefreshPreference` icon.
+ if (savedPreferences.getBoolean("swipe_to_refresh", false)) {
+ swipeToRefreshPreference.setIcon(R.drawable.refresh_enabled);
+ } else {
+ swipeToRefreshPreference.setIcon(R.drawable.refresh_disabled);
+ }
+
+ // Set the `displayAdditionalAppBarIconsPreference` icon.
+ if (savedPreferences.getBoolean("display_additional_app_bar_icons", false)) {
+ displayAdditionalAppBarIconsPreference.setIcon(R.drawable.more_enabled);
+ } else {
+ displayAdditionalAppBarIconsPreference.setIcon(R.drawable.more_disabled);
+ }
+
+ // Set the `displayWebpageImagesPreference` icon.
+ if (savedPreferences.getBoolean("display_webpage_images", true)) {
+ displayWebpageImagesPreference.setIcon(R.drawable.images_enabled);
+ } else {
+ displayWebpageImagesPreference.setIcon(R.drawable.images_disabled);
+ }