RichEditor onVideoClick 进行Catch操作

This commit is contained in:
kehaoyuan
2020-01-15 17:02:07 +08:00
parent 20b75ff046
commit d7b7f11ebf

View File

@ -56,18 +56,22 @@ class OnLinkClickListener(val context: Context,
@JavascriptInterface
fun onVideoClick(content: String) {
val videoEntity = GsonUtils.fromJson(content, MyVideoEntity::class.java)
if (videoEntity.status == "pass") {
DirectUtils.directToVideoDetail(context,
videoEntity.id,
VideoDetailContainerViewModel.Location.VIDEO_HOT.value,
showComment = false,
entrance = entrance,
path = "$path-视频")
} else if (videoEntity.status == "fail") {
Utils.toast(context, "视频审核未通过")
} else if (videoEntity.status == "pending") {
Utils.toast(context, "视频正在审核中")
AppExecutor.uiExecutor.execute {
tryWithDefaultCatch {
val videoEntity = GsonUtils.fromJson(content, MyVideoEntity::class.java)
if (videoEntity.status == "pass") {
DirectUtils.directToVideoDetail(context,
videoEntity.id,
VideoDetailContainerViewModel.Location.VIDEO_HOT.value,
showComment = false,
entrance = entrance,
path = "$path-视频")
} else if (videoEntity.status == "fail") {
Utils.toast(context, "视频审核未通过")
} else if (videoEntity.status == "pending") {
Utils.toast(context, "视频正在审核中")
}
}
}
}
}