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 @@ -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
Expand All @@ -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);
Expand All @@ -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);
Expand Down