Hey guys, Above is my code snippet by which I am g...
# android
m
Hey guys, Above is my code snippet by which I am getting list of all user applications and display them using a LazyVerticalGrid. But the list grid is laggy I have tried work around and use the key to distinguish elements but the ui is still laggy while scrolling list. Can you please suggest me the solution?
🧵 2
c
First of all don’t create multiple posts for one questionnaire put longer source code snippets in the thread.
m
Alright. I get it.
c
That said, you should load the drawable off the main thread.
m
But images are not loading from internet. They are local
c
sure, but not from your app but from different packages. it’s like a fast network connection but still nothing “cached”.
m
I get it. So using a coroutine would help resolve the lag.
m
Thanks I have implemented it. It works better but still laggy.
c
https://developer.android.com/jetpack/compose/performance 😉 Try release build with R8 enabled. There is a lot of “debug code” for compose when running an
debug
build
m
Sure.