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

How to set equal space between CardViews in RecyclerView?

I have some CardViews in my RecyclerView, and when I want to set space between them by adding margin, I get this: As you can see, distance between cards is double. If I for example set margin just for top, left, and right, problem is solved but…
Arantik
  • 584
  • 8
  • 17
3
votes
1 answer

How to Create CardViews Dynamically in Android

I've been trying to get an app idea of mine to come to fruition for some time now. The idea is a weather app in which users can choose the content they want to see, and it is represented by cards (CardViews). For example, if they want to see only…
3
votes
2 answers

Anko CardView radius not work

I want to create cardView with anko and set cornerRadius param to it. But When I try to do - no such differents come. In main class I do this: override fun onCreateView(inflater: LayoutInflater, container: ViewGroup): View { …
alena_fox_spb
  • 697
  • 1
  • 8
  • 24
3
votes
0 answers

ExpandableRecyclerview Inside a Cardview Recyclerview

I am totally familiar with ExpandableRecyclerview Or ExpandableLayout But I have a design that is a little bit unique and I am seeking help to achieve this implementation. I Am Attaching the design When the user clicks the arrow shown in the image…
3
votes
1 answer

I'm trying to give elevation to corners of cardview

I'm trying to provide elevation to the corners of cardview. my requirement is elevation should n't effect at the middle of cardview. it should effect only corners like image shown below. As shown in image, at the middle of the cardview elevation…
3
votes
2 answers

How to display latest post on top instead of bottom in recyclerview / cardlayout in firebase android?

I am totally new to Java and Firebase, working in a college project. Making something like an ecommerce app but not literally (somewhat similar). To the point, my newly inserted data are at bottom as default, I need to get them at the top. Tried…
3
votes
2 answers

CardView - Adding cuts on left and right side with shadow

I have to get this type of card design with semi-circle on both side of cardview along with shadows on both card view and semi-circles. Thanks in advance.
Anukool srivastav
  • 807
  • 1
  • 12
  • 20
3
votes
3 answers

Create a CardView with a semicircle on top

I am very much into designing a login screen. Something like this: How Do I actually cut the card from the top so as to fill the drawable on top of it? Any help would be of great value. [Source: https://www.uplabs.com/posts/login-android-app/]
mrLovaLova
  • 187
  • 2
  • 14
3
votes
1 answer

Persist corner radius of a CardView on setting background of a layout inside that CardView

I've a CardView with some corner radius inside which are three relative layouts. When I set background of the layout whose top is aligned with the top of CardView, corner radius is lost. How to keep corner…
Arsal
  • 565
  • 2
  • 8
  • 17
3
votes
2 answers

Remove CardView shadow from one side

According to my app ui requirement it's need plain side on top of cardview so, it need to remove shadow from upper side and touch to another view. I tried card_view:cardElevation="0dp" but it removed shadow from all side, so it's not useful to…
Yog Guru
  • 2,074
  • 3
  • 28
  • 47
3
votes
1 answer

Some white blocks appear in the activity after the webview load data

I develop the activity in android 7.0 OS, and some times the white blocks appear in the status bar and navigate bar. Who can help me to fix it. Normal activity on left, activity with white blocks on right:      This is my…
Kingyal
  • 63
  • 8
3
votes
3 answers

CardView doesn't work properly

I have a work with the RecyclerView, and I use the CardView as well.I have made all these standards procedures (created the ViewHolder, implemented necessary methods) but the problem is that CardView's corners aren't rounded.I get only rectangular…
3
votes
0 answers

How can I transition from a cardview to a dialog fragment?

I am trying to create an animation transition from a cardview to a dialog fragment. The goal is for the cardview to "grow" into the full dialog fragment. I have experimented with shared element -- however -- because we are using ft.add instead of…
Android Ninja
  • 811
  • 1
  • 6
  • 9
2
votes
3 answers

Jetpack Compose - CardView with Arc Shape on border

I'm trying to achieve the below card view arc shape on the card view border/stroke. Already tried to search on google but didn't find any relevant answer that suits with requirements. Any lead or help will be appreciated.
Swapnil Musale
  • 182
  • 1
  • 15
2
votes
1 answer

How to set cardView Gravity in RecyclerView Programatically

I'm trying here to set the layout gravity of certain elements in recycler view to RIGHT so i did this in the recycler view adapter @Override public void onBindViewHolder(@NonNull MessagesViewHolder holder, int position) { Message message =…