Skip to content

Commit

Permalink
Corrected ui dimentions for each media attachment on reply thread
Browse files Browse the repository at this point in the history
  • Loading branch information
ariel10aguero committed Aug 31, 2023
1 parent fb8040c commit 4f90fcb
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1066,12 +1066,33 @@ internal inline fun LayoutMessageHolderBinding.setBubbleThreadLayout(

when (thread.mediaAttachment) {
is LayoutState.Bubble.ContainerSecond.ImageAttachment -> {
constraintMediaThreadContainer.visible

includeMessageTypeImageAttachment.root.visible
includeMessageTypeVideoAttachment.root.gone
includeMessageTypeAudioAttachment.root.gone
includeMessageTypeFileAttachment.root.gone

setBubbleImageAttachment(thread.mediaAttachment, true, lastReplyImage)
}
is LayoutState.Bubble.ContainerSecond.VideoAttachment -> {
constraintMediaThreadContainer.visible

includeMessageTypeImageAttachment.root.gone
includeMessageTypeVideoAttachment.root.visible
includeMessageTypeAudioAttachment.root.gone
includeMessageTypeFileAttachment.root.gone

setBubbleVideoAttachment(thread.mediaAttachment, true)
}
is LayoutState.Bubble.ContainerSecond.AudioAttachment -> {
constraintMediaThreadContainer.visible

includeMessageTypeImageAttachment.root.gone
includeMessageTypeVideoAttachment.root.gone
includeMessageTypeAudioAttachment.root.visible
includeMessageTypeFileAttachment.root.gone

setBubbleAudioAttachment(
thread.mediaAttachment,
audioPlayerController,
Expand All @@ -1081,8 +1102,18 @@ internal inline fun LayoutMessageHolderBinding.setBubbleThreadLayout(
true)
}
is LayoutState.Bubble.ContainerSecond.FileAttachment -> {
constraintMediaThreadContainer.visible

includeMessageTypeImageAttachment.root.gone
includeMessageTypeVideoAttachment.root.gone
includeMessageTypeAudioAttachment.root.gone
includeMessageTypeFileAttachment.root.visible

setBubbleFileAttachment(thread.mediaAttachment, true)
}
else -> {
constraintMediaThreadContainer.gone
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ internal class ChatTribeFragment: ChatFragment<
)
}

viewState.senderAlias?.let { senderAlias ->
viewState.senderAlias.let { senderAlias ->
textViewPinnedBottomBodyUsername.text = senderAlias
textViewPinnedBottomBodyUsername.setTextColor(
Color.parseColor(
Expand Down Expand Up @@ -814,7 +814,7 @@ internal class ChatTribeFragment: ChatFragment<
it,
ImageLoaderOptions.Builder().build()
)
} ?: imageAttachment?.url?.let {
} ?: imageAttachment.url.let {
imageLoader.load(
imageViewElementPicture,
it,
Expand Down Expand Up @@ -846,12 +846,12 @@ internal class ChatTribeFragment: ChatFragment<
threadOriginalMessageBinding?.textViewThreadMessageContent?.text = it.fileName?.value ?: "Unnamed File"
}
}

viewState.audioAttachment?.let { audioAttachment ->
layoutConstraintMediaContainer.visible
textViewAttachmentFileIcon.visible
textViewAttachmentFileIcon.text = getString(chat.sphinx.chat_common.R.string.material_icon_name_volume_up)
threadOriginalMessageBinding?.textViewThreadMessageContent?.text = "Audio Clip"

}
}
}
Expand Down

0 comments on commit 4f90fcb

Please sign in to comment.