public class MyMapView extends MapView {
private long lastTouchTime = -1;
public MyMapView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
long thisTime = System.currentTimeMillis();
if (thisTime - lastTouchTime < 250) {
// Double tap
this.getController().zoomInFixing((int) ev.getX(), (int) ev.getY());
lastTouchTime = -1;
} else {
// Too slow
lastTouchTime = thisTime;
}
}
return super.onInterceptTouchEvent(ev);
}
标签:MotionEvent,lastTouchTime,int,双击,public,mapView,ev,监测,thisTime
From: https://blog.51cto.com/u_16166892/6525399