5 Star 0 Fork 0

Archermind-TI / E-signature

Create your Gitee Account
Explore and code with more than 8 million developers,Free private repositories !:)
Sign up
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

E-signature

项目介绍

电子签名

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

效果演示

图片 20210409152025

图片20210409152026

安装教程

方式一:

  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
<DirectionalLayout
    xmlns:ohos="http://schemas.huawei.com/res/ohos"
    ohos:height="match_parent"
    ohos:width="match_parent"
    ohos:orientation="vertical"
    ohos:total_weight="1">


    <com.archermind.handwrite.view.HandWriteView
        ohos:id="$+id:handwriting"
        ohos:height="0px"
        ohos:width="match_parent"
        ohos:weight="0.99"
        ohos:background_element="#000000"
        />
	<!-- 按钮组件	 -->
</DirectionalLayout>
  • 保存
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();
            }
  • 清除
hwView.clear();
  • 修改背景、笔宽、颜色
    //最小宽度、最大宽度
  hwView.setPaintWidth(5, 20);
  hwView.setPaintColor(Color.WHITE);

遗留问题

openHarmony版本暂不提供Glide,无法实现自定义GlideModule

版本迭代

  • v1.0.0

About

本项目是基于开源项目 E-signature进行鸿蒙化的移植和开发的,通过项目标签以及github地址( https://github.com/venusic/E-signature )追踪到原安卓项目版本** expand collapse
Java
Apache-2.0
Cancel

Releases (1)

All

Contributors

All

Activities

Load More
can not load any more
Java
1
https://gitee.com/archermind-ti/E-signature.git
git@gitee.com:archermind-ti/E-signature.git
archermind-ti
E-signature
E-signature
master

Search