From 80a2e4f33617dcd487bde0a63aed1726b94e7afb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=8E=89=E4=B9=85?= <1484288157@qq.com> Date: Thu, 17 Dec 2020 17:24:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=82=B9=E5=87=BB=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E5=9B=BE=E7=89=87position=E9=94=99=E8=AF=AF=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/gh/common/view/ImageContainerView.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/gh/common/view/ImageContainerView.kt b/app/src/main/java/com/gh/common/view/ImageContainerView.kt index 4f4339a3ea..d9ab77a433 100644 --- a/app/src/main/java/com/gh/common/view/ImageContainerView.kt +++ b/app/src/main/java/com/gh/common/view/ImageContainerView.kt @@ -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, position, binding.root, mEntrance) context.startActivity(intent) }