https://kotlinlang.org logo
#compose
Title
# compose
s

Socheat KHAUV

07/12/2020, 3:18 PM
any example animation code for loading image ?
t

Timo Drick

07/12/2020, 7:44 PM
I assume that you want to download an image an than show it in the UI? I do implemented a image downloader from Scratch. It is not perfect but easy to use. Code is here: https://gitlab.com/timod/compose-playground/-/blob/master/app/src/main/java/com/example/composeplayground/ComplexImageListTest.kt It is a little bit more complex because in practice you want also caching. But it is all there: https://gitlab.com/timod/compose-playground/-/blob/master/app/src/main/java/de/appsonair/compose/ImageLoader.kt
n

nglauber

07/12/2020, 8:06 PM
@Socheat KHAUV I’m using this lib created by @cb. It has the crossfade effect out of the box. https://github.com/chrisbanes/accompanist/tree/main/coil
Copy code
CoilImageWithCrossfade(
    data = "<https://loremflickr.com/300/300>"
)
5 Views