-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a45d74c
commit 058991b
Showing
9 changed files
with
28 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
shared/src/commonMain/kotlin/com/faltenreich/diaguard/preference/Preference.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,10 @@ | ||
package com.faltenreich.diaguard.preference | ||
|
||
import com.faltenreich.diaguard.MR | ||
import com.faltenreich.diaguard.preference.store.ColorScheme | ||
import com.faltenreich.diaguard.preference.store.StartScreen | ||
import dev.icerock.moko.resources.StringResource | ||
|
||
sealed class Preference<Store, Domain>( | ||
val key: StringResource, | ||
val default: Domain, | ||
val onRead: (Store) -> Domain?, | ||
val onWrite: (Domain) -> Store, | ||
) | ||
|
||
data object ColorSchemePreference : Preference<Int, ColorScheme>( | ||
key = MR.strings.preference_theme, | ||
default = ColorScheme.SYSTEM, | ||
onRead = ColorScheme::valueOf, | ||
onWrite = ColorScheme::stableId, | ||
) | ||
|
||
data object StartScreenPreference : Preference<Int, StartScreen>( | ||
key = MR.strings.preference_start_screen, | ||
default = StartScreen.DASHBOARD, | ||
onRead = StartScreen::valueOf, | ||
onWrite = StartScreen::stableId, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
.../preference/store/GetAppVersionUseCase.kt → ...ard/shared/config/GetAppVersionUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters