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

Thierry

02/05/2020, 10:57 PM
anyone already tried to use Glide together with jetpack compose?
l

Leland Richardson [G]

02/05/2020, 11:47 PM
I hacked something quick together when i was playing around. Would love for someone to make it more robust: https://gist.github.com/lelandrichardson/de674fe6788d922fc84362fdae530464
t

Thierry

02/05/2020, 11:48 PM
so i was working on the same, cool to see your code.
Copy code
val context = ambient(ContextAmbient)
what's the difference with:
Copy code
val context = AmbientContext.current
l

Leland Richardson [G]

02/05/2020, 11:49 PM
they’re the same thing
just APIs shifting around as we move forward
i believe
ambient
the function was deprecated
though maybe not publicly
don’t know if that made it into dev04 or not 🙂
t

Thierry

02/05/2020, 11:50 PM
ha, i like how experimental this all feels 🙂
l

Leland Richardson [G]

02/05/2020, 11:50 PM
lol
ambients just received a big overhaul
they’re much faster now
💯 1
🚀 2
😮 2
just missed the cut for dev04 🙂
t

Thierry

02/06/2020, 12:20 AM
Copy code
val image = state<Bitmap?> { null }
is it image = x or image.valuke = x
i noticed your 2 snippets do that differently
For me it reaches the onResourceReady, but updating the state val doesn't update the UI (https://gist.github.com/lelandrichardson/de674fe6788d922fc84362fdae530464)
Copy code
ext.compose_version = '0.1.0-dev04'
l

Leland Richardson [G]

02/06/2020, 12:39 AM
the difference is if you use a property delegate or not
var image by state …
vs
val image = state …
i

Ian Warwick

02/06/2020, 11:23 PM
val context = AmbientContext.current
nice 🙂
2 Views