enumValuePref

inline fun <T : Enum<*>> KotprefModel.enumValuePref(default: T, key: String? = null, commitByDefault: Boolean = commitAllPropertiesByDefault): AbstractPref<T>

Delegate enum-based shared preferences property storing and recalling by the enum value's name as a string.

Parameters

default

default enum value

key

custom preferences key

inline fun <T : Enum<*>> KotprefModel.enumValuePref(default: T, key: Int, commitByDefault: Boolean = commitAllPropertiesByDefault): AbstractPref<T>

Delegate enum-based shared preferences property storing and recalling by the enum value's name as a string.

Parameters

default

default enum value

key

custom preferences key resource id