mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-08-16 02:44:58 +00:00
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user