Improve Preference highlighting for Search
- cache hightlight Drawable - set mPreferenceHighlighted as early as possible Change-Id: I512d4677e94309175ead22c46b7a78e2aa387e1c
This commit is contained in:
@@ -32,6 +32,7 @@ public class HighlightingFragment extends Fragment {
|
||||
|
||||
private String mViewKey;
|
||||
private boolean mViewHighlighted = false;
|
||||
private Drawable mHighlightDrawable;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
@@ -67,7 +68,10 @@ public class HighlightingFragment extends Fragment {
|
||||
}
|
||||
|
||||
private Drawable getHighlightDrawable() {
|
||||
return getActivity().getDrawable(R.drawable.preference_highlight);
|
||||
if (mHighlightDrawable == null) {
|
||||
mHighlightDrawable = getActivity().getDrawable(R.drawable.preference_highlight);
|
||||
}
|
||||
return mHighlightDrawable;
|
||||
}
|
||||
|
||||
private void highlightView(String key) {
|
||||
|
Reference in New Issue
Block a user