Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Peterragheb opened this issue Nov 13, 2019 · 5 comments
Open

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

Peterragheb opened this issue Nov 13, 2019 · 5 comments

Comments

@Peterragheb
Copy link

Peterragheb commented Nov 13, 2019

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
Copy link

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

@Peterragheb
Copy link
Author

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
Copy link

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
Copy link

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

@marticztn
Copy link

marticztn commented Aug 22, 2021

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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants