Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix android platform border color (#39893) #41029

Closed
wants to merge 1 commit into from
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 @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -463,7 +472,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++) {
Expand All @@ -476,7 +489,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(
Expand Down
Loading