mirror of
https://github.com/status-im/react-native.git
synced 2025-01-14 11:34:23 +00:00
More touch logging
Reviewed By: andreicoman11 Differential Revision: D3298518 fbshipit-source-id: 0ddbba5c05848ac164f6f1562b26609924978169
This commit is contained in:
parent
fa5d1fefa1
commit
ccef1b2941
@ -18,6 +18,7 @@ import com.facebook.react.common.ReactConstants;
|
||||
import com.facebook.react.common.SystemClock;
|
||||
import com.facebook.react.uimanager.events.EventDispatcher;
|
||||
import com.facebook.react.uimanager.events.TouchEvent;
|
||||
import com.facebook.react.uimanager.events.TouchEventCoalescingKeyHelper;
|
||||
import com.facebook.react.uimanager.events.TouchEventType;
|
||||
|
||||
/**
|
||||
@ -137,7 +138,14 @@ public class JSTouchDispatcher {
|
||||
mTargetCoordinates[0],
|
||||
mTargetCoordinates[1]));
|
||||
} else if (action == MotionEvent.ACTION_CANCEL) {
|
||||
if (TouchEventCoalescingKeyHelper.hasCoalescingKey(ev.getDownTime())) {
|
||||
dispatchCancelEvent(ev, eventDispatcher);
|
||||
} else {
|
||||
FLog.e(
|
||||
ReactConstants.TAG,
|
||||
"Received an ACTION_CANCEL touch event for which we have no corresponding ACTION_DOWN"
|
||||
);
|
||||
}
|
||||
mTargetTag = -1;
|
||||
} else {
|
||||
FLog.w(
|
||||
|
@ -83,4 +83,12 @@ public class TouchEventCoalescingKeyHelper {
|
||||
public static void removeCoalescingKey(long downTime) {
|
||||
sDownTimeToCoalescingKey.delete((int) downTime);
|
||||
}
|
||||
|
||||
public static boolean hasCoalescingKey(long downTime) {
|
||||
int currentValue = sDownTimeToCoalescingKey.get((int) downTime, -1);
|
||||
if (currentValue == -1) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user