mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2025-01-11 17:39:06 +01:00
Grouping menu sheet shows "ungrouped" instead of "categories" by use case
For those who not have any categories
This commit is contained in:
parent
1d0545f5de
commit
89ea8388ad
@ -445,7 +445,7 @@ class LibraryController(
|
|||||||
MaterialMenuSheet.MenuSheetItem(
|
MaterialMenuSheet.MenuSheetItem(
|
||||||
id,
|
id,
|
||||||
LibraryGroup.groupTypeDrawableRes(id),
|
LibraryGroup.groupTypeDrawableRes(id),
|
||||||
LibraryGroup.groupTypeStringRes(id)
|
LibraryGroup.groupTypeStringRes(id, presenter.allCategories.size > 1)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
MaterialMenuSheet(
|
MaterialMenuSheet(
|
||||||
|
@ -11,14 +11,14 @@ object LibraryGroup {
|
|||||||
const val BY_TRACK_STATUS = 4
|
const val BY_TRACK_STATUS = 4
|
||||||
const val UNGROUPED = 5
|
const val UNGROUPED = 5
|
||||||
|
|
||||||
fun groupTypeStringRes(type: Int): Int {
|
fun groupTypeStringRes(type: Int, hasCategories: Boolean = true): Int {
|
||||||
return when (type) {
|
return when (type) {
|
||||||
BY_STATUS -> R.string.status
|
BY_STATUS -> R.string.status
|
||||||
BY_TAG -> R.string.tag
|
BY_TAG -> R.string.tag
|
||||||
BY_SOURCE -> R.string.sources
|
BY_SOURCE -> R.string.sources
|
||||||
BY_TRACK_STATUS -> R.string.tracking_status
|
BY_TRACK_STATUS -> R.string.tracking_status
|
||||||
UNGROUPED -> R.string.ungrouped
|
UNGROUPED -> R.string.ungrouped
|
||||||
else -> R.string.categories
|
else -> if (hasCategories) R.string.categories else R.string.ungrouped
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user