Skip to content

Commit

Permalink
fix(android): roundBorder fix for Android 12+ (#13283)
Browse files Browse the repository at this point in the history
  • Loading branch information
m1ga committed Mar 21, 2022
1 parent a1c8edf commit 7628a5c
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.graphics.RectF;
import android.os.Build;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewOutlineProvider;
Expand Down Expand Up @@ -104,12 +105,12 @@ protected void onDraw(Canvas canvas)
canvas.drawPath(outerPath, paint);

// TIMOB-16909: hack to fix anti-aliasing
if (backgroundColor != Color.TRANSPARENT) {
if (Build.VERSION.SDK_INT < 31 && backgroundColor != Color.TRANSPARENT) {
paint.setColor(backgroundColor);
canvas.drawPath(innerPath, paint);
}
canvas.clipPath(innerPath);
if (backgroundColor != Color.TRANSPARENT) {
if (Build.VERSION.SDK_INT < 31 && backgroundColor != Color.TRANSPARENT) {
canvas.drawColor(0, PorterDuff.Mode.CLEAR);
}
} else {
Expand Down

0 comments on commit 7628a5c

Please sign in to comment.