+ // Set the EasyList icon.
+ if (savedPreferences.getBoolean("easylist", true)) {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ easyListPreference.setIcon(R.drawable.block_ads_enabled_night);
+ } else {
+ easyListPreference.setIcon(R.drawable.block_ads_enabled_day);
+ }
+ } else {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ easyListPreference.setIcon(R.drawable.block_ads_disabled_night);
+ } else {
+ easyListPreference.setIcon(R.drawable.block_ads_disabled_day);
+ }
+ }
+
+ // Set the EasyPrivacy icon.
+ if (savedPreferences.getBoolean("easyprivacy", true)) {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ easyPrivacyPreference.setIcon(R.drawable.block_tracking_enabled_night);
+ } else {
+ easyPrivacyPreference.setIcon(R.drawable.block_tracking_enabled_day);
+ }
+ } else {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ easyPrivacyPreference.setIcon(R.drawable.block_tracking_disabled_night);
+ } else {
+ easyPrivacyPreference.setIcon(R.drawable.block_tracking_disabled_day);
+ }
+ }
+
+ // Set the Fanboy lists icons.
+ if (fanboyAnnoyanceListEnabled) {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ // Set the Fanboy annoyance list icon.
+ fanboyAnnoyanceListPreference.setIcon(R.drawable.social_media_enabled_night);
+
+ // Set the Fanboy social blocking list icon.
+ fanboySocialBlockingListPreference.setIcon(R.drawable.social_media_ghosted_night);
+ } else {
+ // Set the Fanboy annoyance list icon.
+ fanboyAnnoyanceListPreference.setIcon(R.drawable.social_media_enabled_day);
+
+ // Set the Fanboy social blocking list icon.
+ fanboySocialBlockingListPreference.setIcon(R.drawable.social_media_ghosted_day);
+ }
+ } else {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ // Set the Fanboy annoyance list icon.
+ fanboyAnnoyanceListPreference.setIcon(R.drawable.social_media_disabled_night);
+
+ // Set the Fanboy social blocking list icon.
+ if (fanboySocialBlockingEnabled) {
+ fanboySocialBlockingListPreference.setIcon(R.drawable.social_media_enabled_night);
+ } else {
+ fanboySocialBlockingListPreference.setIcon(R.drawable.social_media_disabled_night);
+ }
+ } else {
+ // Set the Fanboy annoyance list icon.
+ fanboyAnnoyanceListPreference.setIcon(R.drawable.block_ads_disabled_day);
+
+ // Set the Fanboy social blocking list icon.
+ if (fanboySocialBlockingEnabled) {
+ fanboySocialBlockingListPreference.setIcon(R.drawable.social_media_enabled_day);
+ } else {
+ fanboySocialBlockingListPreference.setIcon(R.drawable.social_media_disabled_day);
+ }
+ }
+ }
+
+ // Set the UltraList icon.
+ if (savedPreferences.getBoolean("ultralist", true)){
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ ultraListPreference.setIcon(R.drawable.block_ads_enabled_night);
+ } else {
+ ultraListPreference.setIcon(R.drawable.block_ads_enabled_day);
+ }
+ } else {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ ultraListPreference.setIcon(R.drawable.block_ads_disabled_night);
+ } else {
+ ultraListPreference.setIcon(R.drawable.block_ads_disabled_day);
+ }
+ }
+
+ // Set the UltraPrivacy icon.
+ if (savedPreferences.getBoolean("ultraprivacy", true)) {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ ultraPrivacyPreference.setIcon(R.drawable.block_tracking_enabled_night);
+ } else {
+ ultraPrivacyPreference.setIcon(R.drawable.block_tracking_enabled_day);
+ }
+ } else {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ ultraPrivacyPreference.setIcon(R.drawable.block_tracking_disabled_night);
+ } else {
+ ultraPrivacyPreference.setIcon(R.drawable.block_tracking_disabled_day);
+ }
+ }
+
+ // Set the block all third-party requests icon.
+ if (savedPreferences.getBoolean("block_all_third_party_requests", false)) {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ blockAllThirdPartyRequestsPreference.setIcon(R.drawable.block_all_third_party_requests_enabled_night);
+ } else {
+ blockAllThirdPartyRequestsPreference.setIcon(R.drawable.block_all_third_party_requests_enabled_day);
+ }
+ } else {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ blockAllThirdPartyRequestsPreference.setIcon(R.drawable.block_all_third_party_requests_disabled_night);
+ } else {
+ blockAllThirdPartyRequestsPreference.setIcon(R.drawable.block_all_third_party_requests_disabled_day);
+ }
+ }
+
+ // Set the Google Analytics icon according to the theme.
+ if (savedPreferences.getBoolean("google_analytics", true)) {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ googleAnalyticsPreference.setIcon(R.drawable.modify_url_enabled_night);
+ } else {
+ googleAnalyticsPreference.setIcon(R.drawable.modify_url_enabled_day);
+ }
+ } else {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ googleAnalyticsPreference.setIcon(R.drawable.modify_url_disabled_night);
+ } else {
+ googleAnalyticsPreference.setIcon(R.drawable.modify_url_disabled_day);
+ }
+ }
+
+ // Set the Facebook Click IDs icon according to the theme.
+ if (savedPreferences.getBoolean("facebook_click_ids", true)) {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ facebookClickIdsPreference.setIcon(R.drawable.modify_url_enabled_night);
+ } else {
+ facebookClickIdsPreference.setIcon(R.drawable.modify_url_enabled_day);
+ }
+ } else {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ facebookClickIdsPreference.setIcon(R.drawable.modify_url_disabled_night);
+ } else {
+ facebookClickIdsPreference.setIcon(R.drawable.modify_url_disabled_day);
+ }
+ }
+
+ // Set the Twitter AMP redirects icon according to the theme.
+ if (savedPreferences.getBoolean("twitter_amp_redirects", true)) {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ twitterAmpRedirectsPreference.setIcon(R.drawable.modify_url_enabled_night);
+ } else {
+ twitterAmpRedirectsPreference.setIcon(R.drawable.modify_url_enabled_day);
+ }
+ } else {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ twitterAmpRedirectsPreference.setIcon(R.drawable.modify_url_disabled_night);
+ } else {
+ twitterAmpRedirectsPreference.setIcon(R.drawable.modify_url_disabled_day);
+ }
+ }
+
+ // Set the search custom URL icon.
+ if (searchCustomURLPreference.isEnabled()) {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ searchCustomURLPreference.setIcon(R.drawable.search_custom_url_enabled_night);
+ } else {
+ searchCustomURLPreference.setIcon(R.drawable.search_custom_url_enabled_day);
+ }
+ } else {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ searchCustomURLPreference.setIcon(R.drawable.search_custom_url_ghosted_night);
+ } else {
+ searchCustomURLPreference.setIcon(R.drawable.search_custom_url_ghosted_day);
+ }
+ }
+
+ // Set the Proxy icons according to the theme and status.
+ if (proxyString.equals("None")) { // Proxying is disabled.
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) { // Dark theme.
+ // Set the main proxy icon to be disabled.
+ proxyPreference.setIcon(R.drawable.proxy_disabled_night);
+
+ // Set the custom proxy URL icon to be ghosted.
+ proxyCustomUrlPreference.setIcon(R.drawable.proxy_ghosted_night);
+ } else { // Light theme.
+ // Set the main proxy icon to be disabled.
+ proxyPreference.setIcon(R.drawable.proxy_disabled_day);
+
+ // Set the custom proxy URL icon to be ghosted.
+ proxyCustomUrlPreference.setIcon(R.drawable.proxy_ghosted_day);
+ }
+ } else { // Proxying is enabled.
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) { // Dark theme.
+ // Set the main proxy icon to be enabled.
+ proxyPreference.setIcon(R.drawable.proxy_enabled_night);
+
+ // Set the custom proxy URL icon according to its status.
+ if (proxyCustomUrlPreference.isEnabled()) { // Custom proxy is enabled.
+ proxyCustomUrlPreference.setIcon(R.drawable.proxy_enabled_night);
+ } else { // Custom proxy is disabled.
+ proxyCustomUrlPreference.setIcon(R.drawable.proxy_ghosted_night);
+ }
+ } else { // Light theme.
+ // Set the main proxy icon to be enabled.
+ proxyPreference.setIcon(R.drawable.proxy_enabled_day);
+
+ // Set the custom proxy URL icon according to its status.
+ if (proxyCustomUrlPreference.isEnabled()) { // Custom proxy is enabled.
+ proxyCustomUrlPreference.setIcon(R.drawable.proxy_enabled_day);
+ } else { // Custom proxy is disabled.
+ proxyCustomUrlPreference.setIcon(R.drawable.proxy_ghosted_day);
+ }
+ }
+ }
+
+ // Set the full screen browsing mode icons.
+ if (fullScreenBrowsingMode) { // Full screen browsing mode is enabled.
+ // Set the `fullScreenBrowsingModePreference` icon according to the theme.
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ fullScreenBrowsingModePreference.setIcon(R.drawable.full_screen_enabled_night);
+ } else {
+ fullScreenBrowsingModePreference.setIcon(R.drawable.full_screen_enabled_day);
+ }
+
+ // Set the hide app bar icon.
+ if (savedPreferences.getBoolean("hide_app_bar", true)) { // Hide app bar is enabled.
+ // Set the icon according to the theme.
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ hideAppBarPreference.setIcon(R.drawable.app_bar_enabled_night);
+ } else {
+ hideAppBarPreference.setIcon(R.drawable.app_bar_enabled_day);
+ }
+ } else { // Hide app bar is disabled.
+ // Set the icon according to the theme.
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ hideAppBarPreference.setIcon(R.drawable.app_bar_disabled_night);
+ } else {
+ hideAppBarPreference.setIcon(R.drawable.app_bar_disabled_day);
+ }
+ }
+ } else { // Full screen browsing mode is disabled.
+ // Set the icons according to the theme.
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ fullScreenBrowsingModePreference.setIcon(R.drawable.full_screen_disabled_night);
+ hideAppBarPreference.setIcon(R.drawable.app_bar_ghosted_night);
+ } else {
+ fullScreenBrowsingModePreference.setIcon(R.drawable.full_screen_disabled_day);
+ hideAppBarPreference.setIcon(R.drawable.app_bar_ghosted_day);
+ }
+ }
+
+ // Set the clear everything preference icon.
+ if (clearEverything) {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ clearEverythingPreference.setIcon(R.drawable.clear_everything_enabled_night);
+ } else {
+ clearEverythingPreference.setIcon(R.drawable.clear_everything_enabled_day);
+ }
+ } else {
+ clearEverythingPreference.setIcon(R.drawable.clear_everything_disabled);
+ }
+
+ // Set the clear cookies preference icon.
+ if (clearEverything || savedPreferences.getBoolean("clear_cookies", true)) {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ clearCookiesPreference.setIcon(R.drawable.cookies_cleared_night);
+ } else {
+ clearCookiesPreference.setIcon(R.drawable.cookies_cleared_day);
+ }
+ } else {
+ clearCookiesPreference.setIcon(R.drawable.cookies_warning);
+ }
+
+ // Set the clear DOM storage preference icon.
+ if (clearEverything || savedPreferences.getBoolean("clear_dom_storage", true)) {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ clearDomStoragePreference.setIcon(R.drawable.dom_storage_cleared_night);
+ } else {
+ clearDomStoragePreference.setIcon(R.drawable.dom_storage_cleared_day);
+ }
+ } else {
+ clearDomStoragePreference.setIcon(R.drawable.dom_storage_warning);
+ }
+
+ // Set the clear form data preference icon if the API < 26. It has no effect on newer versions of Android.
+ if (Build.VERSION.SDK_INT < 26) {
+ if (clearEverything || savedPreferences.getBoolean("clear_form_data", true)) {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ clearFormDataPreference.setIcon(R.drawable.form_data_cleared_night);
+ } else {
+ clearFormDataPreference.setIcon(R.drawable.form_data_cleared_day);
+ }
+ } else {
+ clearFormDataPreference.setIcon(R.drawable.form_data_warning);
+ }
+ }