项目作者: nawanirakshit

项目描述 :
Signature Capture Repository
高级语言: Java
项目地址: git://github.com/nawanirakshit/Signature-Capture.git
创建时间: 2018-06-11T11:34:28Z
项目社区:https://github.com/nawanirakshit/Signature-Capture

开源协议:Apache License 2.0

下载


Signature Capture

Simple code to take the Signature of the customer/client according to need

How to add gradle in your code

In top Level build file add the below code

  1. repositories {
  2. //other stuff here
  3. maven { url 'https://jitpack.io' }
  4. }
  5. }

Then in project level build file add the below line

  1. implementation 'com.github.nawanirakshit:Signature-Capture:1.1'

This will add the required functionality to you project

Usage

  1. <com.rakshit.signaturecapture.CaptureSignature
  2. android:id="@+id/signature_canvas"
  3. android:layout_width="match_parent"
  4. android:layout_height="match_parent"
  5. app:pen_color="#ea0b46" //optional
  6. app:pen_size="7dp" //optional
  7. android:background="#edeeef" //optional ></com.rakshit.signaturecapture.CaptureSignature>

You can change background color according to your need

Method to check if view is updated on not

  1. initialize the CaptureSignature as signature
  2. if (signature.isUpdated()) {
  3. Toast.makeText(mContext, "View Updated", Toast.LENGTH_SHORT).show();
  4. //View is updated
  5. } else {
  6. Toast.makeText(mContext, "View not Updated", Toast.LENGTH_SHORT).show();
  7. //View not updated
  8. }

To get the bitmap of the Signature captured

  1. Bitmap bmp = signature.getViewBitmap(signature);

More changes to be added soon.

You can add your suggestions if needed will add them accordingly.