# SwitchButton

public class SwitchButton

SwitchButton

#### Author

kyleduo

#### Since

2014-09-24

## Constructors

SwitchButton
Link copied to clipboard
public void SwitchButton(Context context, AttributeSet attrs, int defStyle)
public void SwitchButton(Context context, AttributeSet attrs)
public void SwitchButton(Context context)

## Properties

DEFAULT_ANIMATION_DURATION
Link copied to clipboard
public final static int DEFAULT_ANIMATION_DURATION
DEFAULT_BACK_MEASURE_RATIO
Link copied to clipboard
public final static float DEFAULT_BACK_MEASURE_RATIO
DEFAULT_TEXT_MARGIN_DP
Link copied to clipboard
public final static int DEFAULT_TEXT_MARGIN_DP
DEFAULT_THUMB_MARGIN_DP
Link copied to clipboard
public final static int DEFAULT_THUMB_MARGIN_DP
DEFAULT_THUMB_SIZE_DP
Link copied to clipboard
public final static int DEFAULT_THUMB_SIZE_DP
DEFAULT_TINT_COLOR
Link copied to clipboard
public final static int DEFAULT_TINT_COLOR

## Functions

getAnimationDuration
Link copied to clipboard
public long getAnimationDuration()
getBackColor
Link copied to clipboard
public ColorStateList getBackColor()
getBackDrawable
Link copied to clipboard
public Drawable getBackDrawable()
getBackMeasureRatio
Link copied to clipboard
public float getBackMeasureRatio()
getBackRadius
Link copied to clipboard
public float getBackRadius()
getBackSizeF
Link copied to clipboard
public PointF getBackSizeF()
getProcess
Link copied to clipboard
public final float getProcess()
getThumbColor
Link copied to clipboard
public ColorStateList getThumbColor()
getThumbDrawable
Link copied to clipboard
public Drawable getThumbDrawable()
getThumbHeight
Link copied to clipboard
public float getThumbHeight()
getThumbMargin
Link copied to clipboard
public RectF getThumbMargin()
getThumbRadius
Link copied to clipboard
public float getThumbRadius()
getThumbSizeF
Link copied to clipboard
public PointF getThumbSizeF()
getThumbWidth
Link copied to clipboard
public float getThumbWidth()
getTintColor
Link copied to clipboard
public int getTintColor()
isDrawDebugRect
Link copied to clipboard
public boolean isDrawDebugRect()
isFadeBack
Link copied to clipboard
public boolean isFadeBack()
onRestoreInstanceState
Link copied to clipboard
public void onRestoreInstanceState(Parcelable state)
onSaveInstanceState
Link copied to clipboard
public Parcelable onSaveInstanceState()
onTouchEvent
Link copied to clipboard
public boolean onTouchEvent(MotionEvent event)
performClick
Link copied to clipboard
public boolean performClick()
setAnimationDuration
Link copied to clipboard
public void setAnimationDuration(long animationDuration)
setBackColor
Link copied to clipboard
public void setBackColor(ColorStateList backColor)
setBackColorRes
Link copied to clipboard
public void setBackColorRes(int backColorRes)
setBackDrawable
Link copied to clipboard
public void setBackDrawable(Drawable backDrawable)
setBackDrawableRes
Link copied to clipboard
public void setBackDrawableRes(int backDrawableRes)
setBackMeasureRatio
Link copied to clipboard
public void setBackMeasureRatio(float backMeasureRatio)
setBackRadius
Link copied to clipboard
public void setBackRadius(float backRadius)
setChecked
Link copied to clipboard
public void setChecked(boolean checked)
setCheckedImmediately
Link copied to clipboard
public void setCheckedImmediately(boolean checked)
setDrawDebugRect
Link copied to clipboard
public void setDrawDebugRect(boolean drawDebugRect)
setFadeBack
Link copied to clipboard
public void setFadeBack(boolean fadeBack)
setProcess
Link copied to clipboard
public final void setProcess(float process)
setText
Link copied to clipboard
public void setText(CharSequence onText, CharSequence offText)
setThumbColor
Link copied to clipboard
public void setThumbColor(ColorStateList thumbColor)
setThumbColorRes
Link copied to clipboard
public void setThumbColorRes(int thumbColorRes)
setThumbDrawable
Link copied to clipboard
public void setThumbDrawable(Drawable thumbDrawable)
setThumbDrawableRes
Link copied to clipboard
public void setThumbDrawableRes(int thumbDrawableRes)
setThumbMargin
Link copied to clipboard
public void setThumbMargin(RectF thumbMargin)
public void setThumbMargin(float left, float top, float right, float bottom)
setThumbRadius
Link copied to clipboard
public void setThumbRadius(float thumbRadius)
setThumbSize
Link copied to clipboard
public void setThumbSize(PointF size)
public void setThumbSize(float width, float height)
setTintColor
Link copied to clipboard
public void setTintColor(int tintColor)
toggleImmediately
Link copied to clipboard
public void toggleImmediately()