首页 > 代码库 > Android 手势滑动

Android 手势滑动

一: GestureDetector

http://blog.csdn.net/jjwwmlp456/article/details/21282239 写的不错,但是

博文中有错误,正确的写法是:

@Override

public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {

if (e1.getX()-e2.getX()>120) {//左滑,右边显示

ToastUtils.showShortToast(PersonalCenterActivity2.this, "左滑,右边显示");

}

if(e1.getX()-e2.getX()<-120) {

ToastUtils.showShortToast(PersonalCenterActivity2.this, "右滑,左边显示");

}

return false;

}

http://www.cnblogs.com/ok-lanyan/archive/2012/08/02/2619701.html 

二:Android的Activity屏幕切换动画(一)-左右滑动切换:

http://www.oschina.net/question/97118_34343 


Android 手势滑动