+ 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);
+ }
+ }
+
+ // Set the clear logcat preference icon.
+ if (clearEverything || savedPreferences.getBoolean(getString(R.string.clear_logcat_key), true)) {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) {
+ clearLogcatPreference.setIcon(R.drawable.bug_cleared_day);
+ } else {
+ clearLogcatPreference.setIcon(R.drawable.bug_cleared_night);
+ }
+ } else {
+ clearLogcatPreference.setIcon(R.drawable.bug_warning);
+ }
+
+ // Set the clear cache preference icon.
+ if (clearEverything || savedPreferences.getBoolean("clear_cache", true)) {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ clearCachePreference.setIcon(R.drawable.cache_cleared_night);
+ } else {
+ clearCachePreference.setIcon(R.drawable.cache_cleared_day);
+ }
+ } else {
+ clearCachePreference.setIcon(R.drawable.cache_warning);
+ }
+
+ // Set the open intents in new tab preference icon.
+ if (savedPreferences.getBoolean("open_intents_in_new_tab", true)) {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ openIntentsInNewTabPreference.setIcon(R.drawable.tab_enabled_night);
+ } else {
+ openIntentsInNewTabPreference.setIcon(R.drawable.tab_enabled_day);
+ }
+ } else {
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ openIntentsInNewTabPreference.setIcon(R.drawable.tab_disabled_night);
+ } else {
+ openIntentsInNewTabPreference.setIcon(R.drawable.tab_disabled_day);
+ }