Merge branch 'v1.5.0/privilege' into v1.5.0/test
This commit is contained in:
@@ -205,8 +205,8 @@ class CreatePrivilegeCardDialog : BaseDialog<DialogCreatePrivilegeCardBinding>()
|
|||||||
this,
|
this,
|
||||||
canChooseGif = true,
|
canChooseGif = true,
|
||||||
resultCode = REQUEST_CODE_OPEN_PHOTO_PROVIDER,
|
resultCode = REQUEST_CODE_OPEN_PHOTO_PROVIDER,
|
||||||
maxFileSize = 1024 * 1024 * 20,
|
// maxFileSize = 1024 * 1024 * 20,
|
||||||
videoMaxSecond = 15,
|
// videoMaxSecond = 15,
|
||||||
showVideoType = "mp4"
|
showVideoType = "mp4"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -484,6 +484,14 @@ class CreatePrivilegeCardDialog : BaseDialog<DialogCreatePrivilegeCardBinding>()
|
|||||||
val path = photo.path
|
val path = photo.path
|
||||||
Log.d(TAG, "onPhotoResult path:$path")
|
Log.d(TAG, "onPhotoResult path:$path")
|
||||||
if (path.endsWith("mp4") || photo.type.endsWith(Type.VIDEO)) {
|
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)
|
uploadVideo(photo)
|
||||||
} else if (photo.path.endsWith(Type.GIF) || photo.type.endsWith(Type.GIF)) {
|
} else if (photo.path.endsWith(Type.GIF) || photo.type.endsWith(Type.GIF)) {
|
||||||
uploadGif(path)
|
uploadGif(path)
|
||||||
|
@@ -434,11 +434,9 @@ class GlideUtils {
|
|||||||
Logger.error(TAG, "loadUriGift imageView is null")
|
Logger.error(TAG, "loadUriGift imageView is null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
val options = RequestOptions().diskCacheStrategy(DiskCacheStrategy.RESOURCE)
|
|
||||||
getGlideConfig(imageView.context)?.apply {
|
getGlideConfig(imageView.context)?.apply {
|
||||||
this.asBitmap()
|
this.asBitmap()
|
||||||
.load(uri)
|
.load(uri)
|
||||||
.apply(options)
|
|
||||||
.into(imageView)
|
.into(imageView)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user