Update GeneratePropsJavaDelegate to handle PlatformColor

Summary:
$title

Changelog:
[Internal]

(Note: this ignores all push blocking failures!)

Reviewed By: rickhanlonii

Differential Revision: D20175915

fbshipit-source-id: 96d75e8cc098ea6ce78288f40191f7bae24d5aa5
This commit is contained in:
Eli White
2020-03-02 15:12:10 -08:00
committed by Facebook Github Bot
parent f4de45800f
commit 03ac8e872e
4 changed files with 15 additions and 7 deletions
@@ -106,7 +106,7 @@ function getJavaValueForProp(
case 'NativePrimitiveTypeAnnotation':
switch (typeAnnotation.name) {
case 'ColorPrimitive':
return 'value == null ? null : ((Double) value).intValue()';
return 'ColorPropConverter.getColor(value, view.getContext())';
case 'ImageSourcePrimitive':
return '(ReadableMap) value';
case 'PointPrimitive':
@@ -230,7 +230,7 @@ function getClassExtendString(component): string {
}
function getDelegateImports(component) {
const imports = getImports(component);
const imports = getImports(component, 'delegate');
// The delegate needs ReadableArray for commands always.
// The interface doesn't always need it
if (component.commands.length > 0) {