Message Details Screen: Java/XML to Kotlin/Compose migration#145
Conversation
587c0ee to
de5423d
Compare
| subject = when (type) { | ||
| ConversationMessageDetails.Type.MMS -> cleansedSubject | ||
| ConversationMessageDetails.Type.SMS -> null | ||
| }, |
There was a problem hiding this comment.
The subject is mapped here but doesn't seem to be shown in UI
There was a problem hiding this comment.
The subject appears in the message preview. I'll remove it from the mapper
|
|
||
| return ConversationMessageDetails( | ||
| type = type, | ||
| sender = message.senderNormalizedDestination?.takeIf(String::isNotBlank), |
There was a problem hiding this comment.
Old code shows a placeholder R.string.hidden_sender_address:
Messaging/src/com/android/messaging/ui/conversation/MessageDetailsDialog.java
Lines 167 to 172 in 736203e
There was a problem hiding this comment.
I see, then I'm good with leaving it removed then
| @@ -555,8 +565,6 @@ | |||
| <string name="priority_low">Low</string> | |||
| <!-- SIM identified using the slot number. e.g. SIM 1 --> | |||
| <string name="sim_slot_identifier">SIM <xliff:g id="sim_slot_number">%s</xliff:g></string> | |||
| <!-- Sender to be used if the sender address has been hidden --> | |||
| <string name="hidden_sender_address">Hidden sender address</string> | |||
There was a problem hiding this comment.
These removed strings are still in other locale files
| val message = conversationsRepository.getConversationMessage( | ||
| conversationId = conversationId, | ||
| messageId = messageId, | ||
| ) | ||
| val details = conversationsRepository.getMessageDetails( | ||
| conversationId = conversationId, | ||
| messageId = messageId, | ||
| ) |
There was a problem hiding this comment.
nit: this makes two db calls loading the selected message twice
| MessageDetailsPreviewCard( | ||
| preview = content.preview, | ||
| details = details, | ||
| ) | ||
|
|
||
| MessageDetailsMessageFields(details = details) | ||
|
|
||
| if (details.sentTimestamp != null || details.receivedTimestamp != null) { | ||
| MessageDetailsStatusSection( | ||
| sentTimestamp = details.sentTimestamp, | ||
| receivedTimestamp = details.receivedTimestamp, | ||
| ) | ||
| } | ||
|
|
||
| MessageDetailsDeliveryFields(details = details) | ||
|
|
||
| details.debug?.let { debug -> | ||
| MessageDetailsDebugSection(debug = debug) | ||
| } |
There was a problem hiding this comment.
Also it might be useful to make the text values copyable

Migrated the Message Details screen from Java + XML to Kotlin + Compose. It shows the message content, recipients, delivery info, SIM details, and debug fields when available.
Screenshots