is MotionEvent Timed Out - Android User Interface

Android examples for User Interface:MotionEvent

Description

is MotionEvent Timed Out

Demo Code


import android.util.MathUtils;
import android.view.MotionEvent;

public class Main{
    public static boolean isTimedOut(MotionEvent firstUp,
            MotionEvent secondUp, int timeout) {
        final long deltaTime = secondUp.getEventTime()
                - firstUp.getEventTime();
        return (deltaTime >= timeout);
    }//from   ww  w  . j  a v  a 2 s  .co m
}

Related Tutorials