Merge branch 'v1.5.0/privilege' into v1.5.0/test

This commit is contained in:
Max
2023-11-07 22:44:12 +08:00
2 changed files with 10 additions and 4 deletions

View File

@@ -205,8 +205,8 @@ class CreatePrivilegeCardDialog : BaseDialog<DialogCreatePrivilegeCardBinding>()
this,
canChooseGif = true,
resultCode = REQUEST_CODE_OPEN_PHOTO_PROVIDER,
maxFileSize = 1024 * 1024 * 20,
videoMaxSecond = 15,
// maxFileSize = 1024 * 1024 * 20,
// videoMaxSecond = 15,
showVideoType = "mp4"
)
}
@@ -484,6 +484,14 @@ class CreatePrivilegeCardDialog : BaseDialog<DialogCreatePrivilegeCardBinding>()
val path = photo.path
Log.d(TAG, "onPhotoResult path:$path")
if (path.endsWith("mp4") || photo.type.endsWith(Type.VIDEO)) {
if (photo.duration > 15 * 1000) {
SingleToastUtil.showToast("视频时长不能超过15秒")
return
}
if (photo.size > (1024 * 1024 * 20)) {
SingleToastUtil.showToast("上传文件最大不能超过20M")
return
}
uploadVideo(photo)
} else if (photo.path.endsWith(Type.GIF) || photo.type.endsWith(Type.GIF)) {
uploadGif(path)

View File

@@ -434,11 +434,9 @@ class GlideUtils {
Logger.error(TAG, "loadUriGift imageView is null")
return
}
val options = RequestOptions().diskCacheStrategy(DiskCacheStrategy.RESOURCE)
getGlideConfig(imageView.context)?.apply {
this.asBitmap()
.load(uri)
.apply(options)
.into(imageView)
}
}