Android Open Source - 5th Change Gesture Detector

From Project

Back to project page 5th.


The source code is released under:

GNU General Public License

If you think the Android project 5th listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.zhanglin.practice;
/*from   w  w  w  . java 2  s  .  co m*/
import android.view.MotionEvent;
import android.view.GestureDetector.SimpleOnGestureListener;

public class ChangeGestureDetector extends SimpleOnGestureListener
  PlayingActivity activity;

  public ChangeGestureDetector(PlayingActivity activity)

  public boolean onFling(MotionEvent e1,MotionEvent e2,float velocityX,float velocityY)
    final int FLING_MIN_DISTANCE=100;// X??y????????(???)
    final int FLING_MIN_VELOCITY=200;// x??y???????(???/?)
    else if((e2.getX()-e1.getX())>FLING_MIN_DISTANCE&&Math.abs(velocityX)>FLING_MIN_VELOCITY)
    return super.onFling(e1,e2,velocityX,velocityY);


Java Source Code List