Minor cleanup

This commit is contained in:
Jobobby04
2023-12-25 20:17:14 -05:00
parent 526ee7dda9
commit 22d8711cee
3 changed files with 16 additions and 13 deletions
@@ -225,7 +225,7 @@ object SettingsSecurityScreen : SearchableSettings {
onDaysSelected: (Int) -> Unit,
) {
val selected = remember(initialSelection) {
DayOption.values().filter { it.day and initialSelection == it.day }
DayOption.entries.filter { it.day and initialSelection == it.day }
.toMutableStateList()
}
AlertDialog(
@@ -233,7 +233,7 @@ object SettingsSecurityScreen : SearchableSettings {
title = { Text(text = stringResource(SYMR.strings.biometric_lock_days)) },
text = {
LazyColumn {
DayOption.values().forEach { day ->
DayOption.entries.forEach { day ->
item {
val isSelected = selected.contains(day)
val onSelectionChanged = {
@@ -862,7 +862,7 @@ class LibraryScreenModel(
} else {
categoryName
}
LibraryGroup.BY_TRACK_STATUS -> TrackStatus.values()
LibraryGroup.BY_TRACK_STATUS -> TrackStatus.entries
.find { it.int.toLong() == category?.id }
.let { it ?: TrackStatus.OTHER }
.let { context.stringResource(it.res) }
@@ -1171,11 +1171,11 @@ class LibraryScreenModel(
}.mapKeys { (id) ->
Category(
id = id.toLong(),
name = TrackStatus.values()
name = TrackStatus.entries
.find { it.int == id }
.let { it ?: TrackStatus.OTHER }
.let { context.stringResource(it.res) },
order = TrackStatus.values().indexOfFirst {
order = TrackStatus.entries.indexOfFirst {
it.int == id
}.takeUnless { it == -1 }?.toLong() ?: TrackStatus.OTHER.ordinal.toLong(),
flags = 0,