forcing the send spacing to always be taking into account

- ensures all message lengths are consistent
This commit is contained in:
Adam Brown 2021-12-02 11:50:28 +00:00
parent 5cfebb764c
commit 3ff3507fa1
2 changed files with 7 additions and 7 deletions

View File

@ -20,7 +20,7 @@ import android.content.Context
import android.content.res.ColorStateList
import android.util.AttributeSet
import androidx.appcompat.widget.AppCompatImageView
import androidx.core.view.isVisible
import androidx.core.view.isInvisible
import im.vector.app.R
import im.vector.app.features.home.room.detail.timeline.item.SendStateDecoration
import im.vector.app.features.themes.ThemeUtils
@ -38,28 +38,28 @@ class SendStateImageView @JvmOverloads constructor(
}
fun render(sendState: SendStateDecoration) {
isVisible = when (sendState) {
isInvisible = when (sendState) {
SendStateDecoration.SENDING_NON_MEDIA -> {
setImageResource(R.drawable.ic_sending_message)
imageTintList = ColorStateList.valueOf(ThemeUtils.getColor(context, R.attr.vctr_content_tertiary))
contentDescription = context.getString(R.string.event_status_a11y_sending)
true
false
}
SendStateDecoration.SENT -> {
setImageResource(R.drawable.ic_message_sent)
imageTintList = ColorStateList.valueOf(ThemeUtils.getColor(context, R.attr.vctr_content_tertiary))
contentDescription = context.getString(R.string.event_status_a11y_sent)
true
false
}
SendStateDecoration.FAILED -> {
setImageResource(R.drawable.ic_sending_message_failed)
imageTintList = null
contentDescription = context.getString(R.string.event_status_a11y_failed)
true
false
}
SendStateDecoration.SENDING_MEDIA,
SendStateDecoration.NONE -> {
false
true
}
}
}

View File

@ -152,7 +152,7 @@
android:layout_marginBottom="4dp"
android:contentDescription="@string/event_status_a11y_sending"
android:src="@drawable/ic_sending_message"
android:visibility="gone"
android:visibility="invisible"
tools:tint="?vctr_content_tertiary"
tools:visibility="visible" />