Topic. Interrupt Fails on ICS

I use: android:theme="@android:style/Theme.Translucent.NoTitleBar"

in combination with: getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND, WindowManager.LayoutParams.FLAG_BLUR_BEHIND);

to get a nice transparent background blur effect, emulates a dialogue style.

This works great on 2.3 and below, but it's solid color (read opaque) on devices running ICS / 3.0 and above. I know that they introduced a holographic theme, and there seems to be no specific theme for Theme.Holo.Translucent. Any ideas on how to get a translucent background on ICS and older, I am not opposed to using individual topics defined in values-v11.

+6
source share
2 answers

Using

 dialog.getWindow().setBackgroundDrawable(new ColorDrawable(0)); 

or continue with Theme.Translucent.NoTitleBar and add

 <item name="android:windowBackground">@android:color/transparent</item> 
+3
source

They don't seem to approve of blurring, at least with FLAG_BLUR_BEHIND :

public static final int FLAG_BLUR_BEHIND

This constant is deprecated. Blurring is no longer supported.

+1
source

Source: https://habr.com/ru/post/905367/


All Articles