material-components-android
material-components-android copied to clipboard
[MaterialCardView] Card content should be clipped when shapeCornerFamily = cut
shapeCornerFamily = rounded (correct behavior) |
shapeCornerFamily = cut (incorrect behavior) |
---|---|
![]() |
![]() |
Material Library version: 1.7.0-alpha03
Device: Pixel 4 API 31
FYI we have a duplicate report/request before: https://github.com/material-components/material-components-android/issues/1950
I'll try to see if the latest suggestion posted in that issue works. : ) (It may have certain API level restrictions, not sure.)
I don't think it's a duplicate.
In #1950, the author asks that the card "be cut from all corners without clipping the content". Maybe there was some problem with this before, but now he can set the paddings for the content using the setContentPadding
method.
In this issue, I ask that cut
clip the content by default, just like rounded
does, because the current behavior of MaterialCardView with cut
is confusing; it differs from the behavior of other Material views, setContentPadding
stops working as a method that "sets the padding between the Card's edges and the children of CardView", and if cornerFamily
is cut
, there is no way to create a card with image content in Material style without using various tricks.