Hello, is there a way to blur a Composable? :screa...
# compose
g
Hello, is there a way to blur a Composable? 😱 If not, how could I achieve that?
a
This is a conversation from 5 months ago. I don’t know if it still valid. https://kotlinlang.slack.com/archives/CJLTWPH7S/p1582840209116000
🙏 1
g
Did you find a way to do it @Zach Klippenstein (he/him) [MOD]?
m
yeah, having a 1st party blur solution would be great, right now blurring textureview/surfaceview is not easy
4
g
The best would be to have it as a Modifier I guess, to blur whatever we put in a Composable. I need to learn how to create that Modifier 😄 If someone could point me into the right direction, that would be great!
👍 1
z
Here's the W3 spec for how to implement this feature for CSS in web browsers: https://www.w3.org/TR/filter-effects-2/ Here's the source code for the Magnifier that is used for text selection on newer versions of Android: https://cs.android.com/android/platform/superproject/+/master:frameworks/base/core/java/android/widget/Magnifier.java;l=70?q=Magnifier&sq= They're similar, you could probably copy the magnifier code and make it do blurring instead. None of this is Compose-specific but Compose just uses Android's APIs for graphics so the low-level bits are gonna require working with Android system APIs anyway (eg Surfaces), even if you put a nice Compose API on top of it.
😨 1
👍 1