80,349
社区成员
发帖
与我相关
我的任务
分享
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
float velocityY) {
if (e1.getX() - e2.getX() > 120 && velocityY/velocityX < 1/2 && velocityY/velocityX > -1/2){//如果是从右向左滑动
this.viewflipper.setInAnimation(AnimationUtils.loadAnimation(this, R.anim.left_in));
this.viewflipper.setOutAnimation(AnimationUtils.loadAnimation(this, R.anim.left_out));
// page ++;
但翻不了啊,郁闷。 private boolean rather(float x,float y){
if(x>y){
if(x-y>40){
return true;
}
}else if(x<y){
if(y-x>40){
return true;
}
}
return false;
}