# E-signature
**Repository Path**: archermind-ti/E-signature
## Basic Information
- **Project Name**: E-signature
- **Description**: 本项目是基于开源项目 E-signature进行鸿蒙化的移植和开发的,通过项目标签以及github地址( https://github.com/venusic/E-signature )追踪到原安卓项目版本**
- **Primary Language**: Java
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 1
- **Forks**: 0
- **Created**: 2021-04-12
- **Last Updated**: 2023-10-20
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
## E-signature
### 项目介绍
电子签名
* 支持签名边缘裁剪
* 根据速度进行了插值改变宽度。
### 效果演示


### 安装教程
方式一:
1. 下载E-signature的模块代码添加到自己的工程
2. 关联使用
```
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
implementation project(":handwrite")
...
}
```
3. gradle sync
方式二:
```
allprojects {
repositories {
mavenCentral()
}
}
...
dependencies {
...
implementation 'com.gitee.archermind-ti:E-signature:1.0.0'
...
}
```
### 使用说明
- 添加View
```xml
```
- 保存
```java
if (hwView.isSign())
try {
if (isCrop) {
String path=getExternalFilesDir(Environment.DIRECTORY_PICTURES).getAbsolutePath()
+ File.separator + "ls.jpeg";
//暂无法实现自定义GlideModule,故不实现加密
//hwView.save(path, true, 10, true,this);
hwView.save(path,true,10,false,this);
Intent intent1 = new Intent();
intent1.setParam("path",path);
getAbility().setResult(101,intent1);
getAbility().terminateAbility();
} else {
String path=getExternalFilesDir(Environment.DIRECTORY_PICTURES).getAbsolutePath()
+ File.separator + "qm.jpeg";
hwView.save(path,this);
Intent intent2 = new Intent();
intent2.setParam("path",path);
getAbility().setResult(100, intent2);
getAbility().terminateAbility();
}
} catch (IOException e) {
e.printStackTrace();
}
else {
ToastDialog toastDialog = new ToastDialog(this);
toastDialog.setText("还没有签名!").setDuration(5000).show();
}
```
- 清除
```java
hwView.clear();
```
- 修改背景、笔宽、颜色
```java
//最小宽度、最大宽度
hwView.setPaintWidth(5, 20);
hwView.setPaintColor(Color.WHITE);
```
#### 遗留问题
openHarmony版本暂不提供Glide,无法实现自定义GlideModule
### 版本迭代
- v1.0.0