Skip to content

Commit

Permalink
Add audio clip image on Full Header in threads
Browse files Browse the repository at this point in the history
  • Loading branch information
ariel10aguero committed Aug 31, 2023
1 parent 3ed2e5d commit fb8040c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1493,7 +1493,8 @@ abstract class ChatViewModel<ARGS : NavArgs>(
viewState.bubbleMessage?.text,
viewState.bubbleImageAttachment,
viewState.bubbleVideoAttachment,
viewState.bubbleFileAttachment
viewState.bubbleFileAttachment,
viewState.bubbleAudioAttachment
)
threadHeaderViewState.updateViewState(threadHeader)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ sealed class ThreadHeaderViewState: ViewState<ThreadHeaderViewState>() {
val imageAttachment: LayoutState.Bubble.ContainerSecond.ImageAttachment? = null,
val videoAttachment: LayoutState.Bubble.ContainerSecond.VideoAttachment? = null,
val fileAttachment: LayoutState.Bubble.ContainerSecond.FileAttachment? = null,
val audioAttachment: LayoutState.Bubble.ContainerSecond.AudioAttachment? = null
): ThreadHeaderViewState()

}
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ internal class ChatTribeFragment: ChatFragment<
textViewInitialsName.apply {
text = (senderInfo.second?.value ?: "").getInitials()

senderInfo.third?.let { colorKey ->
senderInfo.third.let { colorKey ->
setBackgroundRandomColor(
chat.sphinx.chat_common.R.drawable.chat_initials_circle,
Color.parseColor(
Expand Down Expand Up @@ -840,10 +840,19 @@ internal class ChatTribeFragment: ChatFragment<
viewState.fileAttachment?.let { fileAttachment ->
layoutConstraintMediaContainer.visible
textViewAttachmentFileIcon.visible
textViewAttachmentFileIcon.text = getString(chat.sphinx.chat_common.R.string.material_icon_name_file_pdf)

(fileAttachment as? LayoutState.Bubble.ContainerSecond.FileAttachment.FileAvailable)?.let {
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 fb8040c

Please sign in to comment.