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: Created April 11, 2014, 1:31 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
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..7b2287b3d600258a5a61ad8651f5fc9cdae72dde 100644
--- a/src/org/adblockplus/android/SummarizedPreferences.java
+++ b/src/org/adblockplus/android/SummarizedPreferences.java
@@ -33,33 +33,36 @@ import android.preference.PreferenceScreen;
*/
public class SummarizedPreferences extends SherlockPreferenceActivity implements OnSharedPreferenceChangeListener
{
+ @SuppressWarnings("deprecation")
@Override
public void onResume()
{
super.onResume();
- initSummaries(getPreferenceScreen());
- getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
+ this.initSummaries(this.getPreferenceScreen());
+ this.getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
}
+ @SuppressWarnings("deprecation")
@Override
public void onPause()
{
super.onPause();
- getPreferenceScreen().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);
+ this.getPreferenceScreen().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);
}
@Override
- public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key)
+ public void onSharedPreferenceChanged(final SharedPreferences sharedPreferences, final String key)
{
- Preference pref = findPreference(key);
- setPrefSummary(pref);
+ @SuppressWarnings("deprecation")
+ final Preference pref = this.findPreference(key);
+ this.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,19 +78,19 @@ 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)
{
- initSummaries((PreferenceGroup) pref);
+ this.initSummaries((PreferenceGroup)pref);
}
else
{
- setPrefSummary(pref);
+ this.setPrefSummary(pref);
}
}
}

Powered by Google App Engine
This is Rietveld