Skip to content

NPE on closing dialog #2

@achatina

Description

@achatina

Tried to use this lib for blur effect in dialog, but when it closes, i get this:

    java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.graphics.Canvas.isRecordingFor(java.lang.Object)' on a null object reference
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3443)
        at android.view.View.draw(View.java:17217)
        at no.danielzeller.blurbehindlib.BlurBehindLayout.renderBehindViewToTexture(BlurBehindLayout.kt:252)
        at no.danielzeller.blurbehindlib.BlurBehindLayout.redrawBlurTexture(BlurBehindLayout.kt:216)
        at no.danielzeller.blurbehindlib.BlurBehindLayout.access$redrawBlurTexture(BlurBehindLayout.kt:25)
        at no.danielzeller.blurbehindlib.BlurBehindLayout$frameCallBack$1.doFrame(BlurBehindLayout.kt:234)

Plus can't understand, while it rendering, it has a moment when view becomes black on a second. Looks not very good.

Maybe I'm doing smth wrong.
Here is how i use it in dialog:

<FrameLayout
        xmlns:tools="http://schemas.android.com/tools"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/blur_root"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    <no.danielzeller.blurbehindlib.BlurBehindLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:id="@+id/blur"
            app:blurRadius="30.0"
            app:updateMode="continuously"
            app:blurTextureScale="0.1">
        //content
    </no.danielzeller.blurbehindlib.BlurBehindLayout>
</FrameLayout>

And setting view:
dialog?.blur?.viewBehind = activity.root

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions