SwitchPreference

(SESL variant) A Preference that provides a two-state toggleable option.

This preference will save a boolean value to android.content.SharedPreferences.

Constructors

Link copied to clipboard
constructor(@NonNull context: Context, @Nullable attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int)
Construct a new SwitchPreference with the given style options.
constructor(@NonNull context: Context, @Nullable attrs: AttributeSet, defStyleAttr: Int)
Construct a new SwitchPreference with the given style options.
constructor(@NonNull context: Context, @Nullable attrs: AttributeSet)
Construct a new SwitchPreference with the given style options.
constructor(@NonNull context: Context)
Construct a new SwitchPreference with default style options.

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Binds the created View to the data for this preference.
Link copied to clipboard
open fun setSwitchTextOff(resId: Int)
Set the text displayed on the switch widget in the off state.
Link copied to clipboard
open fun setSwitchTextOn(resId: Int)
Set the text displayed on the switch widget in the on state.