- // Create a red foreground color span. The deprecated `resources.getColor` must be used until the minimum API >= 23.
- final ForegroundColorSpan redColorSpan = new ForegroundColorSpan(resources.getColor(R.color.red_a700));
-
- // Create a blue foreground color span.
+ // Create the foreground color spans.
+ final ForegroundColorSpan redColorSpan;
if (firstPartyCookiesInt == 1) { // First-party cookies are enabled.
// Set the third-party cookies status. Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
if (thirdPartyCookiesInt == 1) { // Both first-party and third-party cookies are enabled.
if (firstPartyCookiesInt == 1) { // First-party cookies are enabled.
// Set the third-party cookies status. Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
if (thirdPartyCookiesInt == 1) { // Both first-party and third-party cookies are enabled.
thirdPartyCookiesImageView.setImageDrawable(resources.getDrawable(R.drawable.cookies_warning));
} else { // First party cookies are enabled but third-party cookies are disabled.
thirdPartyCookiesImageView.setImageDrawable(resources.getDrawable(R.drawable.cookies_warning));
} else { // First party cookies are enabled but third-party cookies are disabled.
// Update the third-party cookies icon.
if (thirdPartyCookiesSwitch.isChecked()) { // Third-party cookies are enabled.
// Update the third-party cookies icon.
if (thirdPartyCookiesSwitch.isChecked()) { // Third-party cookies are enabled.
thirdPartyCookiesImageView.setImageDrawable(resources.getDrawable(R.drawable.cookies_warning));
} else { // Third-party cookies are disabled.
// Set the third-party cookies icon according to the theme.
thirdPartyCookiesImageView.setImageDrawable(resources.getDrawable(R.drawable.cookies_warning));
} else { // Third-party cookies are disabled.
// Set the third-party cookies icon according to the theme.
thirdPartyCookiesImageView.setImageDrawable(resources.getDrawable(R.drawable.cookies_warning));
} else {
// Update the third-party cookies icon according to the theme.
thirdPartyCookiesImageView.setImageDrawable(resources.getDrawable(R.drawable.cookies_warning));
} else {
// Update the third-party cookies icon according to the theme.