Clean up
This commit is contained in:
parent
6dcbfa0b72
commit
d75be393d7
2 changed files with 8 additions and 4 deletions
|
|
@ -14,7 +14,7 @@ public class CategoryInfo implements Parcelable {
|
|||
this.visible = visible;
|
||||
}
|
||||
|
||||
public CategoryInfo(Parcel source) {
|
||||
private CategoryInfo(Parcel source) {
|
||||
category = (Category) source.readSerializable();
|
||||
visible = source.readInt() == 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,9 +29,13 @@ public class LibraryPreferenceDialog extends DialogFragment {
|
|||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
View view = getActivity().getLayoutInflater().inflate(R.layout.preference_dialog_library_categories, null);
|
||||
|
||||
adapter = new CategoryInfoAdapter(savedInstanceState != null ?
|
||||
savedInstanceState.getParcelableArrayList(PreferenceUtil.LIBRARY_CATEGORIES) :
|
||||
PreferenceUtil.getInstance(getContext()).getLibraryCategoryInfos());
|
||||
ArrayList<CategoryInfo> categoryInfos;
|
||||
if (savedInstanceState != null) {
|
||||
categoryInfos = savedInstanceState.getParcelableArrayList(PreferenceUtil.LIBRARY_CATEGORIES);
|
||||
} else {
|
||||
categoryInfos = PreferenceUtil.getInstance(getContext()).getLibraryCategoryInfos();
|
||||
}
|
||||
adapter = new CategoryInfoAdapter(categoryInfos);
|
||||
|
||||
RecyclerView recyclerView = view.findViewById(R.id.recycler_view);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue