mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-28 09:38:14 +03:00
fix to immediately view placeholder + set min height
without this fix, "getPayloadForImageLoader" was called before the placeholder was set (so it was null until getPayloadForImageLoader was called again after ~30seconds.). This is fixed by calling the super method at the end of "onBind". min height was set to avoid very tiny previews (like for the placeholders) Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
2ddb0782f3
commit
5ba6148273
1 changed files with 5 additions and 1 deletions
|
@ -105,7 +105,8 @@ abstract class PreviewMessageViewHolder(itemView: View?, payload: Any?) :
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
@Suppress("NestedBlockDepth", "ComplexMethod", "LongMethod")
|
@Suppress("NestedBlockDepth", "ComplexMethod", "LongMethod")
|
||||||
override fun onBind(message: ChatMessage) {
|
override fun onBind(message: ChatMessage) {
|
||||||
super.onBind(message)
|
image.minimumHeight = DisplayUtils.convertDpToPixel(MIN_IMAGE_HEIGHT, context).toInt()
|
||||||
|
|
||||||
time.text = dateUtils.getLocalTimeStringFromTimestamp(message.timestamp)
|
time.text = dateUtils.getLocalTimeStringFromTimestamp(message.timestamp)
|
||||||
if (userAvatar != null) {
|
if (userAvatar != null) {
|
||||||
if (message.isGrouped || message.isOneToOneConversation) {
|
if (message.isGrouped || message.isOneToOneConversation) {
|
||||||
|
@ -228,6 +229,8 @@ abstract class PreviewMessageViewHolder(itemView: View?, payload: Any?) :
|
||||||
true,
|
true,
|
||||||
viewThemeUtils!!
|
viewThemeUtils!!
|
||||||
)
|
)
|
||||||
|
|
||||||
|
super.onBind(message)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun longClickOnReaction(chatMessage: ChatMessage) {
|
private fun longClickOnReaction(chatMessage: ChatMessage) {
|
||||||
|
@ -341,5 +344,6 @@ abstract class PreviewMessageViewHolder(itemView: View?, payload: Any?) :
|
||||||
const val ACTOR_TYPE_BOTS = "bots"
|
const val ACTOR_TYPE_BOTS = "bots"
|
||||||
const val ACTOR_ID_CHANGELOG = "changelog"
|
const val ACTOR_ID_CHANGELOG = "changelog"
|
||||||
const val KEY_NAME = "name"
|
const val KEY_NAME = "name"
|
||||||
|
const val MIN_IMAGE_HEIGHT = 100F
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue