Material-components-android: [MaterialCardView] Setting EdgeTreatment on shapeAppearanceModel of MaterialCardView hides the card view content

Created on 12 Sep 2019  路  5Comments  路  Source: material-components/material-components-android

Description: Adding EdgeTreatment (using setLeftEdge/setRightEdge/setTopEdge/setBottomEdge/setAllEdges) on shapeAppearanceModel of the MaterialCardView hides the content of that card view

Expected behavior:
Expected

Actual behavior:
Actual

Source code: https://github.com/muthuraj57/MaterialCardView_Render_Issue

Android API version: Android 10 (29)

Material Library version: 1.1.0-alpha10

Device: Google Pixel 2 xl

P3 bug

All 5 comments

Expected behavior is actually the blend of both the screenshots(with the content and the cut out).

Thanks for the report until we fix it you can do this after changing the shape appearance.

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    cardView.getChildAt(0).clipToOutline = false
}

@ymarian Thanks the workaround works perfectly fine.

Note:

After https://github.com/material-components/material-components-android/commit/0f8fa7e6c9f7e44407c4bde0a6e800c17c2781e6

The work around now is:

cardView.clipToOutline = false

We should get this addressed soon though.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jaychang0917 picture jaychang0917  路  3Comments

mnayef95 picture mnayef95  路  3Comments

JakeWharton picture JakeWharton  路  3Comments

TdevM picture TdevM  路  3Comments

MrCreeper1008 picture MrCreeper1008  路  3Comments