Question

Just a quick question. My app uses a transparent activity with a style applied as follows:

<style name="Theme.PopupWindow" parent="android:Theme">
    <item name="android:windowFrame">@null</item>
    <item name="android:windowTitleStyle">@android:style/Widget.PopupWindow</item>
    <item name="android:windowIsFloating">true</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
    <item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
    <item name="android:windowIsTranslucent">true</item>
    <item name="android:windowBackground">@android:color/transparent</item>
</style>

In the activity class, I call the following line of code before setContentView():

getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);

Although this works, I find it lags considerably when I launch the activity. Using another flag such as FLAG_DIM_BEHIND executes perfectly smooth. Is this a known issue, or am I just attempting this incorrectly?

Thanks.

Was it helpful?

Solution

Blurring is a relatively CPU-intensive effect. It's not uncommon for it to cause lag especially on older devices.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top