- hideSystemBarsPreference.setIcon(R.drawable.hide_system_bars_ghosted_light);
- translucentNavigationBarPreference.setIcon(R.drawable.translucent_bar_ghosted_light);
- }
- }
- break;
-
- case "hide_system_bars":
- if (sharedPreferences.getBoolean("hide_system_bars", false)) {
- // Disable `translucentNavigationBarPreference`.
- translucentNavigationBarPreference.setEnabled(false);
-
- // 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 { // `hide_system_bars` is false.
- // Enable `translucentNavigationBarPreference`.
- translucentNavigationBarPreference.setEnabled(true);
-
- // Set the icons according to the theme.
- if (MainWebViewActivity.darkTheme) {
- // Set the `hideSystemBarsPreference` icon.
- hideSystemBarsPreference.setIcon(R.drawable.hide_system_bars_disabled_dark);
-
- // Set the `translucentNavigationBarPreference` icon.
- if (sharedPreferences.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 `hideSystemBarsPreference` icon.
- hideSystemBarsPreference.setIcon(R.drawable.hide_system_bars_disabled_light);
-
- // Set the `translucentNavigationBarPreference` icon.
- if (sharedPreferences.getBoolean("translucent_navigation_bar", true)) {
- translucentNavigationBarPreference.setIcon(R.drawable.translucent_bar_enabled_light);
- } else {
- translucentNavigationBarPreference.setIcon(R.drawable.translucent_bar_disabled_light);
- }