Skip to content

Commit c0de00c

Browse files
dsn5ftafohrman
authored andcommitted
Fix MaterialShapeDrawable bug that causes compat shadows to be drawn for round rects on lollipop+
PiperOrigin-RevId: 235786787
1 parent 168a468 commit c0de00c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/java/com/google/android/material/shape/MaterialShapeDrawable.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,8 @@ public void setShadowRadius(int shadowRadius) {
623623
* 21 or when the shape is concave.
624624
*/
625625
private boolean requiresCompatShadow() {
626-
return VERSION.SDK_INT < VERSION_CODES.LOLLIPOP || !path.isConvex();
626+
return VERSION.SDK_INT < VERSION_CODES.LOLLIPOP
627+
|| (!drawableState.shapeAppearanceModel.isRoundRect() && !path.isConvex());
627628
}
628629

629630
/**

0 commit comments

Comments
 (0)