Improve Preference highlighting
- add PreferenceFragment.onBindPreferences() so that we can know when the binding as been done - use the Preference's key as a tag for its View (so that we can locate it latter in the View hierarchy) Change-Id: Ifb3b30e576048b7464af63643834d278a46a8543
This commit is contained in:
@@ -329,6 +329,11 @@ public abstract class PreferenceFragment extends Fragment implements
|
||||
if (preferenceScreen != null) {
|
||||
preferenceScreen.bind(getListView());
|
||||
}
|
||||
onBindPreferences();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
protected void onBindPreferences() {
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
|
||||
@@ -20,7 +20,6 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Handler;
|
||||
import android.preference.Preference.OnPreferenceChangeInternalListener;
|
||||
@@ -243,6 +242,7 @@ public class PreferenceGroupAdapter extends BaseAdapter
|
||||
if (position == mHighlightedPosition && mHighlightedDrawable != null) {
|
||||
result.setBackgroundDrawable(mHighlightedDrawable);
|
||||
}
|
||||
result.setTag(preference.getKey());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user