SwitchPreferenceCompat

constructor(@NonNull context: Context, @Nullable attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int)(source)

Construct a new SwitchPreference with the given style options.

Parameters

context

The Context that will style this preference

attrs

Style attributes that differ from the default

defStyleAttr

An attribute in the current theme that contains a reference to a style resource that supplies default values for the view. Can be 0 to not look for defaults.

defStyleRes

A resource identifier of a style resource that supplies default values for the view, used only if defStyleAttr is 0 or can not be found in the theme. Can be 0 to not look for defaults.


constructor(@NonNull context: Context, @Nullable attrs: AttributeSet, defStyleAttr: Int)(source)

Construct a new SwitchPreference with the given style options.

Parameters

context

The Context that will style this preference

attrs

Style attributes that differ from the default

defStyleAttr

An attribute in the current theme that contains a reference to a style resource that supplies default values for the view. Can be 0 to not look for defaults.


constructor(@NonNull context: Context, @Nullable attrs: AttributeSet)(source)

Construct a new SwitchPreference with the given style options.

Parameters

context

The Context that will style this preference

attrs

Style attributes that differ from the default


constructor(@NonNull context: Context)(source)

Construct a new SwitchPreference with default style options.

Parameters

context

The Context that will style this preference