fixes the androidx prefererences icon spacing issue

This commit is contained in:
Carlos 2019-12-28 13:58:48 -05:00
parent 2bb903088e
commit b76a15d960

View File

@ -58,11 +58,17 @@ fun initDialog(dialogPreference: DialogPreference) {
} }
inline fun <P : Preference> PreferenceGroup.initThenAdd(p: P, block: P.() -> Unit): P { inline fun <P : Preference> PreferenceGroup.initThenAdd(p: P, block: P.() -> Unit): P {
return p.apply { block(); addPreference(this); } return p.apply {
block()
this.isIconSpaceReserved = false
addPreference(this) }
} }
inline fun <P : Preference> PreferenceGroup.addThenInit(p: P, block: P.() -> Unit): P { inline fun <P : Preference> PreferenceGroup.addThenInit(p: P, block: P.() -> Unit): P {
return p.apply { addPreference(this); block() } return p.apply {
this.isIconSpaceReserved = false
addPreference(this)
block() }
} }
inline fun Preference.onClick(crossinline block: () -> Unit) { inline fun Preference.onClick(crossinline block: () -> Unit) {