diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/DeletedMessageView.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/DeletedMessageView.kt index 3adfc125fb..96091428ed 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/DeletedMessageView.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/DeletedMessageView.kt @@ -12,6 +12,7 @@ import kotlinx.android.synthetic.main.view_document.view.* import network.loki.messenger.R import org.thoughtcrime.securesms.database.model.MessageRecord import org.thoughtcrime.securesms.database.model.MmsMessageRecord +import java.util.* class DeletedMessageView : LinearLayout { @@ -27,7 +28,8 @@ class DeletedMessageView : LinearLayout { // region Updating fun bind(message: MessageRecord, @ColorInt textColor: Int) { - deleteTextView.text = "This message has been deleted" + assert(message.deleted) + deleteTextView.text = context.getString(R.string.deleted_message) deleteTextView.setTextColor(textColor) deletedMessageViewIconImageView.imageTintList = ColorStateList.valueOf(textColor) } diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/VisibleMessageContentView.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/VisibleMessageContentView.kt index 8f2410652d..dea9122a1e 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/VisibleMessageContentView.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/messages/VisibleMessageContentView.kt @@ -76,7 +76,11 @@ class VisibleMessageContentView : LinearLayout { mainContainer.removeAllViews() onContentClick = null onContentDoubleTap = null - if (message is MmsMessageRecord && message.linkPreviews.isNotEmpty()) { + if (message.deleted) { + val deletedMessageView = DeletedMessageView(context) + deletedMessageView.bind(message, VisibleMessageContentView.getTextColor(context,message)) + mainContainer.addView(deletedMessageView) + } else if (message is MmsMessageRecord && message.linkPreviews.isNotEmpty()) { val linkPreviewView = LinkPreviewView(context) linkPreviewView.bind(message, glide, isStartOfMessageCluster, isEndOfMessageCluster, searchQuery) mainContainer.addView(linkPreviewView) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9fa0283acc..360bd4bece 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -893,4 +893,9 @@ Send All Mentions + This message has been deleted + Delete just for me + Delete for everyone + Delete for me and %s +