- // Set the WebView theme icon and text visibility. Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
- switch (webViewThemeInt) {
- case DomainsDatabaseHelper.SYSTEM_DEFAULT: // The domain WebView theme is system default.
- // Set the icon according to the app WebView theme.
- switch (appWebViewThemeEntryNumber) {
- case DomainsDatabaseHelper.SYSTEM_DEFAULT: // The default WebView theme is system default.
- // Set the icon according to the app theme.
- if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) {
- // Set the light mode icon.
- webViewThemeImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.webview_light_theme_day, null));
- } else {
- // Set the dark theme icon.
- webViewThemeImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.webview_dark_theme_night, null));
- }
- break;
-
- case DomainsDatabaseHelper.LIGHT_THEME: // the default WebView theme is light.
- // Set the icon according to the app theme.
- if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) {
- webViewThemeImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.webview_light_theme_day, null));
- } else {
- webViewThemeImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.webview_light_theme_night, null));
- }
- break;
-
- case DomainsDatabaseHelper.DARK_THEME: // the default WebView theme is dark.
- // Set the icon according to the app theme.
- if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) {
- webViewThemeImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.webview_dark_theme_day, null));
- } else {
- webViewThemeImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.webview_dark_theme_night, null)); }
- break;
- }
+ // Set the WebView theme icon and text visibility. Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
+ // Doing this makes no sense until it can also be done with the preferences.
+ switch (webViewThemeInt) {
+ case DomainsDatabaseHelper.SYSTEM_DEFAULT: // The domain WebView theme is system default.
+ // Set the icon according to the app WebView theme.
+ switch (appWebViewThemeEntryNumber) {
+ case DomainsDatabaseHelper.SYSTEM_DEFAULT: // The default WebView theme is system default.
+ // Set the icon according to the app theme.
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) {
+ // Set the light theme icon.
+ webViewThemeImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.webview_light_theme, null));
+ } else {
+ // Set the dark theme icon.
+ webViewThemeImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.webview_dark_theme, null));
+ }
+ break;