question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[CardView] rippes on click do not fill the corner

See original GitHub issue

Description: I’ve changed the shapeAppearance of a CardView to a style which alters the edges. When clicking the card, the ripples do not reach the very edge anymore. It’s ending in a rectangle without any shaped corners.

image

Expected behavior: The ripples should reach the edges just like they do when I don’t change the shapeAppearance.

image

Source code:

<com.google.android.material.card.MaterialCardView
    style="@style/NoCornerBottom"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
<style name="NoCornerBottom" parent="">
        <item name="shapeAppearance">@style/ShapeAppearance.NoCornerBottom</item>
    </style>

<style name="ShapeAppearance.NoCornerBottom" parent="ShapeAppearance.MaterialComponents.MediumComponent">
    <item name="cornerSizeBottomRight">0dp</item>
    <item name="cornerSizeBottomLeft">0dp</item>
</style>

Android API version: minSdkVersion 21, targetSdkVersion 28

Material Library version: 1.1.0-alpha08

Device: Pixel 3 with Android Q Beta 4

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ymariancommented, Jul 16, 2019

Awesome that was my guess, If you ran into problems with images or something inside the card you will have to implement the suggested workarounds until we bake the fixes into CardView

0reactions
hardysimcommented, Jul 16, 2019

Ok, no changes needed - MaterialCardView works just fine.

It was my fault of having the actual clickable item inside the card with its own background (which was the plain rectangle on the screenshots). Removing this and just let the card do it’s thing resolves my problem.

Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ripple effect on Android Lollipop CardView - Stack Overflow
Works on lollipop with ripple effect but only gives solid color when run on older platforms. Good enough for me :) ... Working...
Read more >
Cards - Material Design
When a card is checked, it will show a checked icon and change its foreground color. There is no default behavior for enabling/disabling...
Read more >
CardView using RecyclerView in Android with Example
For creating a Card Layout navigate to the app > res > layout > Right-Click on it > New > Layout Resource File...
Read more >
Manage your digital assets using Experience Manager Assets
Click Create. Your folder is displayed in the digital assets folder. The following (space-separated list of) characters are not supported: asset ...
Read more >
Card | Angular Material
The <mat-card> element itself does not add any padding around its content. This allows developers to customize the padding to their liking by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found