+ // 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 `clearEverythingPreference` icon.
+ if (clearEverythingBoolean) {
+ clearEverythingPreference.setIcon(R.drawable.clear_everything_enabled);
+ } else {
+ clearEverythingPreference.setIcon(R.drawable.clear_everything_disabled);
+ }
+
+ // Set the `clearCookiesPreference` icon.
+ if (clearEverythingBoolean || savedPreferences.getBoolean("clear_cookies", true)) {
+ clearCookiesPreference.setIcon(R.drawable.cookies_cleared);
+ } else {
+ clearCookiesPreference.setIcon(R.drawable.cookies_warning);
+ }
+
+ // Set the `clearDomStoragePreference` icon.
+ if (clearEverythingBoolean || savedPreferences.getBoolean("clear_dom_storage", true)) {
+ clearDomStoragePreference.setIcon(R.drawable.dom_storage_cleared);
+ } else {
+ clearDomStoragePreference.setIcon(R.drawable.dom_storage_warning);
+ }
+
+ // Set the `clearFormDataPreference` icon.
+ if (clearEverythingBoolean || savedPreferences.getBoolean("clear_form_data", true)) {
+ clearFormDataPreference.setIcon(R.drawable.form_data_cleared);
+ } else {
+ clearFormDataPreference.setIcon(R.drawable.form_data_warning);
+ }
+
+ // Set the `clearCachePreference` icon.
+ if (clearEverythingBoolean || savedPreferences.getBoolean("clear_cache", true)) {
+ clearCachePreference.setIcon(R.drawable.cache_cleared);
+ } else {
+ clearCachePreference.setIcon(R.drawable.cache_warning);
+ }
+
+ // 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 `darkThemePreference` icon.
+ if (savedPreferences.getBoolean("dark_theme", false)) {
+ darkThemePreference.setIcon(R.drawable.theme_dark);
+ } else {
+ darkThemePreference.setIcon(R.drawable.theme_light);
+ }
+
+ // Set the `displayWebpageImagesPreference` icon.
+ if (savedPreferences.getBoolean("display_webpage_images", true)) {
+ displayWebpageImagesPreference.setIcon(R.drawable.images_enabled);
+ } else {
+ displayWebpageImagesPreference.setIcon(R.drawable.images_disabled);
+ }
+
+