The FULL Nested Scrolling Guide for Jetpack Compose 😱 - Android Studio Tutorial

  Рет қаралды 37,580

Philipp Lackner

Philipp Lackner

Күн бұрын

Пікірлер: 75
@revel-raza
@revel-raza 2 ай бұрын
At this point I think I forgot how many times you had saved my job. Thanks man!!
@hoplite_softworks
@hoplite_softworks 8 ай бұрын
YOU LITERALLY SAVED MY PROJECT ! THANK YOU X 1000000 !!!
@dreamerslab
@dreamerslab Жыл бұрын
Flutter has really amazing support for scrolling components. It's dead easy to implement grids, lists in single scrollable parent. It would be great if compose could improve these basic issues in upcoming releases.
@deviantstudio
@deviantstudio 8 ай бұрын
same in swift ui
@scottbiggs8894
@scottbiggs8894 Ай бұрын
6:23 "Extend the lazylist scope"! This one sentence was exactly what I was looking for, thank you! I didn't even know that was possible (suspected something like that could be done, but never saw an example--or at least didn't understand what I was reading). 🤓🎆
@OliverRhyme
@OliverRhyme 2 жыл бұрын
With the nested RecyclerView, there is actually a problem. It does not recycle items as RecyclerView is given infinite height so RecyclerView thinks your screen is also infinitely high, thus renders all the child. Very dangerous for paging as it loads all the data till the end.
@TVHovna
@TVHovna 2 жыл бұрын
😱
@deepakbisht4957
@deepakbisht4957 Жыл бұрын
Of course when you nest the Recycler view inside Scroll view in XML things works but Recycler view lost it's recycling Power that's why Compose is restricting us from the starting with this approach that many developers use in case of Xml...
@andrewdunbar828
@andrewdunbar828 Жыл бұрын
All the child inside of us, Will soar into the sun, We'll leave our fears and doubts behind, And let our true selves run.
@Landofcoding
@Landofcoding 2 жыл бұрын
This is helpful, but it could get more complicated if you want to implement gridItems with nested scrolling. i think the Android team should do something about this in the upcoming versions of compose.
@SoulWithoutFaith
@SoulWithoutFaith Жыл бұрын
It looks like working if LazyVerticalGrid is used as parent lazy composable. Use item() DSL for your horizontal shelves together with GridItemSpan to get correct UI. And for grid just use items() DSL as in this video.
@talhac2796
@talhac2796 6 ай бұрын
I have a LazyVerticalGrid inside a item list in a LazyColumn. What about my situation? How can i solve it?
@ravikumarmohan1415
@ravikumarmohan1415 4 ай бұрын
What if there is a Lazy Vertical Grid inside the lazy column? Could someone help answering this question?
@pitorszpitor6679
@pitorszpitor6679 2 жыл бұрын
If I look left see Philipp new video than look right same than look around Philipp still there with this compose. This KZbin/Google algorithim works very well. Keep it up man.
@JahangirJadi
@JahangirJadi Жыл бұрын
Hi. Thank you. This video really helped and confused me at the same time. So, what if I have LazyColumn inside a Column because this trick won't work if we have a column instead of a lazyColumn.
@saketanand9157
@saketanand9157 2 жыл бұрын
Thanks Philipp !. I ran into this problem couple of months back. So, what I did was, just use items block to implement the nested LazyColumn. I was unaware of the fact that I could have just used LazyListScope.
@romanhruska7402
@romanhruska7402 6 ай бұрын
What if I have a list of lists of item (eventual LazyColumn nested inside LazyColumn) but I need to apply some UI tweaks to the sub-lists? Such as background color, border.. etc? Like --- HEADER 1 --- { Section 1 item 1 } { Section 1 item 2 } { Section 1 item 3 } --- HEADER 2 ---- { Section 2 item 1 } { Section 2 item 2 } and each section of items should be contained as a box/column - layout that would visually group the items. How to do that?
@dolakrishnanseshachalam3028
@dolakrishnanseshachalam3028 Жыл бұрын
Hi @Philipp I have Lazy Column Inside HorizontalPager and insider this I have LazyColumsn how we can achieve this
@cesarlabastida1392
@cesarlabastida1392 Жыл бұрын
Brother I was having this issue at my job. Thanks for you videos they are ver helpful
@mrunalpatil5913
@mrunalpatil5913 2 жыл бұрын
Hi Phil, this one is not related to this video but really wanted to know your view about Robolectric testing? Using Espresso in robolectric testing? How should both be integrated? What is proper way to use robolectric? So many questions I have can't get a proper video anywhere. Can you please make one .. your videos are easier to understand.. Also thank you for all the knowledge you keep giving us❤️
@agustinsivoplas3330
@agustinsivoplas3330 Жыл бұрын
Whats happens if I have a TabRow, with Horizontal pager and the LazyColumn lives inside the pager and I want to make all the view scrollable. So the Tabs has to scroll too. Any idea how to solve this?
@anirbanroy6337
@anirbanroy6337 Жыл бұрын
can you please give me this answer :: into SubList2 i am using use LazyVerticalGrid , not LazyColumn or Column , then app is crashing , is there any possible solution for this?
@oliveryt7168
@oliveryt7168 5 ай бұрын
Very helpful (yet again ^^).
@Deathfang89
@Deathfang89 2 жыл бұрын
What theme are you using for in these videos in AS?
@PrashantSingh-d97
@PrashantSingh-d97 2 жыл бұрын
It was quite interesting and informative.
@mridulbarman027
@mridulbarman027 2 жыл бұрын
For now if we use java xml component with nested recycler view inside compose, will that work?
@NateRidderman-du8jv
@NateRidderman-du8jv 10 ай бұрын
So helpful!
@mrchispa4541
@mrchispa4541 Жыл бұрын
Does google presented any solution to this ? Is pretty common to have this situation. Ussually every app has a scroll if the content doesn't fit in the screen.
@Infonation108
@Infonation108 2 жыл бұрын
"Invalid encoding of byte 1 of 1-byte in UTF 8 sequence" I am getting this error while building my app, Plzz tell me way to fix it
@maskedredstonerproz
@maskedredstonerproz 2 жыл бұрын
1. google it, 2. or tell us something we can use to help you, you didn't say anything
@osamasayed4086
@osamasayed4086 10 ай бұрын
Is this issue still present in Jetpack Compose at this time?
@codefathermw
@codefathermw Жыл бұрын
Landila ulemu wako @Phillip. 👍👍👍
@ruavaen
@ruavaen 2 жыл бұрын
I remember having a project with compose 1.0 where we had the main composable a lazy column and the inner columns normal columns. The instrumented tests showed that the nodes of the inside column that were not in the screen didn't actually existed yet, so we concluded that the lazy part of the main column would render all the content lazy loaded (at least from the rendering side). The objects supporting the columns's data will exist in the viewmodel anyway so we stopped trying to optimize that any further. I would like you to try this again in the latest versions of compose, maybe the behavior didn't change and we are worrying about nothing .
@eganathan.r
@eganathan.r Жыл бұрын
We had the excel sheet type report screen where we wanted the first value of the row and the header to be floating, had to give specific height depending on the number of contents.....
@deadPoolPlay9491
@deadPoolPlay9491 2 жыл бұрын
How about LazyverticalGrid in Lazycolumn ????
@fireninja6464
@fireninja6464 2 жыл бұрын
I have a drop down that's a lazy nested column. I gave each item a static height and gave the nested lazy column a height of items.size * item height and animate from 0 to that height when you click the drop down. Probably not the best solution in terms of accessibility but it works.
@GoodSmile3
@GoodSmile3 2 жыл бұрын
Haha I did the same thing for the same problem. Also had dropdown as a nested column, assigned height to each item and then multiplied with the list size. However in my case user could also expand any item inside the nested column, so the height could be changed, had to also keep that in mind.
@matussatara2609
@matussatara2609 2 жыл бұрын
Thanks for the video, Do you have any idea how to update the state of items in LazyColumn? Let's say that you have a list of images, You want to display them with a hearth icon in the corner. When you click the hearth icon the hearth becomes red. I had problem implementing this. My LazyColumn items's hearth color was updated only when i scrolled the item out of sight and back
@maskedredstonerproz
@maskedredstonerproz 2 жыл бұрын
What you wanna do is have a data class ImageItem( val imageUri: Uri, // or whatever other reference to the image you have val isLiked: Boolean = false // or whatever the heart represents if not liking, you get the point ) // then: val state = mutableStateListOf() // populate the state, and then: LazyColumn { items( items = state, itemContent = { // item display logic } ) } // if you're doing it with mutableStateList() and it's not working then idk
@matussatara2609
@matussatara2609 2 жыл бұрын
@@maskedredstonerproz i tried everything. Didn't get it to work 😊
@sayyid5416
@sayyid5416 6 ай бұрын
Is this improved as of now or still same?
@jayantkumar1954
@jayantkumar1954 2 жыл бұрын
Helpful 👍
@TheLatvianboy
@TheLatvianboy 2 жыл бұрын
Ran into this quite a ferw times as well, easiest solution for me was to just set Modifier.heightIn(max= *some crazy high dp value*) for the inner lazyColumn. This keeps Compose happy as it provides an upper height bound but in reality yhis keeps the nested scroll, and keeps the inner scroll view as wrap content height, expanding only when needed.
@PhilippLackner
@PhilippLackner 2 жыл бұрын
Oh nice gotta try this
@SoulWithoutFaith
@SoulWithoutFaith Жыл бұрын
Does it work with pagination? Or does it just fetch everything in this case?
@19SOUNDS90
@19SOUNDS90 Жыл бұрын
this is an awesome answer and did exactly what i needed! thanks
@johnshepard1267
@johnshepard1267 Жыл бұрын
I have a Column with vertical Scroll and LazyVerticalGrid. Tried to set Modifier.heightIn(max = 1000000.dp) and the app still crashes but with different error "Can't represent a size of 281250 in Constraints" Howerer if I put 10000 - its fine. But will 10k dp be enough?
@PurelyAndroid
@PurelyAndroid 3 ай бұрын
great content.
@shahriarzaman4715
@shahriarzaman4715 Жыл бұрын
😱 That easy!!! Thnks. May Allah guide you..
@LasradoRohan
@LasradoRohan 2 жыл бұрын
Hey, could you also keep making view system tutorials, cause as of now, advanced views like "sectioned recycler view" are still obscure, and there aren't any good tutorials.
@Static1248
@Static1248 9 ай бұрын
MAGICAL!!!!!!!!!!
@jjhoninatan55sabadi
@jjhoninatan55sabadi 2 жыл бұрын
How about nest scroll connection? Won't it work ?
@PhilippLackner
@PhilippLackner 2 жыл бұрын
It's to use nested scroll with recyclerview and lazy column
@liaozhangpeng4436
@liaozhangpeng4436 4 ай бұрын
Nested LazyColumn is still not allowed in jetpack compose
@LucasYamato
@LucasYamato 2 жыл бұрын
Hey bro, all right? puts caption pt/br in the videos of your course please
@andrewdunbar828
@andrewdunbar828 Жыл бұрын
I'm going to name my new band "Lazy Cullem".
@robinwersich3424
@robinwersich3424 Жыл бұрын
Hey Philipp - first off: Thank you for your videos, they did help me :) Some feedback though: I wish you sometimes would go deeper into topics and not stay so superficial. If you call your video FULL GUIDE, I would expect you to at least also talk about NestedScrollConnection and NestedScrollDispatcher
@GoodSmile3
@GoodSmile3 2 жыл бұрын
That's stupid they never added some kind of nesting support. When I found out about this I actually got quite disappointed about compose. Like ye, no more recyclerview, but at what cost
@best5345
@best5345 2 жыл бұрын
I mean, I really hate compose because of this. This is so basic. I wonder who sat in his office and said, from now every list will be flattened.
@mustafaammar551
@mustafaammar551 2 жыл бұрын
you are the best
@milon27
@milon27 2 жыл бұрын
thanks
@d_o_o_m_g_u_y
@d_o_o_m_g_u_y Жыл бұрын
Surprisingly frustrating coming from a flutter background. But thanks alot
@abdy9415
@abdy9415 2 жыл бұрын
Thanks, how to use tik tok API
@deepakbisht4957
@deepakbisht4957 Жыл бұрын
Instead of all this mess you should use Flow Column...
@PhilippLackner
@PhilippLackner Жыл бұрын
That's something completely different and hasn't lazy loading behavior at all
@deepakbisht4957
@deepakbisht4957 Жыл бұрын
@Philipp Lackner true! This is not for every single scenario but it's good for the scenario where vertical sections are small and don't need much recycling. Otherwise we can also create section headers with expand option with animation...
@deepakbisht4957
@deepakbisht4957 Жыл бұрын
Hey Philipp how exactly are you managing this in your own project? Suppose you have many sections vertically and in each section we have a different type of list present with their own headers?
@PhilippLackner
@PhilippLackner Жыл бұрын
@@deepakbisht4957 what you mean is a LazyStaggeredGrid
@maxyablochkin-0505
@maxyablochkin-0505 2 жыл бұрын
Hello with Ukraine👋
@andrewdunbar828
@andrewdunbar828 Жыл бұрын
welcome back to my new comment
@pavelgorbatyuk7270
@pavelgorbatyuk7270 Жыл бұрын
this is not a full nested scrolling guide. Almost useless video as it is simply a part of official documentation. Better would be to show the case when the horizontal is fixed and not scrolled together with the whole container
@John-qt6qk
@John-qt6qk Жыл бұрын
Thanks
@rehan-6377
@rehan-6377 Жыл бұрын
Thanks
Should You Use Compose State or StateFlow in Your ViewModels?
13:59
Philipp Lackner
Рет қаралды 85 М.
Full Guide to Jetpack Compose Animations - Android Studio Tutorial
28:23
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
Nested scrolling | Jetpack Compose Tips
3:52
Android Developers
Рет қаралды 19 М.
Kotlin Multiplatform vs Flutter: Which should we use?
4:42
Kei Fujikawa
Рет қаралды 29 М.
Jetpack Compose Navigation for Beginners - Android Studio Tutorial
19:23
Philipp Lackner
Рет қаралды 152 М.
THIS Compose-State Mistake Leads to Problems In Your Code
7:58
Philipp Lackner
Рет қаралды 47 М.
Lazy layouts in Compose
24:32
Android Developers
Рет қаралды 100 М.
10x Your Speed With Flutter
8:04
Flutter Mapp
Рет қаралды 87 М.
RecyclerView and CardView for Jetpack Compose (LazyColumn and Card)
19:53
Coding a FULL App with AI (You Won't Believe This)
15:19
Creator Magic
Рет қаралды 389 М.
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41