mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-28 09:15:12 +03: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
|
||||
}
|
||||
|
||||
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 a new issue