Read receipts: just juste invisible on hidden avatars, to have a bigger touch zone

This commit is contained in:
ganfra 2019-08-13 15:06:00 +02:00
parent 06dcf75a32
commit b9cfda23b6
1 changed files with 6 additions and 5 deletions

View File

@ -18,8 +18,10 @@ package im.vector.riotx.core.ui.views
import android.content.Context import android.content.Context
import android.util.AttributeSet import android.util.AttributeSet
import android.view.View
import android.widget.ImageView import android.widget.ImageView
import android.widget.LinearLayout import android.widget.LinearLayout
import androidx.core.view.isInvisible
import androidx.core.view.isVisible import androidx.core.view.isVisible
import butterknife.ButterKnife import butterknife.ButterKnife
import im.vector.riotx.R import im.vector.riotx.R
@ -56,24 +58,23 @@ class ReadReceiptsView @JvmOverloads constructor(
for (index in 0 until MAX_RECEIPT_DISPLAYED) { for (index in 0 until MAX_RECEIPT_DISPLAYED) {
val receiptData = readReceipts.getOrNull(index) val receiptData = readReceipts.getOrNull(index)
if (receiptData == null) { if (receiptData == null) {
receiptAvatars[index].isVisible = false receiptAvatars[index].visibility = View.INVISIBLE
} else { } else {
receiptAvatars[index].isVisible = true receiptAvatars[index].visibility = View.VISIBLE
avatarRenderer.render(receiptData.avatarUrl, receiptData.userId, receiptData.displayName, receiptAvatars[index]) avatarRenderer.render(receiptData.avatarUrl, receiptData.userId, receiptData.displayName, receiptAvatars[index])
} }
} }
if (readReceipts.size > MAX_RECEIPT_DISPLAYED) { if (readReceipts.size > MAX_RECEIPT_DISPLAYED) {
receiptMore.isVisible = true receiptMore.visibility = View.VISIBLE
receiptMore.text = context.getString( receiptMore.text = context.getString(
R.string.x_plus, readReceipts.size - MAX_RECEIPT_DISPLAYED R.string.x_plus, readReceipts.size - MAX_RECEIPT_DISPLAYED
) )
} else { } else {
receiptMore.isVisible = false receiptMore.visibility = View.GONE
} }
} else { } else {
isVisible = false isVisible = false
} }
} }
} }