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
79
votes
4 answers

Why there is no space between CardViews on Lollipop?

I try to use the CardView and it works well below 5.0, but looks strange on Lollipop.
cajsaiko
  • 1,017
  • 1
  • 8
  • 15
75
votes
7 answers

Pull to refresh recyclerview android

Hi I've a tabbed activity, and in the first tab I fetch data from server and show it in a recyclerview within card views. For fetching the data from server I use the volley library. I want to implement the Pull to refresh to load the data (so…
74
votes
12 answers

Margin between items in recycler view Android

Hi I am Following this tutorial: http://www.journaldev.com/10024/android-recyclerview-and-cardview-example-tutorial Now I am facing a weird issue the margin between each CardView item inside RecyclerView is way too much. ISSUE How to reduce…
Tushar Narang
  • 1,997
  • 3
  • 21
  • 49
74
votes
13 answers

Make ImageView fit width of CardView

I have a CardView with rounded corners, I want to have an ImageView at the top like shown in the example taken from the material design guidelines below.
Dan
  • 3,879
  • 5
  • 36
  • 50
73
votes
13 answers

How do I get the position selected in a RecyclerView?

I am experimenting with the support library's recyclerview and cards. I have a recyclerview of cards. Each card has an 'x' icon at the top right corner to remove it: The card xml, list_item.xml:
70
votes
3 answers

How to add a recyclerView inside another recyclerView

I'm planning to develop an app that shows some dynamic data inside a recyclerCardView. So i decided add a recyclerView called CheckBoxRecyclerView inside my main recyclerView. This is my code for my app : My Main Activity…
Mohammad Fatemi
  • 1,278
  • 2
  • 12
  • 16
68
votes
5 answers

Android-L CardView Visual Touch Feedback

could anybody explain to me how to implement some of the visual touch feedback that was demonstrated at Google I/O 2014 within a CardView. Here is how I am using the CardView in XML, there is probably something small that I am missing, so I just…
Smiler
  • 1,316
  • 4
  • 12
  • 18
67
votes
10 answers

Touch feedback with RecyclerView and CardView

I would love to enable touch feedback for my Open-Source library. I've created a RecyclerView and a CardView. The CardView contains different areas with different onClick actions. Now I would love to trigger the Ripple effect if a user clicks…
62
votes
12 answers

Using android.support.v7.widget.CardView in my project (Eclipse)

I'd like to use the new CardView widget that was introduced with the new Android L Developer Preview Support Library (As mentioned here), which seems to be part of a new revision of the v7 support library. I have now updated my SDK version,…
FD_
  • 12,947
  • 4
  • 35
  • 62
60
votes
9 answers

CardView background color states not being respected

In brief: How can we define color states of CardView's cardBackgroundColor property (in a ListView layout, in this case)? (I am using RC1 of Android L developer preview, on a phone with 4.4 installed, and…
mmm111mmm
  • 3,607
  • 4
  • 27
  • 44
56
votes
4 answers

How to put a CardView attribute in a style?

I have: in a file build.gradle (dependencies) dependencies { compile 'com.android.support:cardview-v7:21.0.+' } in a file styles.xml (styles definition)
Alexander Kulyakhtin
  • 47,782
  • 38
  • 107
  • 158
52
votes
5 answers

RecyclerView 2 Columns with CardView

I have a problem with my layout. I'm trying to do something like this: For now, i have a RecyclerView with a CardView inside it. in the CardView I have put an ImageView and a TextView but I don't know why but the CardView is more height than…
51
votes
5 answers

Android CardView remove padding

how do I get rid of this strange padding in the layout below:
Ivan Fazaniuk
  • 1,062
  • 3
  • 11
  • 26
51
votes
6 answers

android.graphics.drawable.ColorDrawable cannot be cast to android.support.v7.widget.RoundRectDrawableWithShadow

I tried to use CardView in my Application which worked pretty good within my xml Layout. Since I want to generate them in my code and not via xml I tried to set the radius with CardView.setRadius()-Method as suggested by Android Developers…
D4ddy
  • 727
  • 2
  • 11
  • 23
48
votes
9 answers

Changing CardView shadow color

This question was asked on SO many times, but still I didn't find a good solution for this problem. Why do I need this to do? Well because project me and my team develops has iOS style. What did I try? 9.pathch shadow generator but 9.pathes are…