Implement setGestureInProgress on Android

This commit is contained in:
Leith Bade
2015-08-13 13:36:41 +10:00
parent dbaac73e2c
commit 5abb18a99c
3 changed files with 17 additions and 1 deletions

View File

@@ -793,6 +793,7 @@ public class MapView extends FrameLayout implements LocationListener {
switch (event.getActionMasked()) {
case MotionEvent.ACTION_DOWN:
// First pointer down
mNativeMapView.setGestureInProgress(true);
break;
case MotionEvent.ACTION_POINTER_DOWN:
@@ -809,6 +810,7 @@ public class MapView extends FrameLayout implements LocationListener {
long tapInterval = event.getEventTime() - event.getDownTime();
boolean isTap = tapInterval <= ViewConfiguration.getTapTimeout();
boolean inProgress = mRotateGestureDetector.isInProgress() || mScaleGestureDetector.isInProgress();
mNativeMapView.setGestureInProgress(false);
if (mTwoTap && isTap && !inProgress) {
PointF focalPoint = TwoFingerGestureDetector.determineFocalPoint(event);
@@ -822,6 +824,7 @@ public class MapView extends FrameLayout implements LocationListener {
case MotionEvent.ACTION_CANCEL:
mTwoTap = false;
mNativeMapView.setGestureInProgress(false);
break;
}
@@ -938,7 +941,6 @@ public class MapView extends FrameLayout implements LocationListener {
}
mBeginTime = detector.getEventTime();
return true;
}

View File

@@ -208,6 +208,10 @@ class NativeMapView {
nativeCancelTransitions(mNativeMapViewPtr);
}
public void setGestureInProgress(boolean inProgress) {
nativeSetGestureInProgress(mNativeMapViewPtr, inProgress);
}
public void moveBy(double dx, double dy) {
moveBy(dx, dy, 0);
}
@@ -498,6 +502,8 @@ class NativeMapView {
private native void nativeCancelTransitions(long nativeMapViewPtr);
private native void nativeSetGestureInProgress(long nativeMapViewPtr, boolean inProgress);
private native void nativeMoveBy(long nativeMapViewPtr, double dx,
double dy, long duration);