An Smooth and silky signature pad for android
Java
Latest commit a6488e4 Dec 30, 2016 @ww6015132 compress method added
Permalink
Failed to load latest commit information.
.idea compress method added Dec 30, 2016
app compress method added Dec 30, 2016
gradle/wrapper first commit Nov 28, 2016
silky-signature compress method added Dec 30, 2016
.gitignore first commit Nov 28, 2016
Liscense some file added Dec 2, 2016
README.md compress method added Dec 30, 2016
build.gradle first commit Nov 28, 2016
gradle.properties first commit Nov 28, 2016
gradlew first commit Nov 28, 2016
gradlew.bat first commit Nov 28, 2016
settings.gradle first commit Nov 28, 2016
signature.png screenshot added Nov 28, 2016

README.md

SilkySignature

A smooth and silky signature pad for android.

app screenshot

Updates

Method added

  • getCompressedSignatureBitmap(int compressLevel) - compressLeven is from 1-100, which mean compress percentage of bitmap
  • getFixedSizeSignatureBitmap(int desiredWidth) - desiredWidth is target width, which would adjust height automatically
  • getFixedSizeSignatureBitmap(int desiredWidth,int desiredHeight) - desiredWidth is target width and desiredHeight is target height

Download

Download SilkySignature or grab via Gradle:

compile 'com.williamww:silky-signature:0.0.8'

or via Maven

<dependency>
<groupId>com.williamww</groupId>
<artifactId>silky-signature</artifactId>
<version>0.0.8</version>
<type>aar</type>
</dependency>

Note

You MUST request runtime permission when you are trying to save the signature image on version 6.0 or higher!

Example

Add this to layout file

<com.williamww.silkysignature.views.SignaturePad
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/signature_pad"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:penColor="@android:color/black"
/>

Control in code

mSignaturePad = (SignaturePad) findViewById(R.id.signature_pad);
mSignaturePad.setOnSignedListener(new SignaturePad.OnSignedListener() {
@Override
public void onSigned() {
//Event triggered when the pad is signed
}

@Override
public void onClear() {
//Event triggered when the pad is cleared
}
});

To get signature image

  • getSignatureBitmap() - A signature bitmap with a white background.
  • getTransparentSignatureBitmap() - A signature bitmap with a transparent background.
  • getSignatureSvg() - A signature Scalable Vector Graphics document.