Questions tagged [cardview]

CardView is a widget for implementing 'card-styled' views in Android.

In Android, a card is a self-contained view similar to Android's FrameLayout (in fact CardView extends FrameLayout) which gives you the possibility of setting up an high contrast between the card and the background through elevation, thus generating more immersive apps.

CardView is often used in combination to RecyclerView. Usually, you would have multiple cards and use the RecyclerView as a container for scrolling between them.

You can read more about cards and recycler view here: https://developer.android.com/training/material/lists-cards.html

568 questions
41
votes
3 answers

What's the difference between the CardView from com.google.android.material and android.support.v7.widget

I'd like to know the difference between both widgets android.support.v7.widget.CardView which is added using Android Studio IDE components palette and com.google.android.material.card.MaterialCardView which is used on Material Design…
39
votes
1 answer

How to change card_view:cardCornerRadius programmatically

In my project, I am using RecyclerView in my listing using CardView. In my listing I have to set the corner radius of CardView dynamically based on device. Is there any way to set cardview corner radius value dynamically? Thanks.
Faisal Ahsan
  • 928
  • 1
  • 12
  • 22
27
votes
4 answers

How to add shadow on CardView aligned to bottom of parent

I have a CardView aligned bottom to screen, destpite the elevation I want to add more shadow to top of the CardView. I've tried with android:shadowColor="#000" android:shadowDx="0" android:shadowDy="30" android:shadowRadius="50" But see no…
Stefanija
  • 1,388
  • 2
  • 12
  • 25
25
votes
6 answers

CardView bottom border is cut off inside ScrollView android

I am putting the cardview inside scrollview, we expect to see that at the bottom, the border should be shown(see pic below). But its not. The problem is that I cannot scroll to the bottom to see the border of cardview. All the solutions on SO is to…
Cheng
  • 775
  • 2
  • 12
  • 28
12
votes
2 answers

Space Between CardView

I need to add space between CardView. I tried to use the card_view:cardUseCompatPadding and it doesn't work. Any help?
user6730398
  • 163
  • 1
  • 1
  • 6
11
votes
3 answers

RecyclerView overlapping without shadow

I want to develop List like this picture I had used to RecylerView ItemDecorator for overlap. But it's overlapping without shadow. the screen & decorator code is below public class OverlapDecoration extends RecyclerView.ItemDecoration { private…
Elango
  • 412
  • 4
  • 24
11
votes
3 answers

Scrollable CardView with RecyclerView inside

I would like to implement a screen where I have a Card view containing a RecyclerView. The CardView should of the same height of the content of the recycler view, this means that if the RecyclerView has few item, I should see the bottom corners and…
pdegand59
  • 12,776
  • 8
  • 51
  • 58
9
votes
5 answers

android cardview showing border around card

Android cardview is showing unnecessary border around the card. I have tried different things but I am not able to remove it. It happens when I give the card a custom background color. When I remove the cardBackgroundColor, and when default is used.…
Rakesh Yadav
  • 1,966
  • 2
  • 21
  • 35
8
votes
2 answers

how to make an expandable list of cardviews?

I searched a lot to find a direct and clear solution for I think a popular problem but unfortunately I couldn't find it. We want to have a list of cardviews so each card bind to a specific data and each card has a list inside that shows meta or…
7
votes
3 answers

Onclick doesn't get triggered on CardView

I have an OnClickListener on a CardView. The listener only works when I tap on a region outside the content(TextViews/ImageViews). I also have a linear layout inside my CardView. I wanted it to work when I tap anywhere on the CardView. Is there a…
Nick.K
  • 320
  • 6
  • 11
7
votes
1 answer

Custom your ImageCardView style ( not the content )

How can I custom the ImageCardView to be circular in Leanback?
ArolaAb
  • 297
  • 3
  • 12
6
votes
1 answer

CardView background blur and transparent? Android Studio

I'm trying to make this: and this is what I'm getting: I can't make the background blur and transparent at the same time, how could I do that? when I try to do it with "alpha" it removes opacity in the text as well, which does not happen in the…
Kondos
  • 153
  • 2
  • 11
6
votes
3 answers

Curved android toolbar with shadow

I need to have a curved bottom view for Toolbar or CardView. What I've tried: bg_toolbar.xml
6
votes
2 answers

Cardview elevation is not working with androidx artifacts

My card view elevation stopped working and showing shadow after I updated my android studio 3.3 and migrating my project to androidx artifacts.
user10945815
  • 61
  • 1
  • 5
6
votes
4 answers

Android CardView center horizontally

I have read several answers on how to align a card view horizontally. I am trying to achieve the following: Desired Result This is so far the code I have written (I have followed around 20 answers from different posts, none which have helped me. The…
Samuel Navarro
  • 61
  • 1
  • 1
  • 2
1
2 3
37 38