CardView in RecyclerView Android Studio Kotlin Tutorial

  Рет қаралды 21,033

Code With Cal

Code With Cal

Күн бұрын

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:
github.com/codeWithCal/CardRe...
⏱️ 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

Пікірлер: 41
@lukeunderhill3907
@lukeunderhill3907 Жыл бұрын
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!
@mysgrown
@mysgrown 2 жыл бұрын
Thank you Cal Sir . This video is very helpful for us.
@user-dd1zk8kr8j
@user-dd1zk8kr8j 2 ай бұрын
Thank you, this tutorial was very helpful
@julianyagoro3531
@julianyagoro3531 Жыл бұрын
Very helpful!
@matheusdelnero135
@matheusdelnero135 Жыл бұрын
Nice video bro! helped me a lot
@burakcanduzcan
@burakcanduzcan 2 жыл бұрын
superb video!
@defencemanufacturingindia7825
@defencemanufacturingindia7825 2 жыл бұрын
Ever thankful.
@CodeWithCal
@CodeWithCal 2 жыл бұрын
You are most welcome 😉
@Armadeus
@Armadeus 8 ай бұрын
sorry if i'm missing something, but where was the cardCellBinding written? couldn't find it, even though it's required around 5:21.
@clintb92
@clintb92 11 ай бұрын
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?
@miguelmoral4760
@miguelmoral4760 2 жыл бұрын
Thanks! 🤠
@CodeWithCal
@CodeWithCal 2 жыл бұрын
😊
@myimac8257
@myimac8257 5 ай бұрын
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!
@Lucdre
@Lucdre 2 жыл бұрын
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?
@CodeWithCal
@CodeWithCal 2 жыл бұрын
I would do something like this. Declare a class variable boolean in the Main activity var firstload = true. then wrap the populateBooks function in something like this if(firstload) { populateBooks() firstload = false }
@seanrileyhawkins4511
@seanrileyhawkins4511 Жыл бұрын
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.
@trukazz
@trukazz Жыл бұрын
hello thanks for the video, how can we fetch the data from MySQL db
@DarokCx
@DarokCx 2 жыл бұрын
Good job ! A little too fast-paced for me, though, even at .75 speed XD
@heijun149
@heijun149 2 жыл бұрын
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?
@CodeWithCal
@CodeWithCal 2 жыл бұрын
Ahh what you are trying to do sounds possible, I wont debug your code. keep trying. :)
@loleria6
@loleria6 10 ай бұрын
tell me which property is responsible for the number of columns
@yerkolopez8142
@yerkolopez8142 2 жыл бұрын
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
@CodeWithCal
@CodeWithCal 2 жыл бұрын
Hi you want to nest the detail view in a scroll view
@yerkolopez8142
@yerkolopez8142 2 жыл бұрын
@@CodeWithCal Yes, since I want to put more text to the description part
@defencemanufacturingindia7825
@defencemanufacturingindia7825 2 жыл бұрын
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/?
@defencemanufacturingindia7825
@defencemanufacturingindia7825 2 жыл бұрын
If you have a forum(blog) page - or here, we can initiate a discussion so that more can participate..
@mrtruthvirtue8752
@mrtruthvirtue8752 2 жыл бұрын
Shall we code with Cal , c'monn!
@astridguerreron2931
@astridguerreron2931 2 жыл бұрын
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 :'(
@CodeWithCal
@CodeWithCal 2 жыл бұрын
Thanks 😊 In this example we pass the objectid via an intent put extra. Is there a bug in your code related to that?
@astridguerreron2931
@astridguerreron2931 2 жыл бұрын
@@CodeWithCal Helloooo!!! I never knew what my app didn't work, but finally I could resolve that bit problem implementing Parcels. That's strange but it works. Thanks so much. I continue watching your videos ;) Happy Halloween!
@CodeWithCal
@CodeWithCal 2 жыл бұрын
Happy Halloween 🎃
@LaboratoriodeInteractividad
@LaboratoriodeInteractividad Жыл бұрын
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
@CodeWithCal
@CodeWithCal Жыл бұрын
Something wrong with the intent put extra or the reading of said extra
@LaboratoriodeInteractividad
@LaboratoriodeInteractividad Жыл бұрын
@@CodeWithCal well It Is weird cos' once i re-ordered the way the list Is filled allá came ordered and go well, thanks for answer
@nishilraiyarela5141
@nishilraiyarela5141 2 жыл бұрын
can you show us how to get data from API in this CardView in RecyclerView
@billal2731
@billal2731 2 жыл бұрын
you can use gson and picasso for the images
@hanaanaulia250
@hanaanaulia250 Жыл бұрын
actuallly its to good, but maybe next time u need to explain a video without urge to pee 😂 its too fukeeng fast broo 🙃
@CodeWithCal
@CodeWithCal Жыл бұрын
Haha personally I not a fan of unnecessarily long tutorials, but its true i do go to fast at times
@kyankey150
@kyankey150 2 жыл бұрын
Thanks for video but you are so fast
@CodeWithCal
@CodeWithCal 2 жыл бұрын
😋
@azizrimi2978
@azizrimi2978 8 ай бұрын
Why recycleview have to be so complicated ? Python is much simpler.
RecyclerView | Everything You Need to Know
25:07
Practical Coding
Рет қаралды 132 М.
RECYCLERVIEW - Android Fundamentals
24:58
Philipp Lackner
Рет қаралды 102 М.
小宇宙竟然尿裤子!#小丑#家庭#搞笑
00:26
家庭搞笑日记
Рет қаралды 15 МЛН
ЧУТЬ НЕ УТОНУЛ #shorts
00:27
Паша Осадчий
Рет қаралды 10 МЛН
No empty
00:35
Mamasoboliha
Рет қаралды 10 МЛН
A teacher captured the cutest moment at the nursery #shorts
00:33
Fabiosa Stories
Рет қаралды 55 МЛН
Web API Android Studio Kotlin Tutorial | REST
10:23
Code With Cal
Рет қаралды 19 М.
Bottom Tab Bar Example Fragments Android Studio Kotlin Tutorial
6:17
RecyclerView in Android Studio using Kotlin | Android Knowledge
12:11
Android Knowledge
Рет қаралды 14 М.
Simple RecyclerView with CardView Tutorials in Android Studio
16:21
6 Design Patterns Every Android Developer Must Know
14:16
Philipp Lackner
Рет қаралды 79 М.
We Built an App in 24 Hours [No Code]
11:56
Raw Startup
Рет қаралды 418 М.
小宇宙竟然尿裤子!#小丑#家庭#搞笑
00:26
家庭搞笑日记
Рет қаралды 15 МЛН