``` enum class DisplayedCardStyle(@StringRes val p...
# random
m
Copy code
enum class DisplayedCardStyle(@StringRes val preferenceEntry: Int) {

    Classic(R.string.abc_action_bar_home_description_format),
    Simple(R.string.abc_action_bar_home_description);

    companion object {
        private val VALS = values()
        fun fromPref(@StringRes preferenceEntry: Int) 
                = VALS.firstOrNull { it.preferenceEntry == preferenceEntry } ?: Classic
    }
}
🙃