+ if (MainWebViewActivity.darkTheme) {
+ doNotTrackPreference.setIcon(R.drawable.do_not_track_enabled_dark);
+ } else {
+ doNotTrackPreference.setIcon(R.drawable.do_not_track_enabled_light);
+ }
+ } else {
+ if (MainWebViewActivity.darkTheme) {
+ doNotTrackPreference.setIcon(R.drawable.do_not_track_disabled_dark);
+ } else {
+ doNotTrackPreference.setIcon(R.drawable.do_not_track_disabled_light);
+ }
+ }
+
+ // Set the Tor icons according to the theme.
+ if (proxyThroughOrbotBoolean) { // Proxying is enabled.
+ if (MainWebViewActivity.darkTheme) {
+ proxyThroughOrbotPreference.setIcon(R.drawable.orbot_enabled_dark);
+ torHomepagePreference.setIcon(R.drawable.home_enabled_dark);
+ torSearchPreference.setIcon(R.drawable.search_enabled_dark);
+
+ // Set the custom search icon.
+ if (torSearchCustomURLPreference.isEnabled()) {
+ torSearchCustomURLPreference.setIcon(R.drawable.search_custom_url_enabled_dark);
+ } else {
+ torSearchCustomURLPreference.setIcon(R.drawable.search_custom_url_ghosted_dark);
+ }
+ } else {
+ proxyThroughOrbotPreference.setIcon(R.drawable.orbot_enabled_light);
+ torHomepagePreference.setIcon(R.drawable.home_enabled_light);
+ torSearchPreference.setIcon(R.drawable.search_enabled_light);
+
+ // Set the custom search icon.
+ if (torSearchCustomURLPreference.isEnabled()) {
+ torSearchCustomURLPreference.setIcon(R.drawable.search_custom_url_enabled_light);
+ } else {
+ torSearchCustomURLPreference.setIcon(R.drawable.search_custom_url_ghosted_light);
+ }
+ }
+ } else { // Proxying is disabled.
+ if (MainWebViewActivity.darkTheme) {
+ proxyThroughOrbotPreference.setIcon(R.drawable.orbot_disabled_dark);
+ torHomepagePreference.setIcon(R.drawable.home_ghosted_dark);
+ torSearchPreference.setIcon(R.drawable.search_ghosted_dark);
+ torSearchCustomURLPreference.setIcon(R.drawable.search_custom_url_ghosted_dark);
+ } else {
+ proxyThroughOrbotPreference.setIcon(R.drawable.orbot_disabled_light);
+ torHomepagePreference.setIcon(R.drawable.home_ghosted_light);
+ torSearchPreference.setIcon(R.drawable.search_ghosted_light);
+ torSearchCustomURLPreference.setIcon(R.drawable.search_custom_url_ghosted_light);
+ }
+ }
+
+ // Set the `searchCustomURLPreference` icon.
+ if (searchCustomURLPreference.isEnabled()) {
+ if (MainWebViewActivity.darkTheme) {
+ searchCustomURLPreference.setIcon(R.drawable.search_custom_url_enabled_dark);
+ } else {
+ searchCustomURLPreference.setIcon(R.drawable.search_custom_url_enabled_light);
+ }
+ } else {
+ if (MainWebViewActivity.darkTheme) {
+ searchCustomURLPreference.setIcon(R.drawable.search_custom_url_ghosted_dark);
+ } else {
+ searchCustomURLPreference.setIcon(R.drawable.search_custom_url_ghosted_light);
+ }
+ }
+
+ // Set the full screen browsing mode icons.
+ if (fullScreenBrowsingModeBoolean) { // `fullScreenBrowsingModeBoolean` is `true`.
+ // Set the `fullScreenBrowsingModePreference` icon according to the theme.
+ if (MainWebViewActivity.darkTheme) {
+ fullScreenBrowsingModePreference.setIcon(R.drawable.full_screen_enabled_dark);
+ } else {
+ fullScreenBrowsingModePreference.setIcon(R.drawable.full_screen_enabled_light);
+ }
+
+ if (hideSystemBarsBoolean) { // `hideSystemBarsBoolean` is `true`.
+ // Set the icons according to the theme.
+ if (MainWebViewActivity.darkTheme) {
+ hideSystemBarsPreference.setIcon(R.drawable.hide_system_bars_enabled_dark);
+ translucentNavigationBarPreference.setIcon(R.drawable.translucent_bar_ghosted_dark);
+ } else {
+ hideSystemBarsPreference.setIcon(R.drawable.hide_system_bars_enabled_light);
+ translucentNavigationBarPreference.setIcon(R.drawable.translucent_bar_ghosted_light);
+ }
+ } else { // `hideSystemBarsBoolean` is `false`.
+ // Set the `hideSystemBarsPreference` icon according to the theme.
+ if (MainWebViewActivity.darkTheme) {
+ // Set the icon for `hideSystemBarsPreference`.
+ hideSystemBarsPreference.setIcon(R.drawable.hide_system_bars_disabled_dark);
+
+ // Set the icon for `translucentNavigationBarPreference`.
+ if (savedPreferences.getBoolean("translucent_navigation_bar", true)) {
+ translucentNavigationBarPreference.setIcon(R.drawable.translucent_bar_enabled_dark);
+ } else {
+ translucentNavigationBarPreference.setIcon(R.drawable.translucent_bar_disabled_dark);
+ }
+ } else {
+ // Set the icon for `hideSystemBarsPreference`.
+ hideSystemBarsPreference.setIcon(R.drawable.hide_system_bars_disabled_light);
+
+ // Set the icon for `translucentNavigationBarPreference`.
+ if (savedPreferences.getBoolean("translucent_navigation_bar", true)) {
+ translucentNavigationBarPreference.setIcon(R.drawable.translucent_bar_enabled_light);
+ } else {
+ translucentNavigationBarPreference.setIcon(R.drawable.translucent_bar_disabled_light);
+ }
+ }
+ }
+ } else { // `fullScreenBrowsingModeBoolean` is `false`.
+ // Set the icons according to the theme.
+ if (MainWebViewActivity.darkTheme) {
+ fullScreenBrowsingModePreference.setIcon(R.drawable.full_screen_disabled_dark);
+ hideSystemBarsPreference.setIcon(R.drawable.hide_system_bars_ghosted_dark);
+ translucentNavigationBarPreference.setIcon(R.drawable.translucent_bar_ghosted_dark);
+ } else {
+ fullScreenBrowsingModePreference.setIcon(R.drawable.full_screen_disabled_light);
+ hideSystemBarsPreference.setIcon(R.drawable.hide_system_bars_ghosted_light);
+ translucentNavigationBarPreference.setIcon(R.drawable.translucent_bar_ghosted_light);
+ }
+ }
+
+ // Set the `clearEverythingPreference` icon.
+ if (clearEverythingBoolean) {
+ if (MainWebViewActivity.darkTheme) {
+ clearEverythingPreference.setIcon(R.drawable.clear_everything_enabled_dark);
+ } else {
+ clearEverythingPreference.setIcon(R.drawable.clear_everything_enabled_light);
+ }
+ } else {
+ clearEverythingPreference.setIcon(R.drawable.clear_everything_disabled);
+ }
+
+ // Set the `clearCookiesPreference` icon.
+ if (clearEverythingBoolean || savedPreferences.getBoolean("clear_cookies", true)) {
+ if (MainWebViewActivity.darkTheme) {
+ clearCookiesPreference.setIcon(R.drawable.cookies_cleared_dark);
+ } else {
+ clearCookiesPreference.setIcon(R.drawable.cookies_cleared_light);
+ }
+ } else {
+ clearCookiesPreference.setIcon(R.drawable.cookies_warning);
+ }
+
+ // Set the `clearDomStoragePreference` icon.
+ if (clearEverythingBoolean || savedPreferences.getBoolean("clear_dom_storage", true)) {
+ if (MainWebViewActivity.darkTheme) {
+ clearDomStoragePreference.setIcon(R.drawable.dom_storage_cleared_dark);
+ } else {
+ clearDomStoragePreference.setIcon(R.drawable.dom_storage_cleared_light);
+ }
+ } else {
+ clearDomStoragePreference.setIcon(R.drawable.dom_storage_warning);
+ }
+
+ // Set the `clearFormDataPreference` icon.
+ if (clearEverythingBoolean || savedPreferences.getBoolean("clear_form_data", true)) {
+ if (MainWebViewActivity.darkTheme) {
+ clearFormDataPreference.setIcon(R.drawable.form_data_cleared_dark);
+ } else {
+ clearFormDataPreference.setIcon(R.drawable.form_data_cleared_light);
+ }