diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java index c187cac7bea303..09ae7a272ad0e6 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java @@ -204,6 +204,11 @@ public ColorPropSetter(ReactProp prop, Method setter, int defaultValue) { mDefaultValue = defaultValue; } + public ColorPropSetter(ReactPropGroup prop, Method setter, int index, int defaultValue) { + super(prop, "mixed", setter, index); + mDefaultValue = defaultValue; + } + @Override protected Object getValueOrDefault(Object value, Context context) { if (value == null) { @@ -331,6 +336,10 @@ public BoxedColorPropSetter(ReactProp prop, Method setter) { super(prop, "mixed", setter); } + public BoxedColorPropSetter(ReactPropGroup prop, Method setter, int index) { + super(prop, "mixed", setter, index); + } + @Override protected @Nullable Object getValueOrDefault(Object value, Context context) { if (value != null) { @@ -468,7 +477,11 @@ private static void createPropSetters( } } else if (propTypeClass == int.class) { for (int i = 0; i < names.length; i++) { - props.put(names[i], new IntPropSetter(annotation, method, i, annotation.defaultInt())); + if ("Color".equals(annotation.customType())) { + props.put(names[i], new ColorPropSetter(annotation, method, i, annotation.defaultInt())); + } else { + props.put(names[i], new IntPropSetter(annotation, method, i, annotation.defaultInt())); + } } } else if (propTypeClass == float.class) { for (int i = 0; i < names.length; i++) { @@ -481,7 +494,11 @@ private static void createPropSetters( } } else if (propTypeClass == Integer.class) { for (int i = 0; i < names.length; i++) { - props.put(names[i], new BoxedIntPropSetter(annotation, method, i)); + if ("Color".equals(annotation.customType())) { + props.put(names[i], new BoxedColorPropSetter(annotation, method, i)); + } else { + props.put(names[i], new BoxedIntPropSetter(annotation, method, i)); + } } } else { throw new RuntimeException(