Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

0 votes
0 answers
22 views

Set the same elevation for all cards in recyclerview kotlin

I'm using this card xml in my item for recyclerview and it looks like the shadow increases when the position comes more down, but I want to make it one for all of them <com.google.android.material....
Mohamed Anwer's user avatar
0 votes
1 answer
71 views

Make TextView with drawable expand inside CardView

I'm trying to make a TextView that contains a text and a drawable expand/scale based on the size of the TextView. My current code: <?xml version="1.0" encoding="utf-8"?> <...
Andy's user avatar
  • 320
4 votes
2 answers
1k views

MaterialCardView with top rounded corners should clip children

MaterialCardView clips its children when using rounded corners. If I use cardCornerRadius = true (which rounds all 4 corners of the card), the clipping behaves as expected -> children are not being ...
DoruAdryan's user avatar
  • 1,334
1 vote
1 answer
2k views

Jetpack compose: elevate card from bottom

I was implementing Card shape in Jetpack Compose while I ran into this problem. What I wanted was to only elevate one end or bottom of the card but I didn't find any relevant documents supporting that....
Mr. Techie's user avatar
1 vote
1 answer
1k views

Material Card View Change Ripple Color

I am having a Material Card View in android studio and when i click on it its having the default gray black ripple can i change the ripple color to something else for example colorPrimary. Below is my ...
Emmanuel Njorodongo's user avatar
0 votes
1 answer
2k views

How to add background image to MaterialCardView correctly

This is initial effect.Just as show ,the cornerFamily of MaterialCardView is cut.It's so beautiful. I set the background by binding.root.background = resource I want to add background to ...
pnkj's user avatar
  • 478
1 vote
1 answer
3k views

Unknown bits set in runtime_flags: 0x28000

I made a simple app using Cards in Material Components in Android. When I try to run it in my "OnePlus AC2001" mobile, I'm getting this error in logcat. 2021-01-31 17:28:59.544 26933-26933/? ...
Light Yagami's user avatar
  • 1,012
1 vote
0 answers
218 views

MaterialShapeDrawable makes my CardView invisible on API 28 and below

I'm using this piece of code to give some shape to my cardview, fun getBottomCutBackground(activity: Activity): MaterialShapeDrawable { val bottomCut = ShapeAppearanceModel() .toBuilder() ...
Emre Akcan's user avatar
  • 1,100
2 votes
5 answers
3k views

How Can I create a Circular CardView in Android?

i'm trying to create a circular CardView. But I don't know how to do it. Is there any attribute with which I can get a Circular CardView?. The XML code is the following: <android.support.v7.widget....
Salman khan's user avatar
4 votes
1 answer
1k views

Problem with changing the radius of corners in MaterialCardView

I’m trying to disable the bottom corner rounding of MaterialCardView, but after applying it, all corners lose their rounding. mainCard.shapeAppearanceModel = mainCard.shapeAppearanceModel....
Ruslan's user avatar
  • 43
2 votes
3 answers
4k views

How to change background color of CardView depending if is selected or not?

I'm trying to change the color of a CardView depending if is selected or not I tried this, this is my card_view_color.xml: <?xml version="1.0" encoding="utf-8"?> <selector ...
haagantos's user avatar
1 vote
1 answer
660 views

how to create triangle gap on cardview?

how can I create a triangle gap on the bottom of a cardview like this in android studio?
Mohammad Mirdar's user avatar
1 vote
1 answer
1k views

CardView Radius and Drawable Shape Radius are not same

I have below layout that has a CardView <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" ...
musooff's user avatar
  • 6,692
3 votes
1 answer
2k views

Cannot inflating MaterialCardView

I get the following error : E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.mainapp, PID: 21456 android.view.InflateException: Binary XML file line #11: Binary XML file line #...
Singa's user avatar
  • 371
4 votes
1 answer
2k views

MaterialCardView with MaterialShapeDrawable

I want to achieve this: So I thought I could use a MaterialShapeDrawable to apply that transformation: binding.card.background = MaterialShapeDrawable( ShapeAppearanceModel.builder() ....
GuilhE's user avatar
  • 11.8k

15 30 50 per page