+ // Set the WebView theme preference icon.
+ switch (webViewThemeEntryNumber) {
+ case 0: // The system default WebView theme is selected.
+ // Set the icon according to the app theme.
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) {
+ webViewThemePreference.setIcon(R.drawable.webview_light_theme_day);
+ } else {
+ webViewThemePreference.setIcon(R.drawable.webview_dark_theme_night);
+ }
+ break;
+
+ case 1: // The light WebView theme is selected.
+ // Set the icon according to the app theme.
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) {
+ webViewThemePreference.setIcon(R.drawable.webview_light_theme_day);
+ } else {
+ webViewThemePreference.setIcon(R.drawable.webview_light_theme_night);
+ }
+ break;
+
+ case 2: // The dark WebView theme is selected.
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) {
+ webViewThemePreference.setIcon(R.drawable.webview_dark_theme_day);
+ } else {
+ webViewThemePreference.setIcon(R.drawable.webview_dark_theme_night);
+ }
+ break;
+ }
+