身份证拍照框2.0

This commit is contained in:
2024-05-11 11:37:46 +08:00
parent 4650884846
commit be767e7d46
18 changed files with 362 additions and 123 deletions
@@ -57,6 +57,7 @@ class PopNorBottomPic(
// 单独拍照
val cameraModel: PictureSelectionCameraModel = PictureSelector.create(context)
.openCamera(SelectMimeType.TYPE_IMAGE)
.setCompressEngine(ImageFileCompressEngine())
// .setCameraInterceptListener(getCustomCameraEvent())//自定义相机
// .setRecordAudioInterceptListener(MainActivity.MeOnRecordAudioInterceptListener())//录音回调事件
// .setCropEngine(ImageFileCropEngine())//裁剪
@@ -22,7 +22,7 @@ class ImageFileCompressEngine : CompressFileEngine {
source: ArrayList<Uri>?,
call: OnKeyValueResultCallbackListener?
) {
Luban.with(context).load(source).ignoreBy(100).setRenameListener { filePath ->
Luban.with(context).load(source).ignoreBy(30).setRenameListener { filePath ->
val indexOf = filePath.lastIndexOf(".")
val postfix = if (indexOf != -1) filePath.substring(indexOf) else ".jpg"
DateUtils.getCreateFileName("CMP_") + postfix