diff --git a/android/src/main/java/com/horcrux/svg/SvgView.java b/android/src/main/java/com/horcrux/svg/SvgView.java index 8170d1eb..f2ccb1b3 100644 --- a/android/src/main/java/com/horcrux/svg/SvgView.java +++ b/android/src/main/java/com/horcrux/svg/SvgView.java @@ -47,6 +47,7 @@ public class SvgView extends View { private @Nullable Bitmap mBitmap; private EventDispatcher mEventDispatcher; + private long mGestureStartTime = TouchEvent.UNSET; private int mTargetTag; private final TouchEventCoalescingKeyHelper mTouchEventCoalescingKeyHelper = @@ -124,6 +125,7 @@ public class SvgView extends View { mTargetTag, type, ev, + mGestureStartTime, ev.getX(), ev.getY(), mTouchEventCoalescingKeyHelper)); @@ -132,6 +134,7 @@ public class SvgView extends View { public void handleTouchEvent(MotionEvent ev) { int action = ev.getAction() & MotionEvent.ACTION_MASK; if (action == MotionEvent.ACTION_DOWN) { + mGestureStartTime = ev.getEventTime(); dispatch(ev, TouchEventType.START); } else if (mTargetTag == -1) { // All the subsequent action types are expected to be called after ACTION_DOWN thus target @@ -155,9 +158,11 @@ public class SvgView extends View { // Exactly onw of the pointers goes up dispatch(ev, TouchEventType.END); mTargetTag = -1; + mGestureStartTime = TouchEvent.UNSET; } else if (action == MotionEvent.ACTION_CANCEL) { dispatchCancelEvent(ev); mTargetTag = -1; + mGestureStartTime = TouchEvent.UNSET; } else { Log.w( "IGNORE",