/*
- * Copyright © 2016-2019 Soren Stoutner <soren@stoutner.com>.
+ * Copyright © 2016-2020 Soren Stoutner <soren@stoutner.com>.
*
* This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
*
Preference swipeToRefreshPreference = findPreference("swipe_to_refresh");
Preference scrollAppBarPreference = findPreference("scroll_app_bar");
Preference displayAdditionalAppBarIconsPreference = findPreference("display_additional_app_bar_icons");
- Preference downloadWithExternalAppPreference = findPreference("download_with_external_app");
Preference darkThemePreference = findPreference("dark_theme");
Preference nightModePreference = findPreference("night_mode");
Preference wideViewportPreference = findPreference("wide_viewport");
assert swipeToRefreshPreference != null;
assert scrollAppBarPreference != null;
assert displayAdditionalAppBarIconsPreference != null;
- assert downloadWithExternalAppPreference != null;
assert darkThemePreference != null;
assert nightModePreference != null;
assert wideViewportPreference != null;
}
}
- // Set the download with external app preference icon.
- if (savedPreferences.getBoolean("download_with_external_app", false)) {
- if (darkTheme) {
- downloadWithExternalAppPreference.setIcon(R.drawable.open_with_external_app_enabled_dark);
- } else {
- downloadWithExternalAppPreference.setIcon(R.drawable.open_with_external_app_enabled_light);
- }
- } else {
- if (darkTheme) {
- downloadWithExternalAppPreference.setIcon(R.drawable.open_with_external_app_disabled_dark);
- } else {
- downloadWithExternalAppPreference.setIcon(R.drawable.open_with_external_app_disabled_light);
- }
- }
-
// Set the dark theme preference icon.
if (savedPreferences.getBoolean("dark_theme", false)) {
darkThemePreference.setIcon(R.drawable.theme_dark);
}
break;
- case "download_with_external_app":
- // Update the icon.
- if (sharedPreferences.getBoolean("download_with_external_app", false)) {
- if (darkTheme) {
- downloadWithExternalAppPreference.setIcon(R.drawable.open_with_external_app_enabled_dark);
- } else {
- downloadWithExternalAppPreference.setIcon(R.drawable.open_with_external_app_enabled_light);
- }
- } else {
- if (darkTheme) {
- downloadWithExternalAppPreference.setIcon(R.drawable.open_with_external_app_disabled_dark);
- } else {
- downloadWithExternalAppPreference.setIcon(R.drawable.open_with_external_app_disabled_light);
- }
- }
- break;
-
case "dark_theme":
// Update the icon.
if (sharedPreferences.getBoolean("dark_theme", false)) {