AndBase开发框架  1.6
 全部  命名空间 文件 函数 变量 枚举值 
Public 成员函数 | Protected 成员函数 | Private 成员函数 | Private 属性 | 所有成员列表
com.ab.view.sliding.AbSlidingButton类 参考
类 com.ab.view.sliding.AbSlidingButton 继承关系图:

Public 成员函数

 AbSlidingButton (Context context)
 
 AbSlidingButton (Context context, AttributeSet attrs)
 
void setImageResource (int btnBottomResource, int btnFrameResource, int btnMaskResource, int btnNormalResource, int btnPressedResource)
 
boolean isChecked ()
 
void setChecked (boolean checked)
 
void setChecked (boolean checked, boolean anim)
 
void setOnCheckedChangeListener (OnCheckedChangeListener listener)
 
boolean onTouchEvent (MotionEvent event)
 
boolean performClick ()
 
void toggle ()
 

Protected 成员函数

void onDraw (Canvas canvas)
 
void onMeasure (int paramInt1, int paramInt2)
 

Private 成员函数

void init (Context context)
 
float getRealPos (float paramFloat)
 
void moveView (float pos)
 
void moveView (final float pos, boolean delay)
 
void startAnimation ()
 
void moveViewToTarget ()
 

Private 属性

Context context
 
Bitmap btnFrame
 
Bitmap btnMask
 
Bitmap btnBottom
 
Bitmap mBtnNormal
 
Bitmap mBtnPressed
 
OnCheckedChangeListener onCheckedChangeListener
 
boolean isChecked
 
float mMaskHeight
 
float mMaskWidth
 
float mBtnOffPos
 
float mBtnOnPos
 
float mBtnPos
 
float mLastBtnPos
 
float mRealPos
 
float mBtnWidth
 
float mExtendOffsetY
 
int mAlpha
 
Paint mPaint
 
PorterDuffXfermode mXfermode
 
RectF mSaveLayerRectF
 
Bitmap mCurBtnPic
 
float mFirstDownX
 
boolean mMoveEvent
 
boolean mAnimating
 
float mAnimationPosition
 
float mAnimatedVelocity
 
Handler handler
 

详细描述

© 2012 amsoft.cn 名称:AbSlidingButton.java 描述:滑动按钮

作者
还如一梦中
版本
v1.0
日期
:2013-11-14 上午11:31:21

构造及析构函数说明

com.ab.view.sliding.AbSlidingButton.AbSlidingButton ( Context  context)
inline

Instantiates a new ab sliding button.

参数
contextthe context
com.ab.view.sliding.AbSlidingButton.AbSlidingButton ( Context  context,
AttributeSet  attrs 
)
inline

Instantiates a new ab sliding button.

参数
contextthe context
attrsthe attrs

成员函数说明

float com.ab.view.sliding.AbSlidingButton.getRealPos ( float  paramFloat)
inlineprivate

Gets the real pos.

参数
paramFloatthe param float
返回
the real pos
void com.ab.view.sliding.AbSlidingButton.init ( Context  context)
inlineprivate

Inits the.

参数
contextthe context
boolean com.ab.view.sliding.AbSlidingButton.isChecked ( )
inline

描述:获得当前.

版本
v1.0
返回
true, if is checked
参见
android.widget.CompoundButton::isChecked()
作者
: amsoft.cn
日期
:2013-11-29 下午3:54:47
void com.ab.view.sliding.AbSlidingButton.moveView ( float  pos)
inlineprivate

描述:滑块移动.

版本
v1.0
参数
posthe pos
日期
:2013-12-5 上午11:46:56
void com.ab.view.sliding.AbSlidingButton.moveView ( final float  pos,
boolean  delay 
)
inlineprivate

描述:滑块移动.

版本
v1.0
参数
posthe pos
delaythe delay
日期
:2013-12-5 上午11:46:56
void com.ab.view.sliding.AbSlidingButton.moveViewToTarget ( )
inlineprivate

描述:直接移动到位置.

版本
v1.0
日期
:2013-12-9 上午9:20:38
void com.ab.view.sliding.AbSlidingButton.onDraw ( Canvas  canvas)
inlineprotected
void com.ab.view.sliding.AbSlidingButton.onMeasure ( int  paramInt1,
int  paramInt2 
)
inlineprotected

描述:测量View的宽高.

参数
paramInt1the param int1
paramInt2the param int2
参见
android.view.View::onMeasure(int, int)
boolean com.ab.view.sliding.AbSlidingButton.onTouchEvent ( MotionEvent  event)
inline

描述:滑动事件.

版本
v1.0
参数
eventthe event
返回
true, if successful
参见
android.widget.TextView::onTouchEvent(android.view.MotionEvent)
作者
: amsoft.cn
日期
:2013-12-5 上午11:22:12
boolean com.ab.view.sliding.AbSlidingButton.performClick ( )
inline
void com.ab.view.sliding.AbSlidingButton.setChecked ( boolean  checked)
inline

描述:设置选中.

版本
v1.0
参数
checkedthe new checked
参见
android.widget.CompoundButton::setChecked(boolean)
作者
: amsoft.cn
日期
:2013-11-29 下午3:54:33
void com.ab.view.sliding.AbSlidingButton.setChecked ( boolean  checked,
boolean  anim 
)
inline

描述:设置选中.

版本
v1.0
参数
checkedthe checked
animthe anim
参见
android.widget.CompoundButton::setChecked(boolean)
作者
: amsoft.cn
日期
:2013-11-29 下午3:54:33
void com.ab.view.sliding.AbSlidingButton.setImageResource ( int  btnBottomResource,
int  btnFrameResource,
int  btnMaskResource,
int  btnNormalResource,
int  btnPressedResource 
)
inline

描述:设置图片资源.

版本
v1.0
参数
btnBottomResourcethe btn bottom resource
btnFrameResourcethe btn frame resource
btnMaskResourcethe btn mask resource
btnNormalResourcethe btn normal resource
btnPressedResourcethe btn pressed resource
日期
:2013-11-29 下午3:26:42
void com.ab.view.sliding.AbSlidingButton.setOnCheckedChangeListener ( OnCheckedChangeListener  listener)
inline

描述:设置监听器.

版本
v1.0
参数
listenerthe new on checked change listener
参见
android.widget.CompoundButton::setOnCheckedChangeListener(android.widget.CompoundButton.OnCheckedChangeListener)
作者
: amsoft.cn
日期
:2013-11-29 下午3:54:20
void com.ab.view.sliding.AbSlidingButton.startAnimation ( )
inlineprivate

描述:用位移加速度实现动画.

版本
v1.0
日期
:2013-12-9 上午9:47:59
void com.ab.view.sliding.AbSlidingButton.toggle ( )
inline

类成员变量说明

Bitmap com.ab.view.sliding.AbSlidingButton.btnBottom
private

The btn bottom.

Bitmap com.ab.view.sliding.AbSlidingButton.btnFrame
private

The btn frame.

Bitmap com.ab.view.sliding.AbSlidingButton.btnMask
private

The btn mask.

Context com.ab.view.sliding.AbSlidingButton.context
private

The context.

Handler com.ab.view.sliding.AbSlidingButton.handler
private
初始值:
= new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case 0:
mRealPos = getRealPos((Float)msg.obj);
mLastBtnPos = (Float)msg.obj;
invalidate();
break;
default:
break;
}
}
}

The handler.

boolean com.ab.view.sliding.AbSlidingButton.isChecked
private

The is checked.

int com.ab.view.sliding.AbSlidingButton.mAlpha
private

The m alpha.

float com.ab.view.sliding.AbSlidingButton.mAnimatedVelocity
private

The m animated velocity.

boolean com.ab.view.sliding.AbSlidingButton.mAnimating
private

The m animating.

float com.ab.view.sliding.AbSlidingButton.mAnimationPosition
private

The m animation position.

Bitmap com.ab.view.sliding.AbSlidingButton.mBtnNormal
private

The m btn normal.

float com.ab.view.sliding.AbSlidingButton.mBtnOffPos
private

The m btn off pos.

float com.ab.view.sliding.AbSlidingButton.mBtnOnPos
private

The m btn on pos.

float com.ab.view.sliding.AbSlidingButton.mBtnPos
private

The m btn pos.

Bitmap com.ab.view.sliding.AbSlidingButton.mBtnPressed
private

The m btn pressed.

float com.ab.view.sliding.AbSlidingButton.mBtnWidth
private

The m btn width.

Bitmap com.ab.view.sliding.AbSlidingButton.mCurBtnPic
private

The m cur btn pic.

float com.ab.view.sliding.AbSlidingButton.mExtendOffsetY
private

The m extend offset y.

float com.ab.view.sliding.AbSlidingButton.mFirstDownX
private

The m first down x.

float com.ab.view.sliding.AbSlidingButton.mLastBtnPos
private

The m last btn pos.

float com.ab.view.sliding.AbSlidingButton.mMaskHeight
private

The m mask height.

float com.ab.view.sliding.AbSlidingButton.mMaskWidth
private

The m mask width.

boolean com.ab.view.sliding.AbSlidingButton.mMoveEvent
private

The m move event.

Paint com.ab.view.sliding.AbSlidingButton.mPaint
private

The m paint.

float com.ab.view.sliding.AbSlidingButton.mRealPos
private

The m real pos.

RectF com.ab.view.sliding.AbSlidingButton.mSaveLayerRectF
private

The m save layer rect f.

PorterDuffXfermode com.ab.view.sliding.AbSlidingButton.mXfermode
private

The m xfermode.

OnCheckedChangeListener com.ab.view.sliding.AbSlidingButton.onCheckedChangeListener
private

The on checked change listener.


该类的文档由以下文件生成: