From b9cfda23b6497957a9bf6551139815a684040354 Mon Sep 17 00:00:00 2001 From: ganfra Date: Tue, 13 Aug 2019 15:06:00 +0200 Subject: [PATCH] Read receipts: just juste invisible on hidden avatars, to have a bigger touch zone --- .../im/vector/riotx/core/ui/views/ReadReceiptsView.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/vector/src/main/java/im/vector/riotx/core/ui/views/ReadReceiptsView.kt b/vector/src/main/java/im/vector/riotx/core/ui/views/ReadReceiptsView.kt index 6293e22b..44d1ee6f 100644 --- a/vector/src/main/java/im/vector/riotx/core/ui/views/ReadReceiptsView.kt +++ b/vector/src/main/java/im/vector/riotx/core/ui/views/ReadReceiptsView.kt @@ -18,8 +18,10 @@ package im.vector.riotx.core.ui.views import android.content.Context import android.util.AttributeSet +import android.view.View import android.widget.ImageView import android.widget.LinearLayout +import androidx.core.view.isInvisible import androidx.core.view.isVisible import butterknife.ButterKnife import im.vector.riotx.R @@ -56,24 +58,23 @@ class ReadReceiptsView @JvmOverloads constructor( for (index in 0 until MAX_RECEIPT_DISPLAYED) { val receiptData = readReceipts.getOrNull(index) if (receiptData == null) { - receiptAvatars[index].isVisible = false + receiptAvatars[index].visibility = View.INVISIBLE } else { - receiptAvatars[index].isVisible = true + receiptAvatars[index].visibility = View.VISIBLE avatarRenderer.render(receiptData.avatarUrl, receiptData.userId, receiptData.displayName, receiptAvatars[index]) } } if (readReceipts.size > MAX_RECEIPT_DISPLAYED) { - receiptMore.isVisible = true + receiptMore.visibility = View.VISIBLE receiptMore.text = context.getString( R.string.x_plus, readReceipts.size - MAX_RECEIPT_DISPLAYED ) } else { - receiptMore.isVisible = false + receiptMore.visibility = View.GONE } } else { isVisible = false } - } }