mmin18 / RealtimeBlurView

A realtime blurring overlay for Android (like iOS UIVisualEffectView)
Other
3.21k stars 350 forks source link

The blur not work when the activity's window is translucent. #12

Open imknown opened 7 years ago

imknown commented 7 years ago

AndroidManifest.xml

<activity
    android:name=".MineActivity"
    android:theme="@style/translucentActivity" />

styles.xml

<style name="translucentActivity" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:windowBackground">@android:color/transparent</item>
    <item name="android:windowIsTranslucent">true</item>
    <item name="android:windowAnimationStyle">@style/Animation.AppCompat.Dialog</item>
</style>

activity_mine.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <com.github.mmin18.widget.RealtimeBlurView
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:realtimeBlurRadius="10dp"
        app:realtimeOverlayColor="@color/blackOpaque70" />
<RelativeLayout />
imknown commented 7 years ago

I am rewriting these using the Dialog and PopupWindow temporarily.