mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-17 06:27:29 +01:00
Reduce redundancy in some preference declarations
The remaining ones could also be converted to FlowPreferences for this, but it's not really necessary.
This commit is contained in:
@@ -123,6 +123,11 @@ inline fun <P : Preference> PreferenceGroup.addThenInit(p: P, block: P.() -> Uni
|
||||
}
|
||||
}
|
||||
|
||||
inline fun <T> Preference.bindTo(preference: com.tfcporciuncula.flow.Preference<T>) {
|
||||
key = preference.key
|
||||
defaultValue = preference.defaultValue
|
||||
}
|
||||
|
||||
inline fun Preference.onClick(crossinline block: () -> Unit) {
|
||||
setOnPreferenceClickListener { block(); true }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user