Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/org/adblockplus/android/Preferences.java

Issue 5444834596749312: Update the checkbox when enabling Acceptable Ads (Closed)
Patch Set: Created Nov. 27, 2013, 9:02 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/org/adblockplus/android/Preferences.java
===================================================================
--- a/src/org/adblockplus/android/Preferences.java
+++ b/src/org/adblockplus/android/Preferences.java
@@ -41,6 +41,7 @@
import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
+import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
import android.preference.PreferenceManager;
import android.text.Html;
@@ -157,14 +158,14 @@
String.format(getString(R.string.msg_subscription_offer, current.title)),
application.getAcceptableAdsUrl());
application.setNotifiedAboutAcceptableAds(true);
- application.setAcceptableAdsEnabled(true);
+ setAcceptableAdsEnabled(true);
}
else if (!application.isNotifiedAboutAcceptableAds())
{
showNotificationDialog(getString(R.string.acceptableads_name),
getString(R.string.msg_acceptable_ads), application.getAcceptableAdsUrl());
application.setNotifiedAboutAcceptableAds(true);
- application.setAcceptableAdsEnabled(true);
+ setAcceptableAdsEnabled(true);
}
// Enable manual subscription refresh
@@ -282,6 +283,15 @@
}
}
+ private void setAcceptableAdsEnabled(boolean enabled)
+ {
+ CheckBoxPreference acceptableAdsPreference =
+ (CheckBoxPreference) findPreference(getString(R.string.pref_acceptableads));
+ acceptableAdsPreference.setChecked(enabled);
+ AdblockPlus application = AdblockPlus.getApplication();
+ application.setAcceptableAdsEnabled(enabled);
+ }
+
private void setFilteringEnabled(boolean enabled)
{
SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(this).edit();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld