library / org.akop.kotx.ext.content / android.content.SharedPreferences

Extensions for android.content.SharedPreferences

edit

fun SharedPreferences.edit(block: Editor.() -> Unit): Unit

Creates a new {@link SharedPreferences.Editor}, calls the specified block, then calls {@link SharedPreferences.Editor#apply}

getValue

operator fun <V> SharedPreferences.getValue(thisRef: Any?, property: KProperty<*>): V?

Allows reading of SharedPreferences setting via delegated property.

setValue

operator fun <V> SharedPreferences.setValue(thisRef: Any?, property: KProperty<*>, value: V?): Unit

Allows reading of SharedPreferences setting via delegated property.