diff --git a/app/src/main/java/org/thoughtcrime/securesms/messagedetails/MessageDetailsAdapter.java b/app/src/main/java/org/thoughtcrime/securesms/messagedetails/MessageDetailsAdapter.java index b00e1ffbec..51b74d2c5e 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/messagedetails/MessageDetailsAdapter.java +++ b/app/src/main/java/org/thoughtcrime/securesms/messagedetails/MessageDetailsAdapter.java @@ -12,6 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.bumptech.glide.RequestManager; +import org.thoughtcrime.securesms.BindableConversationItem; import org.thoughtcrime.securesms.R; import org.thoughtcrime.securesms.conversation.ConversationMessage; import org.thoughtcrime.securesms.conversation.colors.Colorizer; @@ -127,7 +128,7 @@ final class MessageDetailsAdapter extends ListAdapter().voiceNoteMediaController + override fun getTitle() = R.string.AndroidManifest__message_details override fun getDialogLayoutResource() = R.layout.message_details_fragment @@ -145,11 +165,229 @@ class MessageDetailsFragment : FullScreenDialogFragment(), MessageDetailsAdapter create(record).show(parentFragmentManager, InternalMessageDetailsFragment::class.java.simpleName) } + override fun onQuoteClicked(messageRecord: MmsMessageRecord?) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onLinkPreviewClicked(linkPreview: LinkPreview) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onQuotedIndicatorClicked(messageRecord: MessageRecord) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onMoreTextClicked(conversationRecipientId: RecipientId, messageId: Long, isMms: Boolean) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onStickerClicked(stickerLocator: StickerLocator) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onViewOnceMessageClicked(messageRecord: MmsMessageRecord) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onSharedContactDetailsClicked(contact: Contact, avatarTransitionView: View) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onAddToContactsClicked(contact: Contact) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onMessageSharedContactClicked(choices: MutableList) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onInviteSharedContactClicked(choices: MutableList) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onReactionClicked(multiselectPart: MultiselectPart, messageId: Long, isMms: Boolean) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onGroupMemberClicked(recipientId: RecipientId, groupId: GroupId) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onMessageWithErrorClicked(messageRecord: MessageRecord) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onMessageWithRecaptchaNeededClicked(messageRecord: MessageRecord) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onIncomingIdentityMismatchClicked(recipientId: RecipientId) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onRegisterVoiceNoteCallbacks(onPlaybackStartObserver: Observer) { + getVoiceNoteMediaController() + .voiceNotePlaybackState + .observe(viewLifecycleOwner, onPlaybackStartObserver) + } + + override fun onUnregisterVoiceNoteCallbacks(onPlaybackStartObserver: Observer) { + getVoiceNoteMediaController() + .voiceNotePlaybackState + .removeObserver(onPlaybackStartObserver) + } + + override fun onVoiceNotePause(uri: Uri) { + getVoiceNoteMediaController().pausePlayback(uri) + } + + override fun onVoiceNotePlay(uri: Uri, messageId: Long, position: Double) { + getVoiceNoteMediaController().startConsecutivePlayback(uri, messageId, position) + } + + override fun onVoiceNoteSeekTo(uri: Uri, position: Double) { + getVoiceNoteMediaController().seekToPosition(uri, position) + } + + override fun onVoiceNotePlaybackSpeedChanged(uri: Uri, speed: Float) { + getVoiceNoteMediaController().setPlaybackSpeed(uri, speed) + } + + override fun onGroupMigrationLearnMoreClicked(membershipChange: GroupMigrationMembershipChange) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onChatSessionRefreshLearnMoreClicked() { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onBadDecryptLearnMoreClicked(author: RecipientId) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onSafetyNumberLearnMoreClicked(recipient: Recipient) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onJoinGroupCallClicked() { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onInviteFriendsToGroupClicked(groupId: GroupId.V2) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onEnableCallNotificationsClicked() { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onPlayInlineContent(conversationMessage: ConversationMessage?) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onInMemoryMessageClicked(messageRecord: InMemoryMessageRecord) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onViewGroupDescriptionChange(groupId: GroupId?, description: String, isMessageRequestAccepted: Boolean) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onChangeNumberUpdateContact(recipient: Recipient) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onChangeProfileNameUpdateContact(recipient: Recipient) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onCallToAction(action: String) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onDonateClicked() { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onBlockJoinRequest(recipient: Recipient) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onRecipientNameClicked(target: RecipientId) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onInviteToSignalClicked() { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onActivatePaymentsClicked() { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onSendPaymentClicked(recipientId: RecipientId) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onScheduledIndicatorClicked(view: View, conversationMessage: ConversationMessage) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onUrlClicked(url: String): Boolean { + Log.w(TAG, "Not yet implemented!", Exception()) + return false + } + + override fun onViewGiftBadgeClicked(messageRecord: MessageRecord) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onGiftBadgeRevealed(messageRecord: MessageRecord) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun goToMediaPreview(parent: ConversationItem?, sharedElement: View?, args: MediaPreviewArgs?) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onEditedIndicatorClicked(conversationMessage: ConversationMessage) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onShowGroupDescriptionClicked(groupName: String, description: String, shouldLinkifyWebLinks: Boolean) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onJoinCallLink(callLinkRootKey: CallLinkRootKey) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onShowSafetyTips(forGroup: Boolean) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onReportSpamLearnMoreClicked() { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onMessageRequestAcceptOptionsClicked() { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onItemDoubleClick(multiselectPart: MultiselectPart?) { + Log.w(TAG, "Not yet implemented!", Exception()) + } + + override fun onPaymentTombstoneClicked() { + Log.w(TAG, "Not yet implemented!", Exception()) + } + interface Callback { fun onMessageDetailsFragmentDismissed() } companion object { + private val TAG = Log.tag(MessageDetailsFragment::class) private const val MESSAGE_ID_EXTRA = "message_id" private const val RECIPIENT_EXTRA = "recipient_id" diff --git a/app/src/main/java/org/thoughtcrime/securesms/messagedetails/MessageHeaderViewHolder.java b/app/src/main/java/org/thoughtcrime/securesms/messagedetails/MessageHeaderViewHolder.java index 45345a6d84..348e2667b7 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/messagedetails/MessageHeaderViewHolder.java +++ b/app/src/main/java/org/thoughtcrime/securesms/messagedetails/MessageHeaderViewHolder.java @@ -23,6 +23,7 @@ import androidx.media3.common.MediaItem; import com.bumptech.glide.RequestManager; import org.signal.core.util.concurrent.SignalExecutors; +import org.thoughtcrime.securesms.BindableConversationItem; import org.thoughtcrime.securesms.R; import org.thoughtcrime.securesms.conversation.ConversationItem; import org.thoughtcrime.securesms.conversation.ConversationMessage; @@ -115,6 +116,9 @@ final class MessageHeaderViewHolder extends RecyclerView.ViewHolder implements G conversationItem = (ConversationItem) receivedStub.inflate(); } } + + conversationItem.setEventListener(callbacks); + conversationItem.bind(lifecycleOwner, conversationMessage, Optional.empty(),