mmin18/RealtimeBlurView

Strange frames around the edges of the blur

TheNetos opened this issue · 5 comments

I try to blur the background, and almost constantly around the edges of the blur, I see the effect of the "frame"
screenshot_1529657143
Sometimes when Activity is launched, this effect does not appear
screenshot_1529657130

Tested on: Pixel 2 emulator (API 22), Samsung SM-A300F

Code:

`

    <android.support.v4.view.ViewPager
        android:id="@+id/viewPager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="8dp"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">
    </android.support.v4.view.ViewPager>
</FrameLayout>

<com.github.mmin18.widget.RealtimeBlurView
    android:id="@+id/blurView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:realtimeBlurRadius="4dp"
    app:realtimeOverlayColor="@color/colorOverlayGrey" />`

Does your activity has a white background?

No, background color set as #323643

Here's how it looks in the dynamics of work
blur_bug

Sorry I couldn't reproduce the issue by using a ViewPager. Could you provide more info.

Try modifying the code in the section that draws decorview to the Bitmap:
View contentView = decor.findViewById(android.R.id.content); if(contentView.getBackground() != null){ contentView.getBackground().draw(mBlurringCanvas); } contentView.draw(mBlurringCanvas);