mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Replace direct ViewManager calls to old UIManager with Fabric/Venice-compatible calls
Summary: Replace direct ViewManager calls to old UIManager with Fabric/Venice-compatible calls. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D22111396 fbshipit-source-id: 2de9df5a4b494f82049dba62325ee3119c80d3c3
This commit is contained in:
committed by
Facebook GitHub Bot
parent
57fcf6c268
commit
e5a4d9550e
+18
-20
@@ -17,7 +17,7 @@ import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
import com.facebook.react.uimanager.ReactStylesDiffMap;
|
||||
import com.facebook.react.uimanager.StateWrapper;
|
||||
import com.facebook.react.uimanager.ThemedReactContext;
|
||||
import com.facebook.react.uimanager.UIManagerModule;
|
||||
import com.facebook.react.uimanager.UIManagerHelper;
|
||||
import com.facebook.react.uimanager.ViewGroupManager;
|
||||
import com.facebook.react.uimanager.ViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.annotations.ReactProp;
|
||||
@@ -105,26 +105,24 @@ public class ReactModalHostManager extends ViewGroupManager<ReactModalHostView>
|
||||
|
||||
@Override
|
||||
protected void addEventEmitters(ThemedReactContext reactContext, final ReactModalHostView view) {
|
||||
UIManagerModule uiManager = reactContext.getNativeModule(UIManagerModule.class);
|
||||
if (uiManager == null) {
|
||||
return;
|
||||
final EventDispatcher dispatcher =
|
||||
UIManagerHelper.getEventDispatcherForReactTag(reactContext, view.getId());
|
||||
if (dispatcher != null) {
|
||||
view.setOnRequestCloseListener(
|
||||
new ReactModalHostView.OnRequestCloseListener() {
|
||||
@Override
|
||||
public void onRequestClose(DialogInterface dialog) {
|
||||
dispatcher.dispatchEvent(new RequestCloseEvent(view.getId()));
|
||||
}
|
||||
});
|
||||
view.setOnShowListener(
|
||||
new DialogInterface.OnShowListener() {
|
||||
@Override
|
||||
public void onShow(DialogInterface dialog) {
|
||||
dispatcher.dispatchEvent(new ShowEvent(view.getId()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
final EventDispatcher dispatcher = uiManager.getEventDispatcher();
|
||||
view.setOnRequestCloseListener(
|
||||
new ReactModalHostView.OnRequestCloseListener() {
|
||||
@Override
|
||||
public void onRequestClose(DialogInterface dialog) {
|
||||
dispatcher.dispatchEvent(new RequestCloseEvent(view.getId()));
|
||||
}
|
||||
});
|
||||
view.setOnShowListener(
|
||||
new DialogInterface.OnShowListener() {
|
||||
@Override
|
||||
public void onShow(DialogInterface dialog) {
|
||||
dispatcher.dispatchEvent(new ShowEvent(view.getId()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-3
@@ -61,7 +61,6 @@ import com.facebook.react.uimanager.Spacing;
|
||||
import com.facebook.react.uimanager.StateWrapper;
|
||||
import com.facebook.react.uimanager.ThemedReactContext;
|
||||
import com.facebook.react.uimanager.UIManagerHelper;
|
||||
import com.facebook.react.uimanager.UIManagerModule;
|
||||
import com.facebook.react.uimanager.ViewDefaults;
|
||||
import com.facebook.react.uimanager.ViewProps;
|
||||
import com.facebook.react.uimanager.annotations.ReactProp;
|
||||
@@ -1100,8 +1099,7 @@ public class ReactTextInputManager extends BaseViewManager<ReactEditText, Layout
|
||||
public ReactContentSizeWatcher(ReactEditText editText) {
|
||||
mEditText = editText;
|
||||
ReactContext reactContext = getReactContext(editText);
|
||||
UIManagerModule uiManager = reactContext.getNativeModule(UIManagerModule.class);
|
||||
mEventDispatcher = uiManager != null ? uiManager.getEventDispatcher() : null;
|
||||
mEventDispatcher = getEventDispatcher(reactContext, editText);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user