Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,21 @@ public BoxedIntPropSetter(ReactPropGroup prop, Method setter, int index) {
}
}

private static class BoxedColorPropSetter extends PropSetter {

public BoxedColorPropSetter(ReactProp prop, Method setter) {
super(prop, "mixed", setter);
}

@Override
protected @Nullable Object getValueOrDefault(Object value, Context context) {
if (value != null) {
return ColorPropConverter.getColor(value, context);
}
return null;
}
}

/*package*/ static Map<String, String> getNativePropsForView(
Class<? extends ViewManager> viewManagerTopClass,
Class<? extends ReactShadowNode> shadowNodeTopClass) {
Expand Down Expand Up @@ -418,7 +433,7 @@ private static PropSetter createPropSetter(
return new BoxedBooleanPropSetter(annotation, method);
} else if (propTypeClass == Integer.class) {
if ("Color".equals(annotation.customType())) {
return new ColorPropSetter(annotation, method);
return new BoxedColorPropSetter(annotation, method);
}
return new BoxedIntPropSetter(annotation, method);
} else if (propTypeClass == ReadableArray.class) {
Expand Down