Eliminate duplicated code in Settings for category headers
Change-Id: I5bdba2ad4f9e1987f9e818af9d5aa96a9d558f6b
This commit is contained in:
@@ -209,7 +209,7 @@ public class MasterClear extends Fragment {
|
||||
.getAuthenticatorTypesAsUser(profileId);
|
||||
final int M = descs.length;
|
||||
|
||||
View titleView = newTitleView(contents, inflater);
|
||||
View titleView = Utils.inflateCategoryHeader(inflater, contents);
|
||||
final TextView titleText = (TextView) titleView.findViewById(android.R.id.title);
|
||||
titleText.setText(userInfo.isManagedProfile() ? R.string.category_work
|
||||
: R.string.category_personal);
|
||||
@@ -275,13 +275,4 @@ public class MasterClear extends Fragment {
|
||||
establishInitialState();
|
||||
return mContentView;
|
||||
}
|
||||
|
||||
private View newTitleView(ViewGroup parent, LayoutInflater inflater) {
|
||||
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, parent, false);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user