自带图片按下去效果的RadioButton
来源:互联网 发布:注册了淘宝名字能改吗 编辑:程序博客网 时间:2024/04/28 07:31
public class EffectRadioButton extends RadioButton { public EffectRadioButton(Context context) { super(context); } public EffectRadioButton(Context context, AttributeSet attrs) { super(context, attrs); } public EffectRadioButton(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @Override public boolean onTouchEvent(MotionEvent event) { this.getParent().requestDisallowInterceptTouchEvent(true); switch (event.getAction()) { case MotionEvent.ACTION_DOWN: { Drawable background = getBackground(); if (background != null) background.setColorFilter(0x88000000, android.graphics.PorterDuff.Mode.SRC_ATOP); Drawable[] drawables = getCompoundDrawables(); Drawable image = drawables[1]; if (image != null) image.setColorFilter(0x88000000, android.graphics.PorterDuff.Mode.SRC_ATOP); invalidate(); break; } case MotionEvent.ACTION_CANCEL: case MotionEvent.ACTION_UP: { Drawable background = getBackground(); if (background != null) background.clearColorFilter(); Drawable[] drawables = getCompoundDrawables(); Drawable image = drawables[1]; if (image != null) image.clearColorFilter(); invalidate(); break; } } return super.onTouchEvent(event); }}
0 0
- 自带图片按下去效果的RadioButton
- 消除RadioButton中的自带的圆圈
- 利用RadioGroup和RadioButton实现单选且选中的效果自定图片
- 带图片的Toast效果
- UIImageView自带的一个方法,使图片出现时有渐隐、缓慢出现的效果。
- 自绘的RadioButton
- 自绘的RadioButton
- 自绘的RadioButton
- iOS自带的毛玻璃的效果
- ios7自带的晃动效果
- ios自带的动画效果
- android自带抽屉效果的实现
- TextView 自带的跑马灯效果
- 屏蔽GridView自带的点击效果。
- ios自带的模糊效果
- Jquery自带的弹出框效果
- UGUI自带的颜色渐变效果
- Button去掉自带的阴影效果
- 怎样配置让apache访问日志记录真实客户端IP,而不是nginx代理服务器IP
- 线程安全与可重入
- 研究LWIP感悟C用法的新发现
- 冒泡排序
- No grammar constraints (DTD or XML schema).....两种解决方法
- 自带图片按下去效果的RadioButton
- springMVC+mybatis+ehcache详细配置
- boost asio
- matlab常用函数
- 遍历Map的四种方法
- JavaScript基础——事件(基础)
- Unity3D学习笔记——NGUI之UIToggle
- Android6.0以下系统判断相机权限
- java中形参个数可变的方法