android 如何控制Gallery 滑动速度
2013-06-08 15:43
399 查看
public class MyGallery extends Gallery {
public MyGallery(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
// TODO Auto-generated constructor stub
}
public MyGallery(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
}
public MyGallery(Context context) {
super(context);
// TODO Auto-generated constructor stub
}
/**
* ①点下去的事件
* ②当前的事件
* ③滑动的x方向速度
* ④y方向的速度
*/
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
float velocityY) {
Log.v("velocityX========="+velocityX, "velocityY ===="+velocityY);
velocityX = velocityX>0 ? 400 : -400;
return super.onFling(e1, e2, velocityX, velocityY);
}
}
public MyGallery(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
// TODO Auto-generated constructor stub
}
public MyGallery(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
}
public MyGallery(Context context) {
super(context);
// TODO Auto-generated constructor stub
}
/**
* ①点下去的事件
* ②当前的事件
* ③滑动的x方向速度
* ④y方向的速度
*/
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
float velocityY) {
Log.v("velocityX========="+velocityX, "velocityY ===="+velocityY);
velocityX = velocityX>0 ? 400 : -400;
return super.onFling(e1, e2, velocityX, velocityY);
}
}
相关文章推荐
- android gallery 滑动速度控制
- android 控制listview 的滑动速度
- Android开发控制ScrollView滑动速度的方法
- android_控制ScrollView滑动速度
- Android开发模板------ViewPager(三):实现无限循环、可嵌套RecyclerView、可控制滑动速度
- Android控制ScrollView滑动速度
- Android控制ScrollView滑动速度案例
- Android控制ScrollView滑动速度
- Android 控制listview 滑动速度
- android 控制listview 的滑动速度
- 重写Gallery控件,控制滑动速度
- Android控制ScrollView滑动速度
- Android控制ScrollView滑动速度
- Android——UI篇:ViewPager轮播图控制滑动速度
- Android控制ScrollView滑动速度
- android_控制ScrollView滑动速度
- Android控制ScrollView滑动速度
- Android控制ScrollView滑动速度
- 控制ScrollView滑动速度
- 如何提高Android应用启动速度,避免启动时黑屏太久