commonMain.com.softartdev.themepref.ThemeEnum.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of material-theme-prefs Show documentation
Show all versions of material-theme-prefs Show documentation
Kotlin Multiplatform library for easy switching Dark/Light Material themes on Compose.
package com.softartdev.themepref
import androidx.compose.runtime.Composable
enum class ThemeEnum {
Light,
Dark,
SystemDefault;
@Composable
fun toLocalizedString(): String = when (this) {
Light -> MR.strings.light
Dark -> MR.strings.dark
SystemDefault -> MR.strings.system_default
}.composeLocalized()
}