- // Set the icon according to the theme.
- if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
- easyListImageView.setImageDrawable(resources.getDrawable(R.drawable.block_ads_enabled_night));
- } else {
- easyListImageView.setImageDrawable(resources.getDrawable(R.drawable.block_ads_enabled_day));
- }
- } 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(resources.getDrawable(R.drawable.block_ads_disabled_night));
- } else {
- easyListImageView.setImageDrawable(resources.getDrawable(R.drawable.block_ads_disabled_day));
- }
- }
-
- // 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(resources.getDrawable(R.drawable.block_tracking_enabled_night));
- } else {
- easyPrivacyImageView.setImageDrawable(resources.getDrawable(R.drawable.block_tracking_enabled_day));
- }
- } 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(resources.getDrawable(R.drawable.block_tracking_disabled_night));
- } else {
- easyPrivacyImageView.setImageDrawable(resources.getDrawable(R.drawable.block_tracking_disabled_day));
- }
- }
-
- // 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(resources.getDrawable(R.drawable.social_media_enabled_night));
- } else {
- fanboysAnnoyanceListImageView.setImageDrawable(resources.getDrawable(R.drawable.social_media_enabled_day));
- }
- } 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(resources.getDrawable(R.drawable.social_media_disabled_night));
- } else {
- fanboysAnnoyanceListImageView.setImageDrawable(resources.getDrawable(R.drawable.social_media_disabled_day));
- }
- }
-
- // 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(resources.getDrawable(R.drawable.social_media_enabled_night));
- } else {
- fanboysSocialBlockingListImageView.setImageDrawable(resources.getDrawable(R.drawable.social_media_enabled_day));
- }
- } 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(resources.getDrawable(R.drawable.social_media_disabled_night));
- } else {
- fanboysSocialBlockingListImageView.setImageDrawable(resources.getDrawable(R.drawable.social_media_disabled_day));
- }
- }
- } else { // Fanboy's Annoyance List is on.
- // Disable Fanboy's Social Blocking List switch.
- fanboysSocialBlockingListSwitch.setEnabled(false);
-
- // Handle the status of 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);
- } 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(resources.getDrawable(R.drawable.social_media_ghosted_night));
- } else {
- fanboysSocialBlockingListImageView.setImageDrawable(resources.getDrawable(R.drawable.social_media_ghosted_day));
- }
- }
-
- // 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(resources.getDrawable(R.drawable.block_ads_enabled_night));
- } else {
- ultraListImageView.setImageDrawable(resources.getDrawable(R.drawable.block_ads_enabled_day));
- }
- } 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(resources.getDrawable(R.drawable.block_ads_disabled_night));
- } else {
- ultraListImageView.setImageDrawable(resources.getDrawable(R.drawable.block_ads_disabled_day));
- }
- }
-
- // Set the UltraPrivacy status. Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
- if (ultraPrivacyInt == 1) { // UltraPrivacy is on.
- // Turn the switch on.
- ultraPrivacySwitch.setChecked(true);
-
- // Set the icon according to the theme.
- if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
- ultraPrivacyImageView.setImageDrawable(resources.getDrawable(R.drawable.block_tracking_enabled_night));
- } else {
- ultraPrivacyImageView.setImageDrawable(resources.getDrawable(R.drawable.block_tracking_enabled_day));
- }
- } else { // EasyPrivacy is off.
- // Turn the switch off.
- ultraPrivacySwitch.setChecked(false);
-
- // Set the icon according to the theme.
- if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
- ultraPrivacyImageView.setImageDrawable(resources.getDrawable(R.drawable.block_tracking_disabled_night));
- } else {
- ultraPrivacyImageView.setImageDrawable(resources.getDrawable(R.drawable.block_tracking_disabled_day));
- }
- }
-
- // Set the third-party resource blocking status. Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
- if (blockAllThirdPartyRequestsInt == 1) { // Blocking all third-party requests is on.
- // Turn the switch on.
- blockAllThirdPartyRequestsSwitch.setChecked(true);
-
- // Set the icon according to the theme.
- if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
- blockAllThirdPartyRequestsImageView.setImageDrawable(resources.getDrawable(R.drawable.block_all_third_party_requests_enabled_night));
- } else {
- blockAllThirdPartyRequestsImageView.setImageDrawable(resources.getDrawable(R.drawable.block_all_third_party_requests_enabled_day));
- }
- } else { // Blocking all third-party requests is off.
- // Turn the switch off.
- blockAllThirdPartyRequestsSwitch.setChecked(false);
-
- // Set the icon according to the theme.
- if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
- blockAllThirdPartyRequestsImageView.setImageDrawable(resources.getDrawable(R.drawable.block_all_third_party_requests_disabled_night));
- } else {
- blockAllThirdPartyRequestsImageView.setImageDrawable(resources.getDrawable(R.drawable.block_all_third_party_requests_disabled_day));
- }
- }