Switch

Class of android.widget · Switch.java · Android's reference

public class Switch extends CompoundButton

Switch ← CompoundButton ← Button ← TextView ← View

A two-state switch: a compound button with a thumb and a track.

Constructors

public Switch(Context context) source
public Switch(Context context, AttributeSet attrs) source
public Switch(Context context, AttributeSet attrs, int defStyleAttr) source
public Switch(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) source

Methods

public CharSequence getTextOn() source
public void setTextOn(CharSequence textOn) source
public CharSequence getTextOff() source
public void setTextOff(CharSequence textOff) source
public void setShowText(boolean showText) source
public boolean getShowText() source
public void setSplitTrack(boolean splitTrack) source
public boolean getSplitTrack() source
public void setThumbDrawable(Drawable thumb) source
public void setThumbResource(int resId) source
public Drawable getThumbDrawable() source
public void setTrackDrawable(Drawable track) source
public void setTrackResource(int resId) source
public Drawable getTrackDrawable() source
public void setThumbTintList(ColorStateList tint) source
public ColorStateList getThumbTintList() source
public void setTrackTintList(ColorStateList tint) source
public ColorStateList getTrackTintList() source
public void setSwitchMinWidth(int pixels) source
public int getSwitchMinWidth() source
public void setThumbTextPadding(int pixels) source
public int getThumbTextPadding() source
public void setSwitchPadding(int pixels) source
public int getSwitchPadding() source
public CharSequence getAccessibilityClassName() source

Made from ScarletNX's Sail at 166ad3910f80. The framework is ScarletNX's (GPL-3.0-or-later); the parts that follow the Android Open Source Project's sources (Apache-2.0) say so in their files.