Skip to content

Commit

Permalink
Revamp touch event dispatching methods
Browse files Browse the repository at this point in the history
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
  • Loading branch information
luluwu2032 authored and facebook-github-bot committed May 25, 2022
1 parent ad76eb3 commit 089ff45
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit 089ff45

Please sign in to comment.