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

java.lang.IllegalStateException: Underflow in restore - more restores than saves #184

Open
Usman-Click opened this issue Sep 7, 2022 · 5 comments

Comments

@Usman-Click
Copy link

Hi,

pls i get this error when i tried to scroll blurView inside a scroll view

this is what i get from logcat
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.clickinc.toplayer, PID: 16537
java.lang.IllegalStateException: Underflow in restore - more restores than saves
at android.graphics.Canvas.restore(Canvas.java:679)
at eightbitlab.com.blurview.PreDrawBlurController.updateBlur(PreDrawBlurController.java:116)
at eightbitlab.com.blurview.PreDrawBlurController$1.onPreDraw(PreDrawBlurController.java:50)
at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:1124)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3854)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2618)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9971)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1010)
at android.view.Choreographer.doCallbacks(Choreographer.java:809)
at android.view.Choreographer.doFrame(Choreographer.java:744)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:995)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8550)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

thanks

@Dimezis
Copy link
Owner

Dimezis commented Sep 7, 2022

Please attach a sample project or code with your XML layout

@Usman-Click
Copy link
Author

Okay
Where should I send it ?
Or should I paste it here ?

@Dimezis
Copy link
Owner

Dimezis commented Sep 8, 2022

Post a link to the repository or paste a relevant code here.
Repository is preferable

@Usman-Click
Copy link
Author

Usman-Click commented Sep 10, 2022

<androidx.constraintlayout.motion.widget.MotionLayout 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="match_parent"
    android:layout_height="wrap_content"
    app:layoutDescription="@xml/activity_music_player_scene"
    tools:context=".musicplayer.MusicPlayerActivity">


    <RelativeLayout
        android:id="@+id/music_player_parent"
        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">


        //// imageView to be blured

            <ImageView
                android:id="@+id/musicThumbnailBg"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@color/pri_color_variant"
                android:scaleType="centerCrop" />

     


     //// BlurView

        <eightbitlab.com.blurview.BlurView
            android:id="@+id/blurLayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#80000000" >


        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">


       <Unrelated-date>..........</Unrelated-data>


    </RelativeLayout>


      </eightbitlab.com.blurview.BlurView>
 


</androidx.constraintlayout.motion.widget.MotionLayout>

Is it because of MotionLayout ???

Fox2Code added a commit to Fox2Code/BlurView that referenced this issue Oct 7, 2022
@Dimezis
Copy link
Owner

Dimezis commented Oct 9, 2022

Could you please check if this PR fixes your problem?

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

2 participants