mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Support excluding multiple platforms.
Summary: Currently the schema only allows to exclude a single platform (iOS OR Android). There are cases where we need to exclude multiple. This change converts the previous `excludePlatform` string property into an `excludePlatforms` array. Changelog: [Internal][Changed] - Added support to exclude multiple platforms in Codegen. Reviewed By: sammy-SC Differential Revision: D21426950 fbshipit-source-id: eff36ffa207109274794b4b300bf6313f8286161
This commit is contained in:
committed by
Facebook GitHub Bot
parent
7bb1c4e1b8
commit
16ea9ba813
+16
-6
@@ -11,6 +11,8 @@ package com.facebook.react.viewmanagers;
|
||||
|
||||
import android.view.View;
|
||||
import androidx.annotation.Nullable;
|
||||
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;
|
||||
@@ -29,25 +31,33 @@ public class SwitchManagerDelegate<T extends View, U extends BaseViewManagerInte
|
||||
mViewManager.setValue(view, value == null ? false : (boolean) value);
|
||||
break;
|
||||
case "tintColor":
|
||||
mViewManager.setTintColor(view, value == null ? null : ((Double) value).intValue());
|
||||
mViewManager.setTintColor(view, ColorPropConverter.getColor(value, view.getContext()));
|
||||
break;
|
||||
case "onTintColor":
|
||||
mViewManager.setOnTintColor(view, value == null ? null : ((Double) value).intValue());
|
||||
mViewManager.setOnTintColor(view, ColorPropConverter.getColor(value, view.getContext()));
|
||||
break;
|
||||
case "thumbTintColor":
|
||||
mViewManager.setThumbTintColor(view, value == null ? null : ((Double) value).intValue());
|
||||
mViewManager.setThumbTintColor(view, ColorPropConverter.getColor(value, view.getContext()));
|
||||
break;
|
||||
case "thumbColor":
|
||||
mViewManager.setThumbColor(view, value == null ? null : ((Double) value).intValue());
|
||||
mViewManager.setThumbColor(view, ColorPropConverter.getColor(value, view.getContext()));
|
||||
break;
|
||||
case "trackColorForFalse":
|
||||
mViewManager.setTrackColorForFalse(view, value == null ? null : ((Double) value).intValue());
|
||||
mViewManager.setTrackColorForFalse(view, ColorPropConverter.getColor(value, view.getContext()));
|
||||
break;
|
||||
case "trackColorForTrue":
|
||||
mViewManager.setTrackColorForTrue(view, value == null ? null : ((Double) value).intValue());
|
||||
mViewManager.setTrackColorForTrue(view, ColorPropConverter.getColor(value, view.getContext()));
|
||||
break;
|
||||
default:
|
||||
super.setProperty(view, propName, value);
|
||||
}
|
||||
}
|
||||
|
||||
public void receiveCommand(SwitchManagerInterface<T> viewManager, T view, String commandName, ReadableArray args) {
|
||||
switch (commandName) {
|
||||
case "setValue":
|
||||
viewManager.setValue(view, args.getBoolean(0));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user