Example usage for Java android.widget Switch fields, constructors, methods, implement or subclass
The text is from its open source code.
Switch(Context context) Construct a new Switch with default styling. | |
Switch |
Drawable | getThumbDrawable() Get the drawable used for the switch "thumb" - the piece that the user can physically touch and drag along the track. |
Drawable | getTrackDrawable() Get the drawable used for the track that the switch slides within. |
boolean | isChecked() |
void | setButtonDrawable(@DrawableRes int resId) Sets a drawable as the compound button image given its resource identifier. |
void | setChecked(boolean checked) |
void | setOnCheckedChangeListener(@Nullable OnCheckedChangeListener listener) Register a callback to be invoked when the checked state of this button changes. |
void | setTextOff(CharSequence textOff) Sets the text displayed when the button is not in the checked state. |
void | setTextOn(CharSequence textOn) Sets the text displayed when the button is in the checked state. |
void | toggle() |