mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Dispatch switch events using the proper UIModule
Summary: This diff ensures that the dispatch of switch events is performed using the proper UIModule changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D28204930 fbshipit-source-id: 625b536ab3106efa7dbf583589dfe268b880a6a0
This commit is contained in:
committed by
Facebook GitHub Bot
parent
eb0a918577
commit
d583cb8def
+3
-10
@@ -21,7 +21,6 @@ import com.facebook.react.uimanager.PixelUtil;
|
||||
import com.facebook.react.uimanager.SimpleViewManager;
|
||||
import com.facebook.react.uimanager.ThemedReactContext;
|
||||
import com.facebook.react.uimanager.UIManagerHelper;
|
||||
import com.facebook.react.uimanager.UIManagerModule;
|
||||
import com.facebook.react.uimanager.ViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.ViewProps;
|
||||
import com.facebook.react.uimanager.annotations.ReactProp;
|
||||
@@ -82,17 +81,11 @@ public class ReactSwitchManager extends SimpleViewManager<ReactSwitch>
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
ReactContext reactContext = (ReactContext) buttonView.getContext();
|
||||
|
||||
UIManagerModule uiManager = reactContext.getNativeModule(UIManagerModule.class);
|
||||
|
||||
if (uiManager == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
uiManager
|
||||
.getEventDispatcher()
|
||||
int reactTag = buttonView.getId();
|
||||
UIManagerHelper.getEventDispatcherForReactTag(reactContext, reactTag)
|
||||
.dispatchEvent(
|
||||
new ReactSwitchEvent(
|
||||
UIManagerHelper.getSurfaceId(reactContext), buttonView.getId(), isChecked));
|
||||
UIManagerHelper.getSurfaceId(reactContext), reactTag, isChecked));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user