Class SwitchButton
-
- All Implemented Interfaces:
public class SwitchButton
SwitchButton
- Since:
2014-09-24
kyleduo
-
-
Field Summary
Fields Modifier and Type Field Description public final static float
DEFAULT_BACK_MEASURE_RATIO
public final static int
DEFAULT_THUMB_SIZE_DP
public final static int
DEFAULT_THUMB_MARGIN_DP
public final static int
DEFAULT_TEXT_MARGIN_DP
public final static int
DEFAULT_ANIMATION_DURATION
public final static int
DEFAULT_TINT_COLOR
-
Constructor Summary
Constructors Constructor Description SwitchButton(Context context, AttributeSet attrs, int defStyle)
SwitchButton(Context context, AttributeSet attrs)
SwitchButton(Context context)
-
Method Summary
Modifier and Type Method Description boolean
onTouchEvent(MotionEvent event)
final float
getProcess()
final void
setProcess(float process)
boolean
performClick()
void
setChecked(boolean checked)
void
setCheckedImmediately(boolean checked)
void
toggleImmediately()
boolean
isDrawDebugRect()
void
setDrawDebugRect(boolean drawDebugRect)
long
getAnimationDuration()
void
setAnimationDuration(long animationDuration)
Drawable
getThumbDrawable()
void
setThumbDrawable(Drawable thumbDrawable)
void
setThumbDrawableRes(int thumbDrawableRes)
Drawable
getBackDrawable()
void
setBackDrawable(Drawable backDrawable)
void
setBackDrawableRes(int backDrawableRes)
ColorStateList
getBackColor()
void
setBackColor(ColorStateList backColor)
void
setBackColorRes(int backColorRes)
ColorStateList
getThumbColor()
void
setThumbColor(ColorStateList thumbColor)
void
setThumbColorRes(int thumbColorRes)
float
getBackMeasureRatio()
void
setBackMeasureRatio(float backMeasureRatio)
RectF
getThumbMargin()
void
setThumbMargin(RectF thumbMargin)
void
setThumbMargin(float left, float top, float right, float bottom)
void
setThumbSize(float width, float height)
float
getThumbWidth()
float
getThumbHeight()
void
setThumbSize(PointF size)
PointF
getThumbSizeF()
float
getThumbRadius()
void
setThumbRadius(float thumbRadius)
PointF
getBackSizeF()
float
getBackRadius()
void
setBackRadius(float backRadius)
boolean
isFadeBack()
void
setFadeBack(boolean fadeBack)
int
getTintColor()
void
setTintColor(int tintColor)
void
setText(CharSequence onText, CharSequence offText)
Parcelable
onSaveInstanceState()
void
onRestoreInstanceState(Parcelable state)
-
-
Method Detail
-
onTouchEvent
boolean onTouchEvent(MotionEvent event)
-
getProcess
final float getProcess()
-
setProcess
final void setProcess(float process)
-
performClick
boolean performClick()
-
setChecked
void setChecked(boolean checked)
-
setCheckedImmediately
void setCheckedImmediately(boolean checked)
-
toggleImmediately
void toggleImmediately()
-
isDrawDebugRect
boolean isDrawDebugRect()
-
setDrawDebugRect
void setDrawDebugRect(boolean drawDebugRect)
-
getAnimationDuration
long getAnimationDuration()
-
setAnimationDuration
void setAnimationDuration(long animationDuration)
-
getThumbDrawable
Drawable getThumbDrawable()
-
setThumbDrawable
void setThumbDrawable(Drawable thumbDrawable)
-
setThumbDrawableRes
void setThumbDrawableRes(int thumbDrawableRes)
-
getBackDrawable
Drawable getBackDrawable()
-
setBackDrawable
void setBackDrawable(Drawable backDrawable)
-
setBackDrawableRes
void setBackDrawableRes(int backDrawableRes)
-
getBackColor
ColorStateList getBackColor()
-
setBackColor
void setBackColor(ColorStateList backColor)
-
setBackColorRes
void setBackColorRes(int backColorRes)
-
getThumbColor
ColorStateList getThumbColor()
-
setThumbColor
void setThumbColor(ColorStateList thumbColor)
-
setThumbColorRes
void setThumbColorRes(int thumbColorRes)
-
getBackMeasureRatio
float getBackMeasureRatio()
-
setBackMeasureRatio
void setBackMeasureRatio(float backMeasureRatio)
-
getThumbMargin
RectF getThumbMargin()
-
setThumbMargin
void setThumbMargin(RectF thumbMargin)
-
setThumbMargin
void setThumbMargin(float left, float top, float right, float bottom)
-
setThumbSize
void setThumbSize(float width, float height)
-
getThumbWidth
float getThumbWidth()
-
getThumbHeight
float getThumbHeight()
-
setThumbSize
void setThumbSize(PointF size)
-
getThumbSizeF
PointF getThumbSizeF()
-
getThumbRadius
float getThumbRadius()
-
setThumbRadius
void setThumbRadius(float thumbRadius)
-
getBackSizeF
PointF getBackSizeF()
-
getBackRadius
float getBackRadius()
-
setBackRadius
void setBackRadius(float backRadius)
-
isFadeBack
boolean isFadeBack()
-
setFadeBack
void setFadeBack(boolean fadeBack)
-
getTintColor
int getTintColor()
-
setTintColor
void setTintColor(int tintColor)
-
setText
void setText(CharSequence onText, CharSequence offText)
-
onSaveInstanceState
Parcelable onSaveInstanceState()
-
onRestoreInstanceState
void onRestoreInstanceState(Parcelable state)
-
-
-
-