CameraKit / blurkit-android

The missing Android blurring library. Fast blur-behind layout that parallels iOS.
MIT License
3.72k stars 309 forks source link

BlurKit doesn't blur the whole width of screen #70

Open Peterragheb opened 4 years ago

Peterragheb commented 4 years ago

Blurkit doesn't blur the whole width of screen in constraint layout. the last portion of the screen on the right is not blurred.And changing the blur radius doesn't affect it.

 <io.alterac.blurkit.BlurLayout
            android:id="@+id/blurLayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:blk_fps="0"
            app:blk_blurRadius="7"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

Here is a screenshot: device-2019-11-13-142230

sean-looong commented 4 years ago

call blurLayout.startBlur(); blurLayout.lockView(); in onStart function will solve your problem.

Peterragheb commented 4 years ago

It works only if the screen is not scrollable. If I use it in a scrollview it causes the app to crash with the following exception: java.lang.IllegalArgumentException: y + height must be <= bitmap.height()

diegocunhawarren commented 4 years ago

I fixed this calling an invalidate right after my image is loaded (i'm using a dynamic image retrieved by Picasso) and it working well to me

SemaphoreMetaphor commented 3 years ago

I'm also having this same issue in a coordinatorlayout. The middle right of the screen is not blurred

marticztn commented 2 years ago

This will pause the blur after 300ms and it should blur the whole width of the screen

new Handler().postDelayed(() -> { blurLayout.setFPS(0); blurLayout.lockView(); blurLayout.invalidate(); }, 300);