Double tap with custom time
<p>I need to implement a custom double tap with time. Example: set to 500ms, 300ms and 700ms. I did not find how to configure it! The problem is to treat it in a class of a Gesture, see:</p>

<pre><code>public boolean onTouchEvent(View v, MotionEvent e) throws InterruptedException {


    Button  button_now = activity.getButtonByPosition(e.getRawX(), e.getRawY());
    Date d = new Date(); 
    long now = d.getTime();                 


    if(e.getAction() == MotionEvent.ACTION_UP){
            if(button_now != null){                 

                if(button_last != null){                        

                    if(button_now.getId() == button_last.getId())){


                        if(now &lt; lastTouchedTime + DOUBLE_TAP_DELAY){
                            Log.d(tag,"Double tap");
                        }                           
                        else {
                            Log.d(tag,"Single Tap A");
                        }                           
                    }else{
                        Log.d(tag,"Single Tap B");

                    }
                }else{
                    Log.d(tag,"Single Tap C");                      
                }
            }               
            lastTouchedTime = now;
            button_last = button_now;                           
    }       
    return true;
}
</code></pre>

<p>The problem is: When you double-tap is running, there is also "Single Tap A" before. Could anyone help me?</p>
