mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
Add check for empty direct categories
This commit is contained in:
parent
efa7820fe4
commit
819ec795bd
1 changed files with 6 additions and 3 deletions
|
|
@ -89,6 +89,7 @@ public class CategorizationFragment extends CommonsDaggerSupportFragment {
|
||||||
private HashMap<String, ArrayList<String>> categoriesCache;
|
private HashMap<String, ArrayList<String>> categoriesCache;
|
||||||
private List<CategoryItem> selectedCategories = new ArrayList<>();
|
private List<CategoryItem> selectedCategories = new ArrayList<>();
|
||||||
private TitleTextWatcher textWatcher = new TitleTextWatcher();
|
private TitleTextWatcher textWatcher = new TitleTextWatcher();
|
||||||
|
private boolean hasDirectCategories = false;
|
||||||
|
|
||||||
private final CategoriesAdapterFactory adapterFactory = new CategoriesAdapterFactory(item -> {
|
private final CategoriesAdapterFactory adapterFactory = new CategoriesAdapterFactory(item -> {
|
||||||
if (item.isSelected()) {
|
if (item.isSelected()) {
|
||||||
|
|
@ -275,11 +276,13 @@ public class CategorizationFragment extends CommonsDaggerSupportFragment {
|
||||||
|
|
||||||
private Observable<CategoryItem> directCategories() {
|
private Observable<CategoryItem> directCategories() {
|
||||||
String directCategory = directPrefs.getString("Category", "");
|
String directCategory = directPrefs.getString("Category", "");
|
||||||
|
List<String> categoryList = new ArrayList<>();
|
||||||
Timber.d("Direct category found: " + directCategory);
|
Timber.d("Direct category found: " + directCategory);
|
||||||
|
|
||||||
List<String> categoryList = new ArrayList<>();
|
if (!directCategory.equals("")) {
|
||||||
|
hasDirectCategories = true;
|
||||||
categoryList.add(directCategory);
|
categoryList.add(directCategory);
|
||||||
|
}
|
||||||
return Observable.fromIterable(categoryList).map(name -> new CategoryItem(name, false));
|
return Observable.fromIterable(categoryList).map(name -> new CategoryItem(name, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue