mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +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,10 +268,21 @@ public class CategorizationFragment extends CommonsDaggerSupportFragment {
|
|||
}
|
||||
|
||||
private Observable<CategoryItem> defaultCategories() {
|
||||
return directCategories()
|
||||
.concatWith(gpsCategories())
|
||||
.concatWith(titleCategories())
|
||||
.concatWith(recentCategories());
|
||||
|
||||
Observable<CategoryItem> directCat = directCategories();
|
||||
if (hasDirectCategories) {
|
||||
Timber.d("Image has direct Cat");
|
||||
return directCat
|
||||
.concatWith(gpsCategories())
|
||||
.concatWith(titleCategories())
|
||||
.concatWith(recentCategories());
|
||||
}
|
||||
else {
|
||||
Timber.d("Image has no direct Cat");
|
||||
return gpsCategories()
|
||||
.concatWith(titleCategories())
|
||||
.concatWith(recentCategories());
|
||||
}
|
||||
}
|
||||
|
||||
private Observable<CategoryItem> directCategories() {
|
||||
|
|
@ -282,6 +293,7 @@ public class CategorizationFragment extends CommonsDaggerSupportFragment {
|
|||
if (!directCategory.equals("")) {
|
||||
hasDirectCategories = true;
|
||||
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));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue