Eliminate duplicated code in Settings for category headers
Change-Id: I5bdba2ad4f9e1987f9e818af9d5aa96a9d558f6b
This commit is contained in:
@@ -303,7 +303,7 @@ public class DeviceAdminSettings extends ListFragment {
|
||||
bindView(convertView, (DeviceAdminInfo) o);
|
||||
} else {
|
||||
if (convertView == null) {
|
||||
convertView = newTitleView(parent);
|
||||
convertView = Utils.inflateCategoryHeader(mInflater, parent);
|
||||
}
|
||||
final TextView title = (TextView) convertView.findViewById(android.R.id.title);
|
||||
title.setText((String)o);
|
||||
@@ -322,15 +322,6 @@ public class DeviceAdminSettings extends ListFragment {
|
||||
return v;
|
||||
}
|
||||
|
||||
private View newTitleView(ViewGroup parent) {
|
||||
final TypedArray a = mInflater.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 mInflater.inflate(resId, parent, false);
|
||||
}
|
||||
|
||||
private void bindView(View view, DeviceAdminInfo item) {
|
||||
final Activity activity = getActivity();
|
||||
ViewHolder vh = (ViewHolder) view.getTag();
|
||||
|
Reference in New Issue
Block a user