This commit is contained in:
陈阳
2017-05-02 11:56:58 +08:00
parent 9a07c4251d
commit 2fd178da28
@@ -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",