mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-02 23:05:01 +08:00
Add noop support for setJSResponder / clearJSReponder API methods
Reviewed By: fkgozali Differential Revision: D8458980 fbshipit-source-id: 2411fb8106288f65cabdef12917d0f5086d1723a
This commit is contained in:
committed by
Facebook Github Bot
parent
936de607b1
commit
e15a761084
@@ -10,6 +10,7 @@ package com.facebook.react.uimanager;
|
||||
import static com.facebook.react.bridge.ReactMarkerConstants.CREATE_UI_MANAGER_MODULE_CONSTANTS_END;
|
||||
import static com.facebook.react.bridge.ReactMarkerConstants.CREATE_UI_MANAGER_MODULE_CONSTANTS_START;
|
||||
import static com.facebook.react.uimanager.common.UIManagerType.DEFAULT;
|
||||
import static com.facebook.react.uimanager.common.UIManagerType.FABRIC;
|
||||
|
||||
import android.content.ComponentCallbacks2;
|
||||
import android.content.Context;
|
||||
@@ -39,6 +40,7 @@ import com.facebook.react.common.ReactConstants;
|
||||
import com.facebook.react.module.annotations.ReactModule;
|
||||
import com.facebook.react.uimanager.common.MeasureSpecProvider;
|
||||
import com.facebook.react.uimanager.common.SizeMonitoringFrameLayout;
|
||||
import com.facebook.react.uimanager.common.UIManagerType;
|
||||
import com.facebook.react.uimanager.common.ViewUtil;
|
||||
import com.facebook.react.uimanager.debug.NotThreadSafeViewHierarchyUpdateDebugListener;
|
||||
import com.facebook.react.uimanager.events.EventDispatcher;
|
||||
@@ -585,11 +587,20 @@ public class UIManagerModule extends ReactContextBaseJavaModule implements
|
||||
mUIImplementation.removeAnimation(reactTag, animationID);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ReactMethod
|
||||
public void setJSResponder(int reactTag, boolean blockNativeResponder) {
|
||||
//TODO: this is a temporary approach to support ViewManagerCommands in Fabric until
|
||||
// the dispatchViewManagerCommand() method is supported by Fabric JS API.
|
||||
int uiManagerType = ViewUtil.getUIManagerType(reactTag);
|
||||
if (uiManagerType != DEFAULT) {
|
||||
UIManagerHelper.getUIManager(getReactApplicationContext(), uiManagerType).setJSResponder(reactTag, blockNativeResponder);
|
||||
}
|
||||
|
||||
mUIImplementation.setJSResponder(reactTag, blockNativeResponder);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ReactMethod
|
||||
public void clearJSResponder() {
|
||||
mUIImplementation.clearJSResponder();
|
||||
|
||||
Reference in New Issue
Block a user