mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Set if-else block for direct Cats in CategorizationFragment
This commit is contained in:
parent
819ec795bd
commit
666b7a0843
1 changed files with 16 additions and 4 deletions
|
|
@ -268,11 +268,22 @@ public class CategorizationFragment extends CommonsDaggerSupportFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Observable<CategoryItem> defaultCategories() {
|
private Observable<CategoryItem> defaultCategories() {
|
||||||
return directCategories()
|
|
||||||
|
Observable<CategoryItem> directCat = directCategories();
|
||||||
|
if (hasDirectCategories) {
|
||||||
|
Timber.d("Image has direct Cat");
|
||||||
|
return directCat
|
||||||
.concatWith(gpsCategories())
|
.concatWith(gpsCategories())
|
||||||
.concatWith(titleCategories())
|
.concatWith(titleCategories())
|
||||||
.concatWith(recentCategories());
|
.concatWith(recentCategories());
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
Timber.d("Image has no direct Cat");
|
||||||
|
return gpsCategories()
|
||||||
|
.concatWith(titleCategories())
|
||||||
|
.concatWith(recentCategories());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private Observable<CategoryItem> directCategories() {
|
private Observable<CategoryItem> directCategories() {
|
||||||
String directCategory = directPrefs.getString("Category", "");
|
String directCategory = directPrefs.getString("Category", "");
|
||||||
|
|
@ -282,6 +293,7 @@ public class CategorizationFragment extends CommonsDaggerSupportFragment {
|
||||||
if (!directCategory.equals("")) {
|
if (!directCategory.equals("")) {
|
||||||
hasDirectCategories = true;
|
hasDirectCategories = true;
|
||||||
categoryList.add(directCategory);
|
categoryList.add(directCategory);
|
||||||
|
Timber.d("DirectCat does not equal emptyString. Direct Cat list has " + categoryList);
|
||||||
}
|
}
|
||||||
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