- }
- }
- break;
-
- case "first_party_cookies":
- // Update the icons for `first_party_cookies` and `third_party_cookies`.
- if (sharedPreferences.getBoolean("first_party_cookies", false)) {
- // Set the icon for `first_party_cookies`.
- firstPartyCookiesPreference.setIcon(R.drawable.cookies_enabled);
-
- // Update the icon for `third_party_cookies`.
- if (Build.VERSION.SDK_INT >= 21) {
- if (sharedPreferences.getBoolean("third_party_cookies", false)) {
- thirdPartyCookiesPreference.setIcon(R.drawable.cookies_warning);
- } else {
- if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
- thirdPartyCookiesPreference.setIcon(R.drawable.cookies_disabled_night);
- } else {
- thirdPartyCookiesPreference.setIcon(R.drawable.cookies_disabled_day);
- }
- }
- } else {
- if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
- thirdPartyCookiesPreference.setIcon(R.drawable.cookies_ghosted_night);
- } else {
- thirdPartyCookiesPreference.setIcon(R.drawable.cookies_ghosted_day);
- }
- }
- } else { // `first_party_cookies` is `false`.
- // Update the icon for `first_party_cookies`.
- if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
- firstPartyCookiesPreference.setIcon(R.drawable.cookies_disabled_night);
- } else {
- firstPartyCookiesPreference.setIcon(R.drawable.cookies_disabled_day);
- }
-
- // Set the icon for `third_party_cookies` to be ghosted.
- if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
- thirdPartyCookiesPreference.setIcon(R.drawable.cookies_ghosted_night);