+ domStorageSwitch.setChecked(domStorageInt == 1);
+
+ // Set the icon according to the theme.
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ domStorageImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.dom_storage_ghosted_night, null));
+ } else {
+ domStorageImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.dom_storage_ghosted_day, null));
+ }
+ }
+
+ // Set the form data visibility. Form data can be removed once the minimum API >= 26.
+ if (Build.VERSION.SDK_INT >= 26) { // Form data no longer applies to newer versions of Android.
+ // Hide the form data image view and switch.
+ formDataImageView.setVisibility(View.GONE);
+ formDataSwitch.setVisibility(View.GONE);
+ } else { // Form data should be displayed because this is an older version of Android.
+ if (formDataInt == 1) { // Form data is on.
+ // Turn the form data switch on.
+ formDataSwitch.setChecked(true);
+
+ // Set the form data icon.
+ formDataImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.form_data_enabled, null));
+ } else { // Form data is off.
+ // Turn the form data switch to off.
+ formDataSwitch.setChecked(false);
+
+ // Set the icon according to the theme. Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ formDataImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.form_data_disabled_night, null));
+ } else {
+ formDataImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.form_data_disabled_day, null));
+ }
+ }
+ }
+
+ // Set the EasyList status. Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
+ if (easyListInt == 1) { // EasyList is on.
+ // Turn the switch on.
+ easyListSwitch.setChecked(true);
+
+ // Set the icon according to the theme.
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ easyListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_ads_enabled_night, null));
+ } else {
+ easyListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_ads_enabled_day, null));
+ }
+ } else { // EasyList is off.
+ // Turn the switch off.
+ easyListSwitch.setChecked(false);
+
+ // Set the icon according to the theme.
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ easyListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_ads_disabled_night, null));
+ } else {
+ easyListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_ads_disabled_day, null));
+ }
+ }
+
+ // Set the EasyPrivacy status. Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
+ if (easyPrivacyInt == 1) { // EasyPrivacy is on.
+ // Turn the switch on.
+ easyPrivacySwitch.setChecked(true);
+
+ // Set the icon according to the theme.
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ easyPrivacyImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_tracking_enabled_night, null));
+ } else {
+ easyPrivacyImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_tracking_enabled_day, null));
+ }
+ } else { // EasyPrivacy is off.
+ // Turn the switch off.
+ easyPrivacySwitch.setChecked(false);
+
+ // Set the icon according to the theme.
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ easyPrivacyImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_tracking_disabled_night, null));
+ } else {
+ easyPrivacyImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_tracking_disabled_day, null));
+ }
+ }
+
+ // Set the Fanboy's Annoyance List status. Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
+ if (fanboysAnnoyanceListInt == 1) { // Fanboy's Annoyance List is on.
+ // Turn the switch on.
+ fanboysAnnoyanceListSwitch.setChecked(true);
+
+ // Set the icon according to the theme.
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ fanboysAnnoyanceListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.social_media_enabled_night, null));
+ } else {
+ fanboysAnnoyanceListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.social_media_enabled_day, null));
+ }
+ } else { // Fanboy's Annoyance List is off.
+ // Turn the switch off.
+ fanboysAnnoyanceListSwitch.setChecked(false);
+
+ // Set the icon according to the theme.
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ fanboysAnnoyanceListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.social_media_disabled_night, null));
+ } else {
+ fanboysAnnoyanceListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.social_media_disabled_day, null));
+ }
+ }
+
+ // Only enable Fanboy's Social Blocking List if Fanboy's Annoyance List is off.
+ if (fanboysAnnoyanceListInt == 0) { // Fanboy's Annoyance List is on.
+ // Enable Fanboy's Social Blocking List switch.
+ fanboysSocialBlockingListSwitch.setEnabled(true);
+
+ // Enable Fanboy's Social Blocking List. Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
+ if (fanboysSocialBlockingListInt == 1) { // Fanboy's Social Blocking List is on.
+ // Turn on Fanboy's Social Blocking List switch.
+ fanboysSocialBlockingListSwitch.setChecked(true);
+
+ // Set the icon according to the theme.
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ fanboysSocialBlockingListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.social_media_enabled_night, null));
+ } else {
+ fanboysSocialBlockingListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.social_media_enabled_day, null));
+ }
+ } else { // Fanboy's Social Blocking List is off.
+ // Turn off Fanboy's Social Blocking List switch.
+ fanboysSocialBlockingListSwitch.setChecked(false);
+
+ // Set the icon according to the theme.
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ fanboysSocialBlockingListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.social_media_disabled_night, null));
+ } else {
+ fanboysSocialBlockingListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.social_media_disabled_day, null));
+ }
+ }
+ } else { // Fanboy's Annoyance List is on.
+ // Disable Fanboy's Social Blocking List switch.
+ fanboysSocialBlockingListSwitch.setEnabled(false);
+
+ // Set the status of Fanboy's Social Blocking List.
+ fanboysSocialBlockingListSwitch.setChecked(fanboysSocialBlockingListInt == 1);
+
+ // Set the icon according to the theme.
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ fanboysSocialBlockingListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.social_media_ghosted_night, null));
+ } else {
+ fanboysSocialBlockingListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.social_media_ghosted_day, null));
+ }
+ }
+
+ // 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 (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ ultraListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_ads_enabled_night, null));
+ } else {
+ ultraListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_ads_enabled_day, null));
+ }
+ } else { // UltraList is off.
+ // Turn the switch off.
+ ultraListSwitch.setChecked(false);
+
+ // Set the icon according to the theme.
+ if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
+ ultraListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_ads_disabled_night, null));
+ } else {
+ ultraListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_ads_disabled_day, null));