Wrong activity background blurring effect
See original GitHub issuePlease include:
- Library version:
version-2.0.0
- Device and OS version: all API versions, tested on API 23 and 30
- Detailed steps to reproduce the issue
- Added a new transparent fragment
- Added a
android:windowBackground
attr - Checkout the blurring effect on topBlurView on transparent fragment
-
XML layout and code for BlurView setup: Reproduce commit here https://github.com/luongvo/BlurView/commit/6835fd2b97593ec5eaf794d28f9c53a2a6953168
-
Stacktrace in case of a crash: None
Expected: set android:background="@drawable/lines"
in activity_main.xml
could produce an expected result
Actual: using <item name="android:windowBackground">@drawable/lines</item>
in AppTheme and .setFrameClearDrawable(windowBackground)
set in MainActivity
does not work properly.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
blurry background of activity, without knowing what avtivity is ...
i want it's background to be blurry, so whatever activity should open after mine, would be blurry. But i can't know what activity...
Read more >Free Online Blur Background: Blur Image with Fotor
Blurring the background of a photo to highlight the photo's subject and add depth of field. Use our different blur effects to get...
Read more >How To Create a Blurred Background Image - W3Schools
How To Create a Blurry Background Image. Step 1) Add HTML: Example. <div class="bg-image"> ...
Read more >Work with blur effects in XD - Adobe Support
Create a blur mask to blur anything visible underneath; Add background blur effect to selected objects to blur the entire object.
Read more >Auto blur: blur background - Apps on Google Play
Auto blur background is fast and easy to use app to create amazing blur background effect pictures. --Features--- - Smart focus area selection...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can you post a commit with this change? It works fine for me on your branch
Apparently, there’s some weird bug with
android:windowBackground
as an image (BitmapDrawable
). I’ll see what I can do about it, but be aware that even regardless of this bug, yourExpected
result is probably impossible withsetFrameClearDrawable
, because the drawable doesn’t have a trackable position on the screen.That means, that even if I fix the bug, the bottom BlurView won’t be able to properly blur the bottom of this drawable.
To fix this, you can either pass the
(ViewGroup) getWindow().getDecorView()
as arootView
, or set the background inactivity_main.xml
as you did.