Top 3 Hacks to Remove LazyColumn Lag in Jetpack Compose - Android Studio Tutorial

  Рет қаралды 36,909

Philipp Lackner

Philipp Lackner

Күн бұрын

Пікірлер: 69
@unknownBoy85lover
@unknownBoy85lover 8 ай бұрын
I just wanted to thank you for all the help and support yo you've done for me by sharing your experiences ❤
@mateusbauer7299
@mateusbauer7299 Ай бұрын
The Stable annotation saved me, thank you Phillip.
@giovanileitevitor
@giovanileitevitor 8 ай бұрын
Fantastic… i never heard about this annotation for data class. Thanks to share that .
@kristianivanov36
@kristianivanov36 8 ай бұрын
Have you ever run into the issue that the Run button in Android Studio loads an old version of the app onto the emulator? Sometimes after I change code, and click Run app, it loads a version with old code, before I made the changes, or EVEN earlier, before a lot more changes were made. Any way to fix this?
@DenzilFerreira
@DenzilFerreira 8 ай бұрын
Edit configuration of the run config, clean build
@szymonkurpas1172
@szymonkurpas1172 8 ай бұрын
I encountered something similar to what you have described. Whenever I cleared the app's cache then the app was reset to the oldest version. Still remember being confused in front of the client as the feature that was working suddenly didn't. I turned out it was what I have mentioned.
@abv99997
@abv99997 8 ай бұрын
I think it has happened to me a couple of times. I simply rerun it and it loads the new code
@chicongvu8062
@chicongvu8062 8 ай бұрын
​@@szymonkurpas1172omg yes. And then I went to issuetracker to find the same issue and didn't find any ticket mentions about it
@mxkmn
@mxkmn 8 ай бұрын
Never got this 🤔
@MrBzik1111
@MrBzik1111 8 ай бұрын
Great video, thanks, Philipp. Is it also reasonable to add baseline profile for lazy column scrolling? I usually encounter lags on first few scrolls
@PhilippLackner
@PhilippLackner 8 ай бұрын
Yes, absolutely
@andrewstelmakh8270
@andrewstelmakh8270 8 ай бұрын
Thanks for the video! Another option for making the MyImage class stable is to replace the List type with a Kotlin immutable collection type, such as ImmutableList.
@AlSamZar
@AlSamZar Ай бұрын
Thanks for the tips, I really appreciate them. On SwiftUI, scrolling appears to be smoother out of the box.
@rogeralien
@rogeralien 8 ай бұрын
I love this guy, since he is saying "those images are from the real camera" 😅
@tomasglazr2466
@tomasglazr2466 7 ай бұрын
In the third example would the solution also be to make the collection as immutable list? Then the data class wouldn't contain any mutable properties and shouldn't be marked as unstable right?
@5Aerim
@5Aerim 3 ай бұрын
The last tip is awesome, thanks!!!
@PS3HDTests
@PS3HDTests 8 ай бұрын
I'll apply this after holidays, thanks a lot 👌
@wawrzyn3059
@wawrzyn3059 8 ай бұрын
Hi, great video, thanks for pro tips. Could you explain how did you solve the problem with nods in layout inspector? I'm struggling with it very often..
@pgnrr
@pgnrr 8 ай бұрын
This is what i needed
@livingstonantony4135
@livingstonantony4135 8 ай бұрын
Just a query: How about ImmutableList instead of @immutable ?
@shahnizarbaloch
@shahnizarbaloch 8 ай бұрын
Was Waiting for this ❤️
@gamerscell9975
@gamerscell9975 4 ай бұрын
My buddy is life saviour
@ubersticks
@ubersticks 8 ай бұрын
Isn't there a way to declare the tags as an Immutable List of Strings in the MyImage data class? If possible, then that seems much more intuitive.
@9Blurke9
@9Blurke9 8 ай бұрын
I use the official kotlix.collections.immutable library
@clementjoymasinamela4244
@clementjoymasinamela4244 8 ай бұрын
Informative video, thanks. Can you please do a tutorial on video compression.
@everythingjdm8057
@everythingjdm8057 6 ай бұрын
thank you man your the best
@comicsans1230
@comicsans1230 8 ай бұрын
Thanks. Really appreciate your videos
@hotcoding482
@hotcoding482 8 ай бұрын
@Philipp can you suggest me what is best way to use multiple state in composable screen.
@clamum9648
@clamum9648 8 ай бұрын
Good stuff bruther. So I'm assuming my class could still be marked Immutable if it doesn't get its properties directly updated anywhere, but those underlying properties might be updated from the database? Like my list is a list of items that can be edited/updated in another screen, but the properties aren't directly updated anywhere in the list screen. If that makes sense.
@skandarsouissi7282
@skandarsouissi7282 4 ай бұрын
great man, great man ❤
@Mr.E.C
@Mr.E.C 8 ай бұрын
Super video. However, if I have understood you correctly, @Immutable and @Stable cannot be applied to constantly changing lists. For example, if you load the data with a pager, can you only show a loading animation or is there also a way to improve performance and only recompose the newly loaded data and not the existing data in a lazy column?
@ggstb
@ggstb 8 ай бұрын
Just make sure all the items in data class have val so when you are updating data you have to use copy function and you will be good to go and will be able to use Immutable and Stable without worries
@Mr.E.C
@Mr.E.C 8 ай бұрын
@@ggstbthat’s my way to go but if I have an list inside of an data class, I‘m running into an recompose and this is also an problem if I'm using the Paging 3.0 Library.
@deepeshkumar1704
@deepeshkumar1704 6 ай бұрын
what is the alternative of actionMode and menuInflater in jetpack compose?
@areebahmad7935
@areebahmad7935 8 ай бұрын
For backend which lang do you use .And when are going to teach us from scratch ?
@uop6238
@uop6238 8 ай бұрын
if images count changed from repository but uuids are generated in subsequent sessions, the uuids will changed for same data all the time. Is there some problem for lazy column animation?
@bhabhayt398
@bhabhayt398 8 ай бұрын
Can you make video on zoom custom ui, does it have any resources?
@ALEX54402
@ALEX54402 8 ай бұрын
Thanks
@Efryed
@Efryed 3 ай бұрын
When I debug the app using an emulator the app runs perfect, but if I debug it on my cell phone the app has a lot of lag. When I searched the internet, I found that changing the Build Variant from debug to release fixes it and it really works. Do you know why this could happen?
@boskovaskovic
@boskovaskovic 15 күн бұрын
There are a lot of debugable processes attached to the debug variant. However in the release version all those processes are gone.
@christophernanju8849
@christophernanju8849 8 ай бұрын
What about adding a rememberLazyListState to the state field of the LazyColumn? I didn't see you do that
@abdelrahmankhaled7575
@abdelrahmankhaled7575 6 ай бұрын
it`s not needed here ( in terms of optimiztion) , it will be needed on customizng the scroll behaivor or get info about your scrolling behavior
@user-fr4jz9eg9t
@user-fr4jz9eg9t 8 ай бұрын
단순히 텍스트만 있어도 레이지 컬럼은 성능이 좋지 않음.
@rogeralien
@rogeralien 8 ай бұрын
isn't data class by default meant to be immutable?
@raheemadamboev
@raheemadamboev 7 ай бұрын
only when all the objects in it is stable. Since regular List is not stable, it is not marked as stable
@rogeralien
@rogeralien 7 ай бұрын
@@raheemadamboev thank you! Probably I don't use that many data classes with lists.
@mubashirpa
@mubashirpa 8 ай бұрын
@user-fy3bl4dx9v
@user-fy3bl4dx9v 8 ай бұрын
still am facing lazy column lag... class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { ContactTheme { Surface( modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.inverseSurface ) { LazyItem() } } } } } @Immutable data class User( val name: String, val id: String = UUID.randomUUID().toString() ) @Composable fun LazyItem() { val item = (1..100).map { User(name = "Random name $it") } LazyColumn( verticalArrangement = Arrangement.spacedBy(4.dp), contentPadding = PaddingValues(6.dp) ) { items(item, key = { it.id }) { com.example.contact.ui.presentance.screen.CardContact(name = it.name) } } }
@olegleonov1310
@olegleonov1310 8 ай бұрын
Why you don't use all the `MyImage` data class as a key?
@iZakirSheikh
@iZakirSheikh 8 ай бұрын
That is because keys need tobe parcelable.
@olegleonov1310
@olegleonov1310 8 ай бұрын
​@@iZakirSheikhhashCode() is pretty parcelable 😊
@ovedgustavorinconmachado506
@ovedgustavorinconmachado506 8 ай бұрын
I am learning English but, do you have videos in Spanish? XD
@leonidas_30052
@leonidas_30052 8 ай бұрын
The documentation tells us to strive to keep our class stable without using these annotations.
@maximkarassev1016
@maximkarassev1016 5 ай бұрын
Please slow down Philipp you speak so fast😅
@imlassuom
@imlassuom 3 ай бұрын
Android studio is so slow!! ...
The Top 3 State Management Mistakes On Android
14:30
Philipp Lackner
Рет қаралды 24 М.
derivedStateOf VS. remember(key) - THIS is Really the Difference 🤯
14:46
МЕБЕЛЬ ВЫДАСТ СОТРУДНИКАМ ПОЛИЦИИ ТАБЕЛЬНУЮ МЕБЕЛЬ
00:20
Bend The Impossible Bar Win $1,000
00:57
Stokes Twins
Рет қаралды 43 МЛН
АЗАРТНИК 4 |СЕЗОН 2 Серия
31:45
Inter Production
Рет қаралды 870 М.
3 Clean Code Hacks I Bet You Didn't Know (Kotlin & Android)
12:30
Philipp Lackner
Рет қаралды 27 М.
KMP vs. Flutter - Who Will Win The Cross-Platform Battle?
16:19
Philipp Lackner
Рет қаралды 46 М.
MVVM vs. MVI - Understand the Difference Once and for All
18:40
Philipp Lackner
Рет қаралды 41 М.
Should You Use Compose State or StateFlow in Your ViewModels?
13:59
Philipp Lackner
Рет қаралды 76 М.
Top 3 Secret Jetpack Compose Modifiers I Bet You Didn't Know
9:08
Philipp Lackner
Рет қаралды 15 М.
LazyColumn In Jetpack Compose 🚀 | Android Studio | 2024
15:28
Using docker in unusual ways
12:58
Dreams of Code
Рет қаралды 444 М.
It's 100% FREE Now!! Scrape ANY WEBSITE with Llama3.1!
13:24
Reda Marzouk
Рет қаралды 10 М.
Most overpowered way to build mobile apps?
8:33
Beyond Fireship
Рет қаралды 788 М.
😱 iphone 15 pro vs iphone 14 pro max speed test 😨
0:14
Tech_Compareing
Рет қаралды 7 МЛН
Покупка бюджетного ПК на Wildberries? 🤬
0:59
Вэйми
Рет қаралды 2,9 МЛН
Which phone do you have?
0:33
Adhemz
Рет қаралды 3,7 МЛН
Introducing iPhone 16 Pro | Apple
2:53
Apple
Рет қаралды 4,2 МЛН
Замена Vision Pro в 5 раз дешевле
1:00
Rozetked
Рет қаралды 165 М.
Google Pixel 9/Pro Review: Gimmick or Good?
24:05
Marques Brownlee
Рет қаралды 3,9 МЛН