Is there a way to get the "frosted glass" blur eff...
# compose
c
a
Well, there's a
blur
modifier but it seems to be Android 12 and above, but I'm not sure. Would that help or is there something more there?
e
RenderEffect (for blur etc.) is Android 12+ only. to achieve the same effect on older devices, you'd need to render to a bitmap (which isn't exactly supported, but you can fake it going through View I think) and blur that with RenderScript (which is now deprecated)
a
You use also use OpenCV on versions before Android 12. But it's rather heavyweight. I wouldn't recommend it. When I use OpenCV, many years ago, there was considerable setup costs in terms of time and effort and sanity. But if you absolutely need it, it's possible.
a
Google has provided a replacement toolkit for RenderScript including blur. See here. That being said, the bitmap-blurring method is tricky and IMO the blur effect isn't worth the effort.
plus1 1
c
I definitely agree, but I was basically just handed an entire new redesign project and everything is freaking blurred. In reality it's just two list item types that have the bottom 10% or so of an image blurred. so I'm trying to see if theres anyway to just make that blurred. I guess I will attempt to create a bitmap and blur it myself. sounds like potential memory leak hell or something I'll get into when I need these in a lazyColumn, but I guess I'll tell them that I'll give it a shot.
e
oh if you're just blurring part of an image that should be much easier than blurring an arbitrary composable
👍 1
🙌 1
c
Thanks! I wonder if I can apply that to only part of an image.
e
can do so in your own transform (if you're using coil you'll have to do that in the future anyway; changelog says it's being removed in 2.0.0 alpha and users should copy the code)
602 Views