bindPreferences

Bind fields annotated with com.hendraanggrian.auto.prefs.BindPreference from source SharedPreferences to target Any.

Receiver

target fields' owner.

Return

saver instance to apply changes made to the fields.

Parameters

preferences

platform-specific preferences.

Throws

when constructor of binding class cannot be found.


fun Context.bindPreferences(preferences: SharedPreferences = PreferenceManager.getDefaultSharedPreferences(this)): PreferencesSaver

Bind fields annotated with com.hendraanggrian.auto.prefs.BindPreference from source and to target Context.

Receiver

application context and also target fields' owner.

Return

saver instance to apply changes made to the fields.

Parameters

preferences

platform-specific preferences.

Throws

when constructor of binding class cannot be found.


fun Fragment.bindPreferences(preferences: SharedPreferences = PreferenceManager.getDefaultSharedPreferences(activity)): PreferencesSaver

Bind fields annotated with com.hendraanggrian.auto.prefs.BindPreference from source and to target Fragment.

Receiver

deprecated fragment and also target fields' owner.

Return

saver instance to apply changes made to the fields.

Parameters

preferences

platform-specific preferences.

Throws

when constructor of binding class cannot be found.


fun Fragment.bindPreferences(preferences: SharedPreferences = PreferenceManager.getDefaultSharedPreferences(context!!)): PreferencesSaver

Bind fields annotated with com.hendraanggrian.auto.prefs.BindPreference from source and to target androidx.fragment.app.Fragment.

Receiver

support fragment and also target fields' owner.

Return

saver instance to apply changes made to the fields.

Parameters

preferences

platform-specific preferences.

Throws

when constructor of binding class cannot be found.