add message info item in menu

This commit is contained in:
Ryan Zhao 2021-07-13 14:42:16 +10:00
parent 15d74137d0
commit 0211239360
3 changed files with 15 additions and 1 deletions

View File

@ -1228,6 +1228,10 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
endActionMode() endActionMode()
} }
override fun showMessageDetail(messages: Set<MessageRecord>) {
TODO("Not yet implemented")
}
override fun saveAttachment(messages: Set<MessageRecord>) { override fun saveAttachment(messages: Set<MessageRecord>) {
val message = messages.first() as MmsMessageRecord val message = messages.first() as MmsMessageRecord
SaveAttachmentTask.showWarningDialog(this, { _, _ -> SaveAttachmentTask.showWarningDialog(this, { _, _ ->

View File

@ -56,6 +56,8 @@ class ConversationActionModeCallback(private val adapter: ConversationAdapter, p
// Copy Session ID // Copy Session ID
menu.findItem(R.id.menu_context_copy_public_key).isVisible = menu.findItem(R.id.menu_context_copy_public_key).isVisible =
(thread.isGroupRecipient && selectedItems.size == 1 && firstMessage.recipient.address.toString() != userPublicKey) (thread.isGroupRecipient && selectedItems.size == 1 && firstMessage.recipient.address.toString() != userPublicKey)
// Message detail
menu.findItem(R.id.menu_message_details).isVisible = (selectedItems.size == 1 && firstMessage.isFailed)
// Resend // Resend
menu.findItem(R.id.menu_context_resend).isVisible = (selectedItems.size == 1 && firstMessage.isFailed) menu.findItem(R.id.menu_context_resend).isVisible = (selectedItems.size == 1 && firstMessage.isFailed)
// Save media // Save media
@ -78,6 +80,7 @@ class ConversationActionModeCallback(private val adapter: ConversationAdapter, p
R.id.menu_context_copy -> delegate?.copyMessages(selectedItems) R.id.menu_context_copy -> delegate?.copyMessages(selectedItems)
R.id.menu_context_copy_public_key -> delegate?.copySessionID(selectedItems) R.id.menu_context_copy_public_key -> delegate?.copySessionID(selectedItems)
R.id.menu_context_resend -> delegate?.resendMessage(selectedItems) R.id.menu_context_resend -> delegate?.resendMessage(selectedItems)
R.id.menu_message_details -> delegate?.showMessageDetail(selectedItems)
R.id.menu_context_save_attachment -> delegate?.saveAttachment(selectedItems) R.id.menu_context_save_attachment -> delegate?.saveAttachment(selectedItems)
R.id.menu_context_reply -> delegate?.reply(selectedItems) R.id.menu_context_reply -> delegate?.reply(selectedItems)
} }
@ -97,6 +100,7 @@ interface ConversationActionModeCallbackDelegate {
fun copyMessages(messages: Set<MessageRecord>) fun copyMessages(messages: Set<MessageRecord>)
fun copySessionID(messages: Set<MessageRecord>) fun copySessionID(messages: Set<MessageRecord>)
fun resendMessage(messages: Set<MessageRecord>) fun resendMessage(messages: Set<MessageRecord>)
fun showMessageDetail(messages: Set<MessageRecord>)
fun saveAttachment(messages: Set<MessageRecord>) fun saveAttachment(messages: Set<MessageRecord>)
fun reply(messages: Set<MessageRecord>) fun reply(messages: Set<MessageRecord>)
} }

View File

@ -21,6 +21,12 @@
android:icon="?menu_trash_icon" android:icon="?menu_trash_icon"
app:showAsAction="always" /> app:showAsAction="always" />
<item
android:title="@string/details"
android:id="@+id/menu_message_details"
android:icon="?menu_info_icon"
app:showAsAction="always" />
<item <item
android:title="@string/conversation_context__menu_copy_text" android:title="@string/conversation_context__menu_copy_text"
android:id="@+id/menu_context_copy" android:id="@+id/menu_context_copy"
@ -38,7 +44,7 @@
app:showAsAction="never" /> app:showAsAction="never" />
<item <item
android:title="@string/activity_conversation_copy_public_key_button_title" android:title="@string/activity_conversation_menu_copy_session_id"
android:id="@+id/menu_context_copy_public_key" android:id="@+id/menu_context_copy_public_key"
app:showAsAction="never" /> app:showAsAction="never" />