RealtimeBlurView
RealtimeBlurView copied to clipboard
Strange frames around the edges of the blur
I try to blur the background, and almost constantly around the edges of the blur, I see the effect of the "frame"
Sometimes when Activity is launched, this effect does not appear
Tested on: Pixel 2 emulator (API 22), Samsung SM-A300F
Code:
` <FrameLayout android:id="@+id/drawer_container" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior">
<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
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);