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

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

Issue 5697499218051072: Usage of new API, cleanups (reduced) (Closed)
Patch Set: Adressed first batch of review issues. Created April 16, 2014, 5:36 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 | « src/org/adblockplus/android/SubscriptionParser.java ('k') | src/org/adblockplus/android/Utils.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/org/adblockplus/android/SummarizedPreferences.java
diff --git a/src/org/adblockplus/android/SummarizedPreferences.java b/src/org/adblockplus/android/SummarizedPreferences.java
index f8d2ce07d758a824e63b85a4e7616b0a8fe28805..7c806aadd7a0f2f4b113693542f261ab1a822af5 100644
--- a/src/org/adblockplus/android/SummarizedPreferences.java
+++ b/src/org/adblockplus/android/SummarizedPreferences.java
@@ -28,11 +28,12 @@ import android.preference.PreferenceGroup;
import android.preference.PreferenceScreen;
/**
- * PreferencesActivity which automatically sets preference summaries according
- * to its current values.
+ * PreferencesActivity which automatically sets preference summaries according to its current
+ * values.
*/
public class SummarizedPreferences extends SherlockPreferenceActivity implements OnSharedPreferenceChangeListener
{
+ @SuppressWarnings("deprecation")
@Override
public void onResume()
{
@@ -41,6 +42,7 @@ public class SummarizedPreferences extends SherlockPreferenceActivity implements
getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
}
+ @SuppressWarnings("deprecation")
@Override
public void onPause()
{
@@ -49,17 +51,18 @@ public class SummarizedPreferences extends SherlockPreferenceActivity implements
}
@Override
- public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key)
+ public void onSharedPreferenceChanged(final SharedPreferences sharedPreferences, final String key)
{
- Preference pref = findPreference(key);
+ @SuppressWarnings("deprecation")
+ final Preference pref = findPreference(key);
setPrefSummary(pref);
}
- protected void setPrefSummary(Preference pref)
+ protected void setPrefSummary(final Preference pref)
{
if (pref instanceof ListPreference)
{
- CharSequence summary = ((ListPreference) pref).getEntry();
+ final CharSequence summary = ((ListPreference) pref).getEntry();
if (summary != null)
{
pref.setSummary(summary);
@@ -67,7 +70,7 @@ public class SummarizedPreferences extends SherlockPreferenceActivity implements
}
if (pref instanceof EditTextPreference)
{
- CharSequence summary = ((EditTextPreference) pref).getText();
+ final CharSequence summary = ((EditTextPreference) pref).getText();
if (summary != null)
{
pref.setSummary(summary);
@@ -75,11 +78,11 @@ public class SummarizedPreferences extends SherlockPreferenceActivity implements
}
}
- protected void initSummaries(PreferenceGroup preference)
+ protected void initSummaries(final PreferenceGroup preference)
{
for (int i = preference.getPreferenceCount() - 1; i >= 0; i--)
{
- Preference pref = preference.getPreference(i);
+ final Preference pref = preference.getPreference(i);
if (pref instanceof PreferenceGroup || pref instanceof PreferenceScreen)
{
« no previous file with comments | « src/org/adblockplus/android/SubscriptionParser.java ('k') | src/org/adblockplus/android/Utils.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld