IllegalStateException using Ripple effects library on Android M devices

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

On Android M, Devices receiving an IllegalStateException that say that Underflow in restore will restore more than save

 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) 
+6
source share
1 answer

It looks like an error in the library itself on Android 6.0, Possible ways to avoid the error:

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

2) Or you can use a separate layout of the place for 21+, let Android M cope with the wave itself. Just use a suitable ripple holder for layouts and views

3) Or you can change the source code of the library as this sentence

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

 compile 'com.github.Hitta:RippleEffect:82cf00e551' repositories { ... maven { url "https://jitpack.io" } } 
+4
source

All Articles