IllegalStateException using Ripple Effect Library on Android M Devices
Asked Answered
C

1

6

Using this library to implement Ripple Effect and it works just fine except on Android M devices.

On Android M Devices getting IllegalStateException that says Underflow in restore - more restores than saves

FATAL EXCEPTION: main
Process: com.example.ripplethings, PID: 20119
java.lang.IllegalStateException: Underflow in restore - more restores than saves
at android.graphics.Canvas.native_restore(Native Method)
at android.graphics.Canvas.restore(Canvas.java:540)
at com.andexert.library.RippleView.draw(RippleView.java:166)
Chromatology answered 19/2, 2016 at 9:42 Comment(3)
that library must not having support for M devicesJudie
Look at issues page github.com/traex/RippleEffect/issues/76Matthaeus
the issue is apparently in the library itself. this question seems off-topic.Yerga
H
5

It seems like a bug in the library itself on Android 6.0, Possible ways to avoid the bug is

1) Use the com.balysv:material-ripple:1.0.2 library it seems more stable

2) Or you can use place separate layout for 21+ let the Android M handle the ripple itself. Just use the proper ripple holder for layouts and views

3) Or you can modify the library source code itself as per this suggestion

4)A fixed version of this library is available @ git and you can use it in your gradle like

compile 'com.github.Hitta:RippleEffect:82cf00e551'
repositories {
            ...
            maven { url "https://jitpack.io" }
        }
Hugibert answered 1/3, 2016 at 4:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.