-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[expo-blur][Android] Add support for BlurView on Android #21744
Conversation
This is a great idea if we want to support as many Android versions as possible. However, this is a 3rd party library - any thoughts on using the built-in Android API for this? https://source.android.com/docs/core/display/window-blurs The downside to the built-in API is that its only available from Android 12 while I'm sure the 3rd party package supports lower Android versions as well. I think both using the 3rd party library and 1st party Android support has its up and downsides. Maybe we could use |
Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
…ort' into @behenate-expo-blur-android-support
I'm so glad to see this pr and hope it gets merged. So long as it looks similar to the ios blur, I don't think it should matter if you use the built-in API or the library. |
packages/expo-blur/android/src/main/java/expo/modules/blur/ExpoBlurView.kt
Outdated
Show resolved
Hide resolved
packages/expo-blur/android/src/main/java/expo/modules/blur/ExpoBlurView.kt
Outdated
Show resolved
Hide resolved
packages/expo-blur/android/src/main/java/expo/modules/blur/ExpoBlurView.kt
Show resolved
Hide resolved
…Tint and color props.
I hope we'll land this, using a lot of blur views in the appjs app ❤️ |
Same! It would be awesome if it can be shipped as a "post-release addition" of SDK 48, but if its not feasible and has to wait until SDK 49, completely understandable! 👍 |
… not updating on android. Move tint calculation to native code. Update tests.
Great job, we will use this ASAP in our app! |
@@ -13,6 +13,7 @@ exports[`renders a native blur view 1`] = ` | |||
testID="blur" | |||
> | |||
<ViewManagerAdapter_ExpoBlurView | |||
blurReductionFactor={4} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've talked with @tsapete - we decided it will be better to rename that. Let's call it androidBlurReductionFactor
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fyi: I've been convinced to keep blurReductionFactor
as this is not common across our APIs to use platform names in such cases and also that this prop is not going to be used very often because the default behavior is good enough in most cases.
# Why There was no support for `BlurView` on android. Instead of blurring the view would just set the background color to semitransparent. # How Using [BlurView](https://github.com/Dimezis/BlurView) library and Modules API added blur support for Android. Default prop settings match it quite closely with the iOS version. # Test Plan Tested on Android emulators (API 33 and 28), and a physical device (API 31). Also compared the look of the blur on android emulator to the iOS simulator. --------- Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
This update makes Android lag uncontrollably on my OnePlus 6. But on other Android devices, it seems to work fine. |
@eeshankeni Can you open an issue with a minimal reproducible example? Repro would help us fix it faster 🙂 |
Hi! I'm trying to use the 12.3.0 version of expo-blur because of this feature. However, when running and compiling to Android, the Expo server tells me that I guess this happens due to the fact that I'm using the latest stable version of Expo (i.e., the 48.0.15 one), so how can I sort this thing out? Since version 49 beta isn't still available, is there any way to compile Expo from the source? Thanks. |
Hey @RGarrido03, could you please open a new issue instead of reporting it on the PR? We'll also need a minimal reproducible example, so we can test it out ourselves. Generally this feature should work well with all |
Why
There was no support for
BlurView
on android. Instead of blurring the view would just set the background color to semitransparent.How
Using BlurView library and Modules API added blur support for Android. Default prop settings match it quite closely with the iOS version.
Test Plan
Tested on Android emulators (API 33 and 28), and a physical device (API 31). Also compared the look of the blur on android emulator to the iOS simulator.