Se7eN
09/15/2020, 1:21 PMLazyColumnFor
that displays 20 items. The items consist of an image and some text. When displaying 20 items with each image of size 128kb, it lags like hell. Is this a bug or am I missing something? Also, it works totally fine when displaying only text.manueldidonna
09/15/2020, 1:22 PMimageResource
that is a synchronous method to retrieve the image. Try again using an image loading library like coil (search for Accompanist on Github)Se7eN
09/15/2020, 1:25 PMImage
composablemanueldidonna
09/15/2020, 1:26 PMSe7eN
09/15/2020, 1:28 PMCoilImageWithCrossfade(
data = R.drawable.kakashi,
modifier = Modifier
.width(60.dp)
.aspectRatio(1f)
.clip(CircleShape),
contentScale = ContentScale.Crop
)
Yeah I guess the Image
is lagging because I was using imageResource
. The image I'm using: https://i.pinimg.com/originals/2a/1c/5b/2a1c5bbb55d56e983ff7ba2b09caa556.jpg▾
Colton Idle
09/15/2020, 1:39 PMSe7eN
09/15/2020, 1:43 PMmanueldidonna
09/15/2020, 1:45 PMSe7eN
09/15/2020, 1:55 PMmanueldidonna
09/15/2020, 1:56 PMtylerwilson
09/15/2020, 3:18 PMJoost Klitsie
09/15/2020, 4:50 PMHalil Ozercan
09/15/2020, 5:01 PMLazyFor
is that it doesn't really work well with dynamic height rows. This is also mentioned in the docs somewhere but I can't remember the exact place right now. So, be careful about changing height of the views according to a state change or request completion.Andrey Kulikov
09/15/2020, 5:21 PMloadImageResource
instead of imageResource
. if after that the scroll is still laggy please file a bug with the sample app. it will help us debug! thankslouiscad
09/15/2020, 5:58 PMimageResource
from being used at all if it can introduce UI performance issues?Rudolf Tammekivi
09/15/2020, 6:29 PM