+ // Set the UltraList status. Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
+ if (ultraListInt == 1) { // UltraList is on.
+ // Turn the switch on.
+ ultraListSwitch.setChecked(true);
+
+ // Set the icon according to the theme.
+ if (darkTheme) {
+ ultraListImageView.setImageDrawable(resources.getDrawable(R.drawable.block_ads_enabled_dark));
+ } else {
+ ultraListImageView.setImageDrawable(resources.getDrawable(R.drawable.block_ads_enabled_light));
+ }
+ } else { // UltraList is off.
+ // Turn the switch off.
+ ultraListSwitch.setChecked(false);
+
+ // Set the icon according to the theme.
+ if (darkTheme) {
+ ultraListImageView.setImageDrawable(resources.getDrawable(R.drawable.block_ads_disabled_dark));
+ } else {
+ ultraListImageView.setImageDrawable(resources.getDrawable(R.drawable.block_ads_disabled_light));
+ }
+ }
+