- // Set the icon according to the theme.
- if (darkTheme) {
- easyListImageView.setImageDrawable(resources.getDrawable(R.drawable.block_ads_enabled_dark));
- } else {
- easyListImageView.setImageDrawable(resources.getDrawable(R.drawable.block_ads_enabled_light));
- }
- } else { // EasyList is off.
- // Turn the switch off.
- easyListSwitch.setChecked(false);
-
- // Set the icon according to the theme.
- if (darkTheme) {
- easyListImageView.setImageDrawable(resources.getDrawable(R.drawable.block_ads_disabled_dark));
- } else {
- easyListImageView.setImageDrawable(resources.getDrawable(R.drawable.block_ads_disabled_light));
- }
- }
-
- // Set the EasyPrivacy status. Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
- if (easyPrivacyEnabledInt == 1) { // EasyPrivacy is on.
- // Turn the switch on.
- easyPrivacySwitch.setChecked(true);
-
- // Set the icon according to the theme.
- if (darkTheme) {
- easyPrivacyImageView.setImageDrawable(resources.getDrawable(R.drawable.block_tracking_enabled_dark));
- } else {
- easyPrivacyImageView.setImageDrawable(resources.getDrawable(R.drawable.block_tracking_enabled_light));
- }
- } else { // EasyPrivacy is off.
- // Turn the switch off.
- easyPrivacySwitch.setChecked(false);
-
- // Set the icon according to the theme.
- if (darkTheme) {
- easyPrivacyImageView.setImageDrawable(resources.getDrawable(R.drawable.block_tracking_disabled_dark));
- } else {
- easyPrivacyImageView.setImageDrawable(resources.getDrawable(R.drawable.block_tracking_disabled_light));
- }
- }
-
- // 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 (darkTheme) {
- fanboysAnnoyanceListImageView.setImageDrawable(resources.getDrawable(R.drawable.social_media_enabled_dark));
- } else {
- fanboysAnnoyanceListImageView.setImageDrawable(resources.getDrawable(R.drawable.social_media_enabled_light));
- }
- } else { // Fanboy's Annoyance List is off.
- // Turn the switch off.
- fanboysAnnoyanceListSwitch.setChecked(false);
-
- // Set the icon according to the theme.
- if (darkTheme) {
- fanboysAnnoyanceListImageView.setImageDrawable(resources.getDrawable(R.drawable.social_media_disabled_dark));
- } else {
- fanboysAnnoyanceListImageView.setImageDrawable(resources.getDrawable(R.drawable.social_media_disabled_light));
- }
- }
-
- // 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. 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.
- // Enable the switch and turn it on.
- fanboysSocialBlockingListSwitch.setEnabled(true);
- fanboysSocialBlockingListSwitch.setChecked(true);
-
- // Set the icon according to the theme.
- if (darkTheme) {
- fanboysSocialBlockingListImageView.setImageDrawable(resources.getDrawable(R.drawable.social_media_enabled_dark));
- } else {
- fanboysSocialBlockingListImageView.setImageDrawable(resources.getDrawable(R.drawable.social_media_enabled_light));
- }
- } else { // Fanboy's Social Blocking List is off.
- // Enable the switch but turn it off.
- fanboysSocialBlockingListSwitch.setEnabled(true);
- fanboysSocialBlockingListSwitch.setChecked(false);
-
- // Set the icon according to the theme.
- if (darkTheme) {
- fanboysSocialBlockingListImageView.setImageDrawable(resources.getDrawable(R.drawable.social_media_disabled_dark));
- } else {
- fanboysSocialBlockingListImageView.setImageDrawable(resources.getDrawable(R.drawable.social_media_disabled_light));
- }
- }
- } else { // Fanboy's Annoyance List is on.
- // Disable 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.
- // Disable the switch but turn it on.
- fanboysSocialBlockingListSwitch.setEnabled(false);
- fanboysSocialBlockingListSwitch.setChecked(true);
- } else { // Fanboy's Social Blocking List is off.
- // Disable the switch and turn it off.
- fanboysSocialBlockingListSwitch.setEnabled(false);
- fanboysSocialBlockingListSwitch.setChecked(false);
- }
-
- // Set the icon according to the theme.
- if (darkTheme) {
- fanboysSocialBlockingListImageView.setImageDrawable(resources.getDrawable(R.drawable.social_media_ghosted_dark));
- } else {
- fanboysSocialBlockingListImageView.setImageDrawable(resources.getDrawable(R.drawable.social_media_ghosted_light));
- }
- }
-
- // Set the UltraPrivacy status. Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
- if (ultraPrivacyEnabledInt == 1) { // UltraPrivacy is on.
- // Turn the switch on.
- ultraPrivacySwitch.setChecked(true);
-
- // Set the icon according to the theme.
- if (darkTheme) {
- ultraPrivacyImageView.setImageDrawable(resources.getDrawable(R.drawable.block_tracking_enabled_dark));
- } else {
- ultraPrivacyImageView.setImageDrawable(resources.getDrawable(R.drawable.block_tracking_enabled_light));
- }
- } else { // EasyPrivacy is off.
- // Turn the switch off.
- ultraPrivacySwitch.setChecked(false);
-
- // Set the icon according to the theme.
- if (darkTheme) {
- ultraPrivacyImageView.setImageDrawable(resources.getDrawable(R.drawable.block_tracking_disabled_dark));
- } else {
- ultraPrivacyImageView.setImageDrawable(resources.getDrawable(R.drawable.block_tracking_disabled_light));
- }
- }
-
- // 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 (darkTheme) {
- blockAllThirdPartyRequestsImageView.setImageDrawable(resources.getDrawable(R.drawable.block_all_third_party_requests_enabled_dark));
- } else {
- blockAllThirdPartyRequestsImageView.setImageDrawable(resources.getDrawable(R.drawable.block_all_third_party_requests_enabled_light));
- }
- } else { // Blocking all third-party requests is off.
- // Turn the switch off.
- blockAllThirdPartyRequestsSwitch.setChecked(false);
-
- // Set the icon according to the theme.
- if (darkTheme) {
- blockAllThirdPartyRequestsImageView.setImageDrawable(resources.getDrawable(R.drawable.block_all_third_party_requests_disabled_dark));
- } else {
- blockAllThirdPartyRequestsImageView.setImageDrawable(resources.getDrawable(R.drawable.block_all_third_party_requests_disabled_light));
- }
- }