Is there a good way to blur the content beneath a ...
# compose-android
j
Is there a good way to blur the content beneath a Composable but not the children of the Composable itself? My designers want a app bar with a translucent background. The screen content would scroll beneath the custom app bar and still be visible, but blurred. Kinda like the frosted glass effect.
s
s
Yes, use Haze, but be aware that it only functions on API 32 and above.
s
And if your designers ask why, redirect them to this 200 message long thread https://kotlinlang.slack.com/archives/CJLTWPH7S/p1651845634528419 open eye crying laughing
😄 2
j
This is quite the read 🤪
s
There are some libraries that work on lower Android APIs and implement software-based blurring, using the CPU to blur UI rendered into bitmaps. I strongly advise against using them because they hurt the ux and cause performance issues. Even though they might work well on high-end devices, I wouldn’t recommend them at all. Implementing fast, optimized hardware-accelerated blurring for older Android APIs is quite challenging, but also very interesting. If you’re looking for code samples, you can search this channel for posts I’ve shared.
j
Already got approval from design to forgo the blurring entirely..
👍 2
The performance issue was a major concern so I see this as a win
🌟 1