Back to project page MockGPSPath.
The source code is released under:
GNU General Public License
If you think the Android project MockGPSPath listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.rc.mockgpspath; /* ww w . j a v a 2 s . co m*/ import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; import com.google.android.maps.MapView; /** * A slightly modified MapView that allows for double-tap-to-zoom functionality. * * @author Ryan * */ public class MockGPSMapView extends MapView { private long lastTouchTime = -1; public MockGPSMapView(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); } }