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

Mjahangiry75

05/28/2021, 9:53 AM
can we blur something in compose?, like a
Box
f

Filip Wiesner

05/28/2021, 9:55 AM
Theoretically yes but only since Android 12 (which is in beta)
m

Mjahangiry75

05/28/2021, 9:55 AM
too bad
f

Filip Wiesner

05/28/2021, 9:56 AM
You can blur images tho if that's your use case.
m

Mjahangiry75

05/28/2021, 9:56 AM
using glide?
f

Filip Wiesner

05/28/2021, 9:56 AM
Yeah, that should work. (or different image loading lib)
m

Mjahangiry75

05/28/2021, 9:57 AM
I'll try
f

Filip Wiesner

05/28/2021, 9:57 AM
Glide has
BlurTransformation
m

Mjahangiry75

05/28/2021, 10:02 AM
is it available in it's compose version?
f

Filip Wiesner

05/28/2021, 10:03 AM
It should be (it almost certainly is)
Read the docs if you are not sure
w

Walter Berggren

05/28/2021, 10:42 AM
Hoping for this too, please the issue :) https://issuetracker.google.com/issues/166927547
f

Filip Wiesner

05/28/2021, 10:52 AM
But I guess it will still be available only on Android 12+ because blur effect on render nodes is not supported on previous versions. Maybe it will be software-rendered on previous versions?
g

gildor

05/28/2021, 2:42 PM
You can use any standard way for blurring bitmaps (there are many articles and SO answers kn the topic), Android 12 is required only if you want blur for dynamic content
5 Views