Questions tagged [android-cardview]

CardView is a widget used to show complex lists and cards in your app, it has material design style by default.

CardView is a widget used to show complex lists and cards in your app, it has material design style by default. CardView extends the FrameLayout class and lets you show information inside cards that have a consistent look on any app. CardView widgets can have shadows and rounded corners.

Useful links

2320 questions
25
votes
14 answers

Error inflating class and android.support.v7.widget.CardView

I want to use CardView in my project, but when I run my application, I get the following error. I'm using Eclipse. Error: Error inflating class and android.support.v7.widget.CardView The graphical view of my xml file says 'The following classes…
24
votes
4 answers

Attach custom CardView style to theme

In my app, I have two themes (light and dark), and I want all of my CardViews to change their background color depending on which theme is selected. What I don't want is:
sameetandpotatoes
  • 1,220
  • 3
  • 17
  • 35
24
votes
5 answers

RecyclerView + CardView + Touch feedback

Has anybody solved the mystery of the CardView without touch feedback when it's inside a RecyclerView? I have a RecyclerView with a bunch of CardViews (a CardList). When I click on any CardView, I start another Activity. That's working pretty fine,…
24
votes
5 answers

Remove spacing between items in RecyclerView android

I am using a RecyclerView to show a List of Items and I need to remove the default spacing between Items. I'm trying to set a RecyclerView.LayoutParams and set margins to zero on my LinearLayoutManager but didn't work! Here is my…
23
votes
2 answers

How to add border to card view with jetpack compose

I find the way Border(1.dp, Color.Black) can not work with the border property of Card view, what's the best way to work around of it?
23
votes
3 answers

Toolbar inside CardView to create a popup menu (overflow icon)

I have a list that looks like google play in a recyclerview with cardview, and works perfect. I need to add a popup menu (with overflow icon), like this: which is the best way to do this ? I researched and found that there are 2 options: 1 - with a…
22
votes
1 answer

Collapsing CardView inside RecyclerView when animating

What I'm trying to do I have a CardView with a supporting text on the bottom that is GONE by default. I want to make this section of the card visible only when the user clicks the "action arrow", as shown on the image below: I know I can achieve…
Mauker
  • 11,237
  • 7
  • 58
  • 76
22
votes
4 answers

Android CardView with a custom shadow color

Is it possible to change the color of the shadow around the CardView? Mainly used to mark selected the card as it were lighted on? Should be valid on L and pre-L devices.
Davideas
  • 3,226
  • 2
  • 33
  • 51
22
votes
1 answer

Advantage and disadvantage of CardView

What are the advantages and drawbacks of CardView, other than the shadow or elevation, what is the benefit in performance and looks? What is done using CardView can also be done using a combination of other layouts.
21
votes
6 answers

create view over cardview in android

I want to create this layout this is a cardview (gray view) and imageview(blue view) for that i use this code
max
  • 5,963
  • 12
  • 49
  • 80
21
votes
3 answers

Cardview with dividers in it

I've seen those CardViews (I'm not sure they're even CardViews) with dividers used in a lot of apps, so I'm guessing there is an easy way to create them. I wanted to ask how is it exactly done? are those even CardViews? I couldn't find out more…
20
votes
1 answer

RecyclerView with FloatingActionButton

I have an activity that has a RecyclerView (optionally in a CardView) and a FloatingActionButton I want the FAB to be always on screen at the bottom right, but when I scroll to the end of the RecyclerView, the FAB is hiding part of the content on…
20
votes
1 answer

Recycler view click animation

I'm trying to add some click animation as shown here to my recycler view but unsuccessfully. Here's some of my code. Inside my Activity @Override protected void onCreate(Bundle savedInstanceState) { ... mRecyclerView = (RecyclerView)…
20
votes
6 answers

Cardview corner background not transparent

I have a custom implementation of a CardView support widget but I can't seem to get the background for the corners transparent when I include it in my layout-file. However, if I simply place the CardView support widget in my layout-file it suddenly…