Eliminate duplicated code in Settings for category headers
Change-Id: I5bdba2ad4f9e1987f9e818af9d5aa96a9d558f6b
This commit is contained in:
@@ -1811,8 +1811,8 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
|
||||
final AppItem item = mItems.get(position);
|
||||
if (getItemViewType(position) == 1) {
|
||||
if (convertView == null) {
|
||||
convertView = inflateCategoryHeader(LayoutInflater.from(parent.getContext()),
|
||||
parent);
|
||||
convertView = Utils.inflateCategoryHeader(LayoutInflater.from(
|
||||
parent.getContext()), parent);
|
||||
}
|
||||
|
||||
final TextView title = (TextView) convertView.findViewById(android.R.id.title);
|
||||
@@ -2503,14 +2503,6 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
|
||||
return view;
|
||||
}
|
||||
|
||||
private static View inflateCategoryHeader(LayoutInflater inflater, ViewGroup root) {
|
||||
final TypedArray a = inflater.getContext().obtainStyledAttributes(null,
|
||||
com.android.internal.R.styleable.Preference,
|
||||
com.android.internal.R.attr.preferenceCategoryStyle, 0);
|
||||
final int resId = a.getResourceId(com.android.internal.R.styleable.Preference_layout, 0);
|
||||
return inflater.inflate(resId, root, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test if any networks are currently limited.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user