diff options
author | Danesh M <daneshm90@gmail.com> | 2015-12-21 17:54:43 -0800 |
---|---|---|
committer | Danesh M <daneshm90@gmail.com> | 2016-02-02 13:48:54 -0800 |
commit | 946b1e21c0fe3d83dc5fd68552a9ab5c0c3603e1 (patch) | |
tree | c63bc65976d352c71cbab548135b03ff6198d806 /src | |
parent | 4a42249978fc64ea07abbad57f7d571eec41c253 (diff) | |
download | packages_apps_Settings-946b1e21c0fe3d83dc5fd68552a9ab5c0c3603e1.zip packages_apps_Settings-946b1e21c0fe3d83dc5fd68552a9ab5c0c3603e1.tar.gz packages_apps_Settings-946b1e21c0fe3d83dc5fd68552a9ab5c0c3603e1.tar.bz2 |
Settings : Recompute highlight index upon changes
Change-Id: I7d738f5114fc1eea564360ab5e823abc167caee9
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/SettingsPreferenceFragment.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/com/android/settings/SettingsPreferenceFragment.java b/src/com/android/settings/SettingsPreferenceFragment.java index 1711671..02f8a03 100644 --- a/src/com/android/settings/SettingsPreferenceFragment.java +++ b/src/com/android/settings/SettingsPreferenceFragment.java @@ -72,12 +72,12 @@ public abstract class SettingsPreferenceFragment extends InstrumentedPreferenceF private DataSetObserver mDataSetObserver = new DataSetObserver() { @Override public void onChanged() { - highlightPreferenceIfNeeded(); + highlightPreferenceIfNeeded(true); } @Override public void onInvalidated() { - highlightPreferenceIfNeeded(); + highlightPreferenceIfNeeded(true); } }; @@ -149,7 +149,7 @@ public abstract class SettingsPreferenceFragment extends InstrumentedPreferenceF final Bundle args = getArguments(); if (args != null) { mPreferenceKey = args.getString(SettingsActivity.EXTRA_FRAGMENT_ARG_KEY); - highlightPreferenceIfNeeded(); + highlightPreferenceIfNeeded(false); } } @@ -196,8 +196,9 @@ public abstract class SettingsPreferenceFragment extends InstrumentedPreferenceF } } - public void highlightPreferenceIfNeeded() { - if (isAdded() && !mPreferenceHighlighted &&!TextUtils.isEmpty(mPreferenceKey)) { + public void highlightPreferenceIfNeeded(boolean forceHighlight) { + if (isAdded() && (!mPreferenceHighlighted || forceHighlight) + && !TextUtils.isEmpty(mPreferenceKey)) { highlightPreference(mPreferenceKey); } } |