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
20
votes
3 answers

Android Material default colors

I want to have colors for specific card states. I want to be able to reset it to its default. Where can I find the default material colors from Android? Especally of the Android CardView. Thanks for help. Edit: The Cards have an backgroundcolor (not…
R00st3r
  • 954
  • 1
  • 10
  • 31
20
votes
2 answers

How to create a card toolbar using appcompat v7

I want to create a toolbar like the following image as proposed in the material design guidelines: I can achieve this via using the toolbar with an relative layout:
20
votes
6 answers

Importing CardView and RecyclerView (Android 5.0) in my existing project (eclipse)

I want to import CardView and RecyclerView in my existing project. I am using ECLIPSE. I read other answers in stackoverflow but all of them are for Android Studio. ve Can anyone please help me ? The error I am receiving is : CardView cannot be…
19
votes
4 answers

Setting margin programmatically to CardView

I have a CardView in my XML layout and I need to set margins to it programmatically (This is because I don't need margin at all times. Based on few conditions, I either set or remove the margin). Here's how I did it: CardView.LayoutParams…
19
votes
7 answers

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

The issue I am having is basically what is found in this answer but I will still explain below. I am testing on a device with android 5.0.1 and another with 4.2.2. On my device with 5.0.1 I get no errors and everything behaves as expected. On my…
ez4nick
  • 9,756
  • 12
  • 37
  • 69
19
votes
3 answers

How to enable CardView in ViewPager

I have tried using CardView in ViewPager and everytime I swipe left/right on CardView it goes to the next screen. I want the card to delete itself then. Currently as a standalone both are working fine but when I combine then only viewpager is…
jason
  • 3,932
  • 11
  • 52
  • 123
18
votes
4 answers

Shared Element Transition on CardView with radius

I've been working on this problem for weeks and I'm still unable to solve this problem. So, I have a CardView that contains a LinearLayout with an ImageView. Without that radius Shared Element Transition works seamlessly. However, when I add…
17
votes
5 answers

Android - CardView elevation shadow make darker

I am using 'com.android.support:cardview-v7:23.4.0' and I see the shadow but is not a dark grey shadow, and I would like to get a darker elevation shadow, but I do not see any attribute to get it, any ideas?
Billyjoker
  • 729
  • 1
  • 10
  • 31
16
votes
2 answers

Android: how can I insert a RecyclerView inside CardView?

The activity I am talking about must show a RecyclerView populated by CardViews as items. My goal is to show in every CardView a RecyclerView in its turn. Here my Activity's basic xml:
16
votes
6 answers

"Failed to find style with id 0x7f070001 in current theme" when using CardView android L (api 21)

I just downloaded and started learning android L material design api. Whenever I use CardView in my activity it gives me this error Failed to find style with id 0x7f070001 in current theme. This is my xml layout :
Nikhil Jain
  • 193
  • 1
  • 8
16
votes
7 answers

Error when adding CardView to layout

I wanted to try out the new toys that google gave us and I've run into some trouble. Here is my build.gradle: apply plugin: 'com.android.application' android { compileSdkVersion 'android-L' buildToolsVersion "20.0.0" defaultConfig { …
trickedoutdavid
  • 868
  • 2
  • 8
  • 12
15
votes
3 answers

RecyclerView items don't fill width

I have designed a layout with map fragment and recyclerView. Each recyclerView item is cardview (I have specified give the xml layout). The problem is RecyclerView item doesn't fill screen width. img here I tried to change layout_width to…
thien.vpt
  • 168
  • 1
  • 1
  • 8
15
votes
1 answer

RecyclerView with different Cardlayouts

What I'd like to do At the moment I'm playing around with RecyclerView and CardView's. For now I wrote a RecyclerView.Adapter on which I can display the same CardView multiple times with different content - analog to the ListView with a…
safari
  • 7,565
  • 18
  • 56
  • 82
14
votes
4 answers

Different corner radius values for a MaterialCardView

Is is possible to have different values for each corner radius of a MaterialCardView? And if so how? I tried something like the code below but it doesn't seem to have any effect float radius =…
14
votes
2 answers

Expand/collapse animation in CardView

I try to do something like this : I managed to do my cardViewAdapter but I block to enlarge my cards. I resumed the code of this response (Here the name of the class is : CardsAnimationHelper) to do the animation but it's superimposed. Before…
filol
  • 1,669
  • 1
  • 15
  • 38