diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java b/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java index ed998e608018..f4b59e3551ea 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java @@ -338,6 +338,10 @@ private void drawRoundedBackgroundWithBorders(Canvas canvas) { } final RectF borderWidth = getDirectionAwareBorderInsets(); + int colorLeft = getBorderColor(Spacing.LEFT); + int colorTop = getBorderColor(Spacing.TOP); + int colorRight = getBorderColor(Spacing.RIGHT); + int colorBottom = getBorderColor(Spacing.BOTTOM); if (borderWidth.top > 0 || borderWidth.bottom > 0 @@ -346,12 +350,16 @@ private void drawRoundedBackgroundWithBorders(Canvas canvas) { // If it's a full and even border draw inner rect path with stroke final float fullBorderWidth = getFullBorderWidth(); + int borderColor = getBorderColor(Spacing.ALL); if (borderWidth.top == fullBorderWidth && borderWidth.bottom == fullBorderWidth && borderWidth.left == fullBorderWidth - && borderWidth.right == fullBorderWidth) { + && borderWidth.right == fullBorderWidth + && colorLeft == borderColor + && colorTop == borderColor + && colorRight == borderColor + && colorBottom == borderColor) { if (fullBorderWidth > 0) { - int borderColor = getBorderColor(Spacing.ALL); mPaint.setColor(ColorUtil.multiplyColorAlpha(borderColor, mAlpha)); mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeWidth(fullBorderWidth); @@ -366,11 +374,6 @@ private void drawRoundedBackgroundWithBorders(Canvas canvas) { canvas.clipPath(mOuterClipPathForBorderRadius, Region.Op.INTERSECT); canvas.clipPath(mInnerClipPathForBorderRadius, Region.Op.DIFFERENCE); - int colorLeft = getBorderColor(Spacing.LEFT); - int colorTop = getBorderColor(Spacing.TOP); - int colorRight = getBorderColor(Spacing.RIGHT); - int colorBottom = getBorderColor(Spacing.BOTTOM); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { final boolean isRTL = getResolvedLayoutDirection() == View.LAYOUT_DIRECTION_RTL; int colorStart = getBorderColor(Spacing.START);