Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Duration of a Single-Tap and Long-Tap in Android

I'm trying to drag overlays an a map and also display an infobox if the user taps on a pin. To do so I need to measure the time between MotionEvent.ACTION_DOWN and MotionEvent.ACTION_UP. To make it feel as natural as possible I would like to know what value Android uses for a Single-Tap (currently I'm using 180ms) and also for a Long-Tap.

Thanks!

like image 493
timoschloesser Avatar asked Dec 02 '12 14:12

timoschloesser


1 Answers

Android source uses 125ms for a single tap and 500ms as the long press time:

private static final int PRESSED_STATE_DURATION = 125;

private static final int DEFAULT_LONG_PRESS_TIMEOUT = 500;

ViewConfiguration.java#PRESSED_STATE_DURATION

ViewConfiguration.java#DEFAULT_LONG_PRESS_TIMEOUT

like image 91
Andy McSherry Avatar answered Sep 28 '22 08:09

Andy McSherry