Closed maximlozhechnikov closed 2 years ago
i've tried to change setHasFixedTransformationMatrix, but it doesnt helps
Edit: This was the workaround solution that I used for my own project. The developer posted his own official solution below.
The BlurView only re-renders if the focused area has something moving in it (aka the dialog). I was able to get scrolling to work if I added a small View inside the dialog that was constantly animating (for me it was scaling), and then make the View transparent.
Dialog | --> Animating Object --> /Rest of Content/
You can choose how long to animate it for, but I chose a minute since the scrollview wouldn't be able to scroll for that long without user input.
@chriscross12324 thanks a lot, just placed progress bar under blur view with transparent color and all works fine
Glad it worked
The BlurView only re-renders if the focused area has something moving in it (aka the dialog)
That's not exactly true, but thanks for the workaround suggestion.
The fix is probably to change the ViewTreeObserver
used here from blurView.getViewTreeObserver()
to rootView.getViewTreeObserver()
public BlurViewFacade setBlurAutoUpdate(final boolean enabled) {
blurView.getViewTreeObserver().removeOnPreDrawListener(drawListener);
if (enabled) {
blurView.getViewTreeObserver().addOnPreDrawListener(drawListener);
}
return this;
}
This way it will redraw on changes in the rootView's Window, which makes more sense and should fix this particular bug.
The reason is that the Dialog has its own Window and seems like the OnPreDrawListener
works per window.
Learn something new everyday. Thanks @Dimezis
This should be fixed in 2.0.0
i need any advise to make blur working on dialog, while activity under it is scrolling `class CustomDialog(@LayoutRes private val layoutId: Int, private val title: Text?, private val message: Text?, private val cancellable: Boolean = true) : DialogFragment() {
}
<?xml version="1.0" encoding="utf-8"?> <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="335dp" android:layout_height="wrap_content" android:background="@color/transparent" app:cardCornerRadius="12dp" app:cardElevation="0dp">
</androidx.cardview.widget.CardView>`
Here is how i use blur on dialog, its all working fine but not overdrawing while activity is scrolling