Migrate Android view managers to type-safe commands generated by JS codegen

Summary:
## Changelog:

[General] [Changed] - Migrate Android view managers to type-safe commands generated by JS codegen.

Reviewed By: JoshuaGross, mdvacca

Differential Revision: D21406461

fbshipit-source-id: 93584b240314254675a36a58c4d0c0880d6889fb
This commit is contained in:
Lulu Wu
2020-05-12 04:37:44 -07:00
committed by Facebook GitHub Bot
parent 8f90ce26a5
commit 63099c40e6
14 changed files with 55 additions and 27 deletions
@@ -15,7 +15,6 @@ import com.facebook.react.bridge.ColorPropConverter;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.BaseViewManagerInterface;
import com.facebook.react.uimanager.LayoutShadowNode;
public class SwitchManagerDelegate<T extends View, U extends BaseViewManagerInterface<T> & SwitchManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
public SwitchManagerDelegate(U viewManager) {
@@ -53,10 +52,11 @@ public class SwitchManagerDelegate<T extends View, U extends BaseViewManagerInte
}
}
public void receiveCommand(SwitchManagerInterface<T> viewManager, T view, String commandName, ReadableArray args) {
@Override
public void receiveCommand(T view, String commandName, ReadableArray args) {
switch (commandName) {
case "setValue":
viewManager.setValue(view, args.getBoolean(0));
mViewManager.setValue(view, args.getBoolean(0));
break;
}
}