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
2
votes
5 answers

CardView with a fixed amount of children

I want an Activity that shows exactly four cards (never more or less) with the same layout as you can see in the image below. Can I implement this without using the, imo rather complex, RecyclerView and without the just copy & pasting xml four…
leonheess
  • 16,068
  • 14
  • 77
  • 112
2
votes
2 answers

Android drag elevation translationz on cardview with itemTouchHelper in Recyclerview

i have a problem figuring out how to give cardViews temporarily elevation on drag. I use a recycler view with cardViews and this is my itemtouchhelper: class ListTouchHelper extends ItemTouchHelper.Callback { private final…
2
votes
0 answers

CardView Layout center position in ViewPager

Hey I develop my first Android Application and I struggle with my layout. I have a Carview in my Fragment and the layout is on each device on a other position. I like to have the layout for each device (phones only) in a center position. Pixel -…
Tommotmot
  • 73
  • 10
2
votes
2 answers

RecyclerView not updating after delete/update of a note

PROBLEM - After a note is deleted from second activity, on returning back to first activity(this activity displays notes), changed made to note i.e deleted or edited does not shows change UNLESS the app is restarted and onCreate() method is…
Taseer
  • 3,432
  • 3
  • 16
  • 35
2
votes
1 answer

Getting error Index 0 requested, with a size of 0 in android Sqlite when want to select

I have an android application using SQLite database. I have a CardView and has data like name, cost and description. My CardView has an option menu to input data and update it. When the option menu clicked it will go to another activity. In that…
Anita Tata
  • 53
  • 5
2
votes
3 answers

Recycler view is not attached after navigation

i am developing this app where i have used bottom navigation view. on my home fragment i have used two recycler views.i am fetchiing some data and images to display on home screen fragment. on start of the app the images are visible in both the…
Jimmy
  • 87
  • 2
  • 9
2
votes
1 answer

Android Studio: CardView change function once clicked

I am currently using a CardView as a Start Button in an activity. However once I have clicked the CardView I need the bg color to change along with the text and function to my STOP activity. public class LandingPage extends AppCompatActivity…
user12345
  • 55
  • 7
2
votes
2 answers

ImageView onClick need to click twice to perform an action

I have set up CardView in my app.The card has ImageView on it.I have set up onClickListener on ImageView. But action is performed after clicking twice the ImageView. This is code for CardView:
Sam
  • 39
  • 7
2
votes
0 answers

Horizontal RecyclerView scrolling in Cardview

In my android application I have a vertical RecyclerView with Cardviews. In each Card I have horizontal RecyclerView that can be scrolled if all elements can't be viewed on screen. Example Also I have swipe functionality for deleting cards. So when…
djavid
  • 21
  • 3
2
votes
1 answer
2
votes
0 answers

How to create silde cardview infinity with animation android

How to create silde cardview infinity with animation. like this What's library to recommended ? thanks!
ARR.s
  • 769
  • 4
  • 20
  • 39
2
votes
1 answer

Android cardview change position with drag and drop

I want to make my cardviews inside a fragment(Navigation Drawler) able to change the position in the list with drag and drop. my layout file structure: FrameLayout{ LinearLayout{ cardview_1 card_view_2}}
F. Kaindl
  • 35
  • 10
2
votes
2 answers

Want to add horizontal spacing between cards of CardView in android?

Want to add Spacing between the cards of CardView without using cardUseCompatPadding, How can i achieve that ?
Divya
  • 121
  • 2
  • 11
2
votes
3 answers

Setting CardView elevation programmatically

I do not know if this approach is the best, but I have the following problem: I want a list item (a CardView) in a RecyclerView to be animated when it's button was clicked, so that this button, some other views inside this item and the background of…
Vancore
  • 657
  • 1
  • 9
  • 18
2
votes
1 answer

Clicking CardView instead of Clicking Items Inside

I am using RecyclerView and CardView. I am following the WhatsApp like UI. When the Whatsapp user long presses the Contacts in the Chat Tab of Home Screen it enables the users to select multiple Contacts at the same time. Whatsapp Multiselect I want…