fix(library): Fix Ungrouped UI (#1072)
This commit is contained in:
parent
a9f6f7e8b8
commit
feabf6efa6
2 changed files with 4 additions and 4 deletions
|
|
@ -440,13 +440,13 @@ private fun ColumnScope.GroupPage(
|
||||||
if (trackers.isNotEmpty()) {
|
if (trackers.isNotEmpty()) {
|
||||||
add(LibraryGroup.BY_TRACK_STATUS)
|
add(LibraryGroup.BY_TRACK_STATUS)
|
||||||
}
|
}
|
||||||
if (hasCategories) {
|
if (hasCategories || screenModel.grouping == LibraryGroup.UNGROUPED) {
|
||||||
add(LibraryGroup.UNGROUPED)
|
add(LibraryGroup.UNGROUPED)
|
||||||
}
|
}
|
||||||
}.map {
|
}.map {
|
||||||
GroupMode(
|
GroupMode(
|
||||||
it,
|
it,
|
||||||
LibraryGroup.groupTypeStringRes(it, hasCategories),
|
LibraryGroup.groupTypeStringRes(it),
|
||||||
groupTypeDrawableRes(it),
|
groupTypeDrawableRes(it),
|
||||||
)
|
)
|
||||||
}.toImmutableList()
|
}.toImmutableList()
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,13 @@ object LibraryGroup {
|
||||||
const val BY_TRACK_STATUS = 3
|
const val BY_TRACK_STATUS = 3
|
||||||
const val UNGROUPED = 4
|
const val UNGROUPED = 4
|
||||||
|
|
||||||
fun groupTypeStringRes(type: Int, hasCategories: Boolean = true): StringResource {
|
fun groupTypeStringRes(type: Int): StringResource {
|
||||||
return when (type) {
|
return when (type) {
|
||||||
BY_STATUS -> MR.strings.status
|
BY_STATUS -> MR.strings.status
|
||||||
BY_SOURCE -> MR.strings.label_sources
|
BY_SOURCE -> MR.strings.label_sources
|
||||||
BY_TRACK_STATUS -> SYMR.strings.tracking_status
|
BY_TRACK_STATUS -> SYMR.strings.tracking_status
|
||||||
UNGROUPED -> SYMR.strings.ungrouped
|
UNGROUPED -> SYMR.strings.ungrouped
|
||||||
else -> if (hasCategories) MR.strings.categories else SYMR.strings.ungrouped
|
else -> MR.strings.categories
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue