mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-21 20:47:03 -05:00
Fix crash for bound intListPreferences
This commit is contained in:
parent
f3718257f5
commit
2db2b7348d
1 changed files with 6 additions and 0 deletions
|
@ -128,6 +128,12 @@ inline fun <T> Preference.bindTo(preference: com.tfcporciuncula.flow.Preference<
|
||||||
defaultValue = preference.defaultValue
|
defaultValue = preference.defaultValue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline fun <T> ListPreference.bindTo(preference: com.tfcporciuncula.flow.Preference<T>) {
|
||||||
|
key = preference.key
|
||||||
|
// ListPreferences persist values as strings, even when we're using our IntListPreference
|
||||||
|
defaultValue = preference.defaultValue.toString()
|
||||||
|
}
|
||||||
|
|
||||||
inline fun Preference.onClick(crossinline block: () -> Unit) {
|
inline fun Preference.onClick(crossinline block: () -> Unit) {
|
||||||
setOnPreferenceClickListener { block(); true }
|
setOnPreferenceClickListener { block(); true }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue