[MaterialCardView] Unwanted border around cardview when having different border radii
See original GitHub issueDescription: When changing the Shape of a Material Card to include only 2 rounded borders, there is an additional ~2dp border around the card that clips over content.
See screenshot: https://i.imgur.com/kES7C2W.png
Expected behavior: No border would be there. If all borders are rounded/not rounded, this does not happen
Source code:
<style name="ShapeAppearanceOverlay.MyApp.MaterialCardView" parent=""> <item name="cornerFamily">rounded</item> <item name="cornerSizeTopLeft">8dp</item> <item name="cornerSizeTopRight">8dp</item> <item name="cornerSizeBottomLeft">0dp</item> <item name="cornerSizeBottomRight">0dp</item> </style>
Android API version: 29
Material Library version: 1.2.0-alpha03
Device: Nexus5, Google Pixel, Samsung S7
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:10 (3 by maintainers)
Top GitHub Comments
Setting android:outlineProvider=“none” fixed the issue for me
Hi @kelmer44, thanks for providing the info. After trying your layout and style, I don’t think I fully understand your issue. But here are something I found.
ShapeAppearanceOverlay.MyApp.MaterialCardView
toapp:shapeAppearance
instead ofstyle
to make it take effect.app:cardPreventCornerOverlap
tofalse
inMaterialCardView
to disable it.