From 089ff4555af27eec4561b1627298702b4ecee482 Mon Sep 17 00:00:00 2001 From: Lulu Wu Date: Wed, 25 May 2022 09:12:35 -0700 Subject: [PATCH] Revamp touch event dispatching methods Summary: There are two methods in ReactRootView to handle touch events "onInterceptTouchEvent" and "onTouchEvent", for Venice we have ReactSurfaceView inherits ReactRootView but the implementation for above 2 touch handling methods still calls into it's super implementation which uses the bridge. In this diff we make ReactSurfaceView inherits ReactRootView's "dispatchJSTouchEvent" and "dispatchJSPointerEvent". So that Venice has separate implementation for touch events handling. Changelog: [Android][Changed] - Revamp touch event dispatching methods Reviewed By: fkgozali, JoshuaGross Differential Revision: D36629466 fbshipit-source-id: fb7c5950afe6249d22edd3fac3fa5d3b83b3af84 --- .../src/main/java/com/facebook/react/ReactRootView.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java b/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java index 4f1aa1a747a6a1..f746f398f7ce72 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java @@ -338,7 +338,7 @@ public void requestChildFocus(View child, View focused) { super.requestChildFocus(child, focused); } - private void dispatchJSPointerEvent(MotionEvent event) { + protected void dispatchJSPointerEvent(MotionEvent event) { if (mReactInstanceManager == null || !mIsAttachedToInstance || mReactInstanceManager.getCurrentReactContext() == null) { @@ -361,7 +361,7 @@ private void dispatchJSPointerEvent(MotionEvent event) { } } - private void dispatchJSTouchEvent(MotionEvent event) { + protected void dispatchJSTouchEvent(MotionEvent event) { if (mReactInstanceManager == null || !mIsAttachedToInstance || mReactInstanceManager.getCurrentReactContext() == null) {