修复点击预览图片position错误问题
This commit is contained in:
@ -48,6 +48,7 @@ class ImageContainerView : LinearLayout {
|
||||
visibility = View.GONE
|
||||
return
|
||||
}
|
||||
visibility = View.VISIBLE
|
||||
if (mAnswerEntity?.type == "community_article") {
|
||||
//文章内只有视频
|
||||
if (entity.getPassVideos().isNotEmpty() && entity.images.isEmpty()) {
|
||||
@ -131,7 +132,11 @@ class ImageContainerView : LinearLayout {
|
||||
displayImage(binding, url, width.toFloat(), height.toFloat(), isChangeRatio)
|
||||
binding.root.setOnClickListener {
|
||||
if (mAnswerEntity == null) return@setOnClickListener
|
||||
val position = if (mAnswerEntity!!.getPassVideos().isNullOrEmpty()) binding.root.tag as Int else (binding.root.tag as Int) - 1
|
||||
val position = if (mAnswerEntity?.type == "community_article") {
|
||||
binding.root.tag as Int
|
||||
} else {
|
||||
if (mAnswerEntity!!.getPassVideos().isNullOrEmpty()) binding.root.tag as Int else (binding.root.tag as Int) - 1
|
||||
}
|
||||
val intent = ImageViewerActivity.getIntent(context, mAnswerEntity!!.images as ArrayList<String>, position, binding.root, mEntrance)
|
||||
context.startActivity(intent)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user