Skip to content

Commit

Permalink
fix(android): revised naming of onInterceptTouchEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
siguangli2018 authored and siguangli committed Sep 26, 2022
1 parent 76da43c commit 905a82d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ public class NodeProps {
public static final String ON_TOUCH_MOVE = "touchmove";
public static final String ON_TOUCH_END = "touchend";
public static final String ON_TOUCH_CANCEL = "touchcancel";
public static final String ON_INTERCEPT_TOUCH_EVENT = "intercepttouchevent";
public static final String ON_INTERCEPT_PULL_UP_EVENT = "interceptpullupevent";
public static final String ON_ATTACHED_TO_WINDOW = "attachedtowindow";
public static final String ON_DETACHED_FROM_WINDOW = "detachedfromwindow";
public static final String ON_INTERCEPT_TOUCH_EVENT = "onInterceptTouchEvent";
public static final String ON_INTERCEPT_PULL_UP_EVENT = "onInterceptPullUpEvent";
public static final String ON_ATTACHED_TO_WINDOW = "attachedToWindow";
public static final String ON_DETACHED_FROM_WINDOW = "detachedFromWindow";

public static final String BORDER_RADIUS = "borderRadius";
public static final String BORDER_TOP_LEFT_RADIUS = "borderTopLeftRadius";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public class NativeRenderer extends Renderer implements NativeRender, NativeRend
private static final String LAYOUT_TOP = "top";
private static final String LAYOUT_WIDTH = "width";
private static final String LAYOUT_HEIGHT = "height";
private static final String EVENT_PREFIX = "on";
private static final int MAX_UI_TASK_QUEUE_CAPACITY = 1000;
@Nullable
private FrameworkProxy mFrameworkProxy;
Expand Down Expand Up @@ -282,6 +283,10 @@ public void dispatchEvent(int rootId, int nodeId, @NonNull String eventName,
@Nullable Object params, boolean useCapture, boolean useBubble, EventType eventType) {
// Because the native(C++) DOM use lowercase names, convert to lowercase here before call JNI.
String lowerCaseEventName = eventName.toLowerCase();
// Compatible with events prefixed with on in old version
if (lowerCaseEventName.startsWith(EVENT_PREFIX)) {
lowerCaseEventName = lowerCaseEventName.substring(EVENT_PREFIX.length());
}
if (eventType != EventType.EVENT_TYPE_GESTURE && !mRenderManager.checkRegisteredEvent(
rootId, nodeId, lowerCaseEventName)) {
return;
Expand Down

0 comments on commit 905a82d

Please sign in to comment.