mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-10 12:47:26 +01:00
Fix crash for bound intListPreferences
This commit is contained in:
parent
f3718257f5
commit
2db2b7348d
@ -128,6 +128,12 @@ inline fun <T> Preference.bindTo(preference: com.tfcporciuncula.flow.Preference<
|
||||
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) {
|
||||
setOnPreferenceClickListener { block(); true }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user