fix(library): Fix Ungrouped UI (#1072)

This commit is contained in:
Cuong-Tran 2025-07-23 15:14:28 +07:00 committed by GitHub
parent a9f6f7e8b8
commit feabf6efa6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -440,13 +440,13 @@ private fun ColumnScope.GroupPage(
if (trackers.isNotEmpty()) {
add(LibraryGroup.BY_TRACK_STATUS)
}
if (hasCategories) {
if (hasCategories || screenModel.grouping == LibraryGroup.UNGROUPED) {
add(LibraryGroup.UNGROUPED)
}
}.map {
GroupMode(
it,
LibraryGroup.groupTypeStringRes(it, hasCategories),
LibraryGroup.groupTypeStringRes(it),
groupTypeDrawableRes(it),
)
}.toImmutableList()

View file

@ -12,13 +12,13 @@ object LibraryGroup {
const val BY_TRACK_STATUS = 3
const val UNGROUPED = 4
fun groupTypeStringRes(type: Int, hasCategories: Boolean = true): StringResource {
fun groupTypeStringRes(type: Int): StringResource {
return when (type) {
BY_STATUS -> MR.strings.status
BY_SOURCE -> MR.strings.label_sources
BY_TRACK_STATUS -> SYMR.strings.tracking_status
UNGROUPED -> SYMR.strings.ungrouped
else -> if (hasCategories) MR.strings.categories else SYMR.strings.ungrouped
else -> MR.strings.categories
}
}
}