android-signaturepad icon indicating copy to clipboard operation
android-signaturepad copied to clipboard

saving instance state may throw due to zero bounds

Open masc3d opened this issue 4 years ago • 8 comments

on rare occasions

java.lang.IllegalArgumentException: width and height must be > 0
        at android.graphics.Bitmap.createBitmap(Bitmap.java:829)
        at android.graphics.Bitmap.createBitmap(Bitmap.java:808)
        at android.graphics.Bitmap.createBitmap(Bitmap.java:775)
        at com.github.gcacace.signaturepad.views.SignaturePad.d()
        at com.github.gcacace.signaturepad.views.SignaturePad.getTransparentSignatureBitmap()
        at com.github.gcacace.signaturepad.views.SignaturePad.onSaveInstanceState()

masc3d avatar Mar 31 '20 11:03 masc3d

Having the same issue when the view Visibility is GONE and close the fragment will crash.

MrFuFuFu avatar Aug 30 '20 23:08 MrFuFuFu

Any idea how to mitigate this ?

assaneonline avatar Aug 31 '20 09:08 assaneonline

as long as this is not merged, you could use com.github.masc3d:android-signaturepad:b60f117e instead. requires jitpack repository maven { url 'https://jitpack.io' }

masc3d avatar Aug 31 '20 15:08 masc3d

Any news about merging this PR?

Tgo1014 avatar Sep 30 '21 08:09 Tgo1014

I saw this PR is merged, but not showing on v1.3.1 when import using gradle?

achall9 avatar May 30 '22 14:05 achall9

I am also encountering this issue on v1.3.1. @masc3d What is the status of the fix?

tristanlarsin avatar Jun 02 '22 15:06 tristanlarsin

i have same issue , is this issue fixed?

padideh avatar Sep 27 '22 21:09 padideh

Here's a temporary fix I did to prevent this - Add android:saveEnabled="false" to the xml layout

<com.github.gcacace.signaturepad.views.SignaturePad
    android:id="@+id/signature_pad"
    android:saveEnabled="false"
    ...
    />

tristanlarsin avatar Sep 27 '22 21:09 tristanlarsin