SwitchMaterial

A class that creates a Material Themed Switch.

This class uses attributes from the Material Theme to style a Switch. Excepting color changes, it behaves identically to SwitchCompat. Your theme's ?attr/colorControlActivated, ?attr/colorSurface, and ?attr/colorOnSurface must be set. Because does not extend android.widget.Switch, you must explicitly declare in your layout XML.

Constructors

Link copied to clipboard
constructor(@NonNull context: Context)
constructor(@NonNull context: Context, @Nullable attrs: AttributeSet)
constructor(@NonNull context: Context, @Nullable attrs: AttributeSet, defStyleAttr: Int)

Functions

Link copied to clipboard
Returns true if this SwitchMaterial defaults to colors from a Material Theme.
Link copied to clipboard
open fun setUseMaterialThemeColors(useMaterialThemeColors: Boolean)
Forces the SwitchMaterial to use colors from a Material Theme.