From 9d31e75d000a7182064d6273e56ca22641a0be40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danilo=20B=C3=BCrger?= Date: Fri, 1 Apr 2022 14:47:09 +0200 Subject: [PATCH] Support PlatformColor in borderColor on Android --- .../java/com/facebook/react/uimanager/ViewProps.java | 10 ++++++---- .../js/examples/PlatformColor/PlatformColorExample.js | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewProps.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewProps.java index 661c3466dde96f..a8799cc6f4bfac 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewProps.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewProps.java @@ -276,14 +276,16 @@ public static boolean isLayoutOnly(ReadableMap map, String prop) { } return true; case BORDER_LEFT_COLOR: - return !map.isNull(BORDER_LEFT_COLOR) && map.getInt(BORDER_LEFT_COLOR) == Color.TRANSPARENT; + return map.getType(BORDER_LEFT_COLOR) == ReadableType.Number + && map.getInt(BORDER_LEFT_COLOR) == Color.TRANSPARENT; case BORDER_RIGHT_COLOR: - return !map.isNull(BORDER_RIGHT_COLOR) + return map.getType(BORDER_RIGHT_COLOR) == ReadableType.Number && map.getInt(BORDER_RIGHT_COLOR) == Color.TRANSPARENT; case BORDER_TOP_COLOR: - return !map.isNull(BORDER_TOP_COLOR) && map.getInt(BORDER_TOP_COLOR) == Color.TRANSPARENT; + return map.getType(BORDER_TOP_COLOR) == ReadableType.Number + && map.getInt(BORDER_TOP_COLOR) == Color.TRANSPARENT; case BORDER_BOTTOM_COLOR: - return !map.isNull(BORDER_BOTTOM_COLOR) + return map.getType(BORDER_BOTTOM_COLOR) == ReadableType.Number && map.getInt(BORDER_BOTTOM_COLOR) == Color.TRANSPARENT; case BORDER_WIDTH: return map.isNull(BORDER_WIDTH) || map.getDouble(BORDER_WIDTH) == 0d; diff --git a/packages/rn-tester/js/examples/PlatformColor/PlatformColorExample.js b/packages/rn-tester/js/examples/PlatformColor/PlatformColorExample.js index bdf72dce4bcc6a..ded5ba1f990687 100644 --- a/packages/rn-tester/js/examples/PlatformColor/PlatformColorExample.js +++ b/packages/rn-tester/js/examples/PlatformColor/PlatformColorExample.js @@ -214,6 +214,7 @@ function FallbackColorsExample() { style={{ ...styles.colorCell, backgroundColor: color.color, + borderColor: color.color, }} />