CardView in RecyclerView Android Studio Kotlin Tutorial

preview_player
Показать описание
How to nest CardView inside RecyclerView using Grid Layout. Implement CardView OnClick to open a new activity and show a detail view.

In this example beginner programming project we build a book catalogue app using card view inside a recycler view.

This Kotlin tutorial is built using view bindings in Android Studio Arctic Fox.

CardView Source Code:

⏱️ TIMESTAMPS ⏱️
00:00 - RecyclerView CardView
00:26 - Modify Android App Colors Themes
01:03 - Recycler, Card View Layout XML
03:34 - Enable view bindings in Build Gradle
03:53 - CardView Kotlin
07:17 - Implement On Click Listener
09:39 - Testing Books App

#CardViewTutorial #LearnAndroidStudio #AndroidUI
Рекомендации по теме
Комментарии
Автор

I just have to say this tutorial was really helpful. Obviously I had to adapt it to my own context and pause and rewind the video a tonne, but after a few days of wrestling with it I have got something I'm now happy with thank you!

lukeunderhill
Автор

Thank you Cal Sir . This video is very helpful for us.

mysgrown
Автор

Thank you, this tutorial was very helpful

ddzkkrj
Автор

Thanks for the video helped me solve something quickly. I still need to work on the recycler view from loading new cards everytime. This causes some duplication on the recycler view.

seanrileyhawkins
Автор

Is there a way to change the string colors based on what is read? For example if you had 2 of the same authors in the list, can you code the recycler to change the text color to blue?

clintb
Автор

Hey Cal great tutorial. Thank you! I was wondering if you could help me out. How would I allow the user to pick an image from their phone's gallery into the card view (I've done this already) but I want to be able to save these images and re-load them when the app re-starts. I can't find that info anywhere. I tried SharedPreferences it works for text but I haven't been successful with images. (btw I only have a max. of 6 images in my app) Your help would be greatly appreciated. Thx so much!

myimac
Автор

Hello, thanks for the video :)
Do you know why / how to prevent the cards from duplicating when pressing back and reopening the app? (or also while changing from dark to light mode while the app is open).

Fixed it for now clearing the list (that we populate in onCreate) in onBackPressed but it doesn't seem like the best idea to empty and re-populate the list, or am I wrong?

Lucdre
Автор

hello thanks for the video, how can we fetch the data from MySQL db

trukazz
Автор

sorry if i'm missing something, but where was the cardCellBinding written? couldn't find it, even though it's required around 5:21.

Armadeus
Автор

Hello, thanks for the video and I have try it, but first time I do it with your tab view tutorial first and success and then i try to combine this recycler view with tab bar view but unfortunately after combining, i found that my page for listing all the book cannot slide down for viewing more book. Did i have any solution for that?

heijun
Автор

Good job ! A little too fast-paced for me, though, even at .75 speed XD

DarokCx
Автор

I plan to use the code..in an app...tips and suggestions on what we should take care of will be useful... also I am trying to include a searchview...any tips on this/?

defencemanufacturingindia
Автор

tell me which property is responsible for the number of columns

loleria
Автор

Hello Cal! Your video's helping me so much. I'm trying to do the same example with some contacts but a strange reason it doesn't show me the information from the First Activity to Second Activity that I have in my contacts list :'(

astridguerreron
Автор

Hello, the video helped me a lot, I have a question in case I have a lot of text, the part of the description, how do I scroll down and keep reading, because it won't let me slide down

yerkolopez
Автор

can you show us how to get data from API in this CardView in RecyclerView

nishilraiyarela
Автор

Hi, I have a little issue, every time a click on a book it send the same ID for all, any clue what can be going wrong

LaboratoriodeInteractividad
Автор

actuallly its to good, but maybe next time u need to explain a video without urge to pee 😂 its too fukeeng fast broo 🙃

hanaanaulia
Автор

Why recycleview have to be so complicated ? Python is much simpler.

azizrimi
welcome to shbcf.ru