Giter VIP home page Giter VIP logo

e-signature's Introduction

(安卓电子签名简介)E-signature for Android V0.2

  • 支持签名边缘裁剪
  • 根据速度进行了插值改变宽度。

Gradle 添加:

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}
	
	dependencies {
    	        compile 'com.github.venusic:E-signature:${last_version}'
    	}

使用

  • 添加View
     <com.venusic.handwrite.view.HandWriteView
               android:id="@+id/view"
               android:layout_width="match_parent"
               app:paintMaxWidth="20px" //最大宽度
               app:paintMinWidth="10px" //最小宽度
               app:paintColor="#FF0000" //颜色
               android:layout_height="match_parent"/>
  • 保存
if (view.isSign()) {
    try {
        //路径
        //是否清除边缘空白
        //边缘保留多少像素空白
        //是否加密存储 如果加密存储会自动在路径后面追加后缀.sign
        view.save(MainActivity.path1, true, 10,true);
    } catch (IOException e) {
        e.printStackTrace();
    }
} else {
    Toast.makeText(context, "您没有签名~", Toast.LENGTH_SHORT).show();
}

  • 清除
view.clear();
  • 修改背景、笔宽、颜色
    //最小宽度、最大宽度
  view.setPaintWidth(10,20);
  view.setPaintColor(Color.WHITE);
  view.clear();
  • 加密存储 使用SignFileInputStreamSignFileOutputStream进行读写操作即可。如果使用Glide加载图片,可以在AndroidManifest.xml注册GlideModel:
   <application>
       
        <meta-data
            android:name="com.venusic.handwrite.glide.SignFileModel"
            android:value="GlideModule"/>
   </application>

然后即可使用Glide正常加载加密之后的签名文件。

效果图

Logo

Logo

e-signature's People

Contributors

venusic avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.