@@ -15,6 +15,7 @@ import androidx.compose.foundation.layout.height
1515import androidx.compose.foundation.layout.padding
1616import androidx.compose.foundation.layout.size
1717import androidx.compose.foundation.layout.FlowRow
18+ import androidx.compose.foundation.layout.navigationBarsPadding
1819import androidx.compose.foundation.lazy.LazyColumn
1920import androidx.compose.foundation.lazy.items
2021import androidx.compose.foundation.lazy.rememberLazyListState
@@ -124,15 +125,17 @@ fun HEConversationDetailScreen(
124125 bottomBar = {
125126 val status = ConversationStatus .fromStatus(conversation.status)
126127 val isClosed = status == ConversationStatus .CLOSED
127- if (isClosed) {
128- ClosedConversationBanner ()
129- } else {
130- ReplyButton (
131- enabled = ! isLoading,
132- onClick = {
133- onReplyBottomSheetVisibilityChange(true )
134- }
135- )
128+ Box (modifier = Modifier .navigationBarsPadding()) {
129+ if (isClosed) {
130+ ClosedConversationBanner ()
131+ } else {
132+ ReplyButton (
133+ enabled = ! isLoading,
134+ onClick = {
135+ onReplyBottomSheetVisibilityChange(true )
136+ }
137+ )
138+ }
136139 }
137140 }
138141 ) { contentPadding ->
@@ -148,35 +151,35 @@ fun HEConversationDetailScreen(
148151 state = listState,
149152 verticalArrangement = Arrangement .spacedBy(12 .dp)
150153 ) {
151- item {
152- ConversationHeader (
153- status = conversation.status,
154- lastUpdated = formatRelativeTime(conversation.lastMessageSentAt, resources),
155- isLoading = isLoading
156- )
157- }
154+ item {
155+ ConversationHeader (
156+ status = conversation.status,
157+ lastUpdated = formatRelativeTime(conversation.lastMessageSentAt, resources),
158+ isLoading = isLoading
159+ )
160+ }
158161
159- item {
160- ConversationTitleCard (title = conversation.title)
161- }
162+ item {
163+ ConversationTitleCard (title = conversation.title)
164+ }
162165
163- items(
164- items = conversation.messages,
165- key = { it.id }
166- ) { message ->
167- MessageItem (
168- message = message,
169- timestamp = formatRelativeTime(message.createdAt, resources),
170- onPreviewAttachment = { attachment -> previewAttachment = attachment },
171- onDownloadAttachment = onDownloadAttachment,
172- onGetAuthorizationHeaderArgument = onGetAuthorizationHeaderArgument
173- )
174- }
166+ items(
167+ items = conversation.messages,
168+ key = { it.id }
169+ ) { message ->
170+ MessageItem (
171+ message = message,
172+ timestamp = formatRelativeTime(message.createdAt, resources),
173+ onPreviewAttachment = { attachment -> previewAttachment = attachment },
174+ onDownloadAttachment = onDownloadAttachment,
175+ onGetAuthorizationHeaderArgument = onGetAuthorizationHeaderArgument
176+ )
177+ }
175178
176- item {
177- Spacer (modifier = Modifier .height(8 .dp))
179+ item {
180+ Spacer (modifier = Modifier .height(8 .dp))
181+ }
178182 }
179- }
180183
181184 if (isLoading) {
182185 CircularProgressIndicator (
@@ -238,6 +241,7 @@ fun HEConversationDetailScreen(
238241 }
239242 )
240243 }
244+
241245 AttachmentType .Video -> {
242246 AttachmentFullscreenVideoPlayer (
243247 videoUrl = attachment.url,
@@ -252,6 +256,7 @@ fun HEConversationDetailScreen(
252256 },
253257 )
254258 }
259+
255260 else -> {
256261 // For other types (documents, etc.), do nothing
257262 // They should only be downloadable, not previewable
@@ -269,12 +274,16 @@ private fun ConversationHeader(
269274 val statusText = when (ConversationStatus .fromStatus(status)) {
270275 ConversationStatus .WAITING_FOR_SUPPORT ->
271276 stringResource(R .string.he_support_status_waiting_for_support)
277+
272278 ConversationStatus .WAITING_FOR_USER ->
273279 stringResource(R .string.he_support_status_waiting_for_user)
280+
274281 ConversationStatus .SOLVED ->
275282 stringResource(R .string.he_support_status_solved)
283+
276284 ConversationStatus .CLOSED ->
277285 stringResource(R .string.he_support_status_closed)
286+
278287 ConversationStatus .UNKNOWN ->
279288 stringResource(R .string.he_support_status_unknown)
280289 }
@@ -478,7 +487,8 @@ private fun AttachmentItem(
478487 contentAlignment = Alignment .Center
479488 ) {
480489 if (attachment.type == AttachmentType .Image ||
481- attachment.type == AttachmentType .Video ) {
490+ attachment.type == AttachmentType .Video
491+ ) {
482492 // Show image/video preview for image and video attachments
483493 SubcomposeAsyncImage (
484494 model = ImageRequest .Builder (LocalContext .current)
@@ -602,8 +612,11 @@ private fun HEConversationDetailScreenPreviewContent(
602612}
603613
604614private object ConversationDetailPreviewAttachmentActionsListener : AttachmentActionsListener {
605- override fun onAddImageClick () { /* Preview stub */ }
606- override fun onRemoveImage (uri : Uri ) { /* Preview stub */ }
615+ override fun onAddImageClick () { /* Preview stub */
616+ }
617+
618+ override fun onRemoveImage (uri : Uri ) { /* Preview stub */
619+ }
607620}
608621
609622@Preview(showBackground = true , name = " HE Conversation Detail" )
0 commit comments