mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-23 18:15:22 +00:00
bind deleted message view
This commit is contained in:
parent
77b5b3ab01
commit
23a61299ac
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -893,4 +893,9 @@
|
||||
<string name="dialog_send_seed_send_button_title">Send</string>
|
||||
<string name="notify_type_all">All</string>
|
||||
<string name="notify_type_mentions">Mentions</string>
|
||||
<string name="deleted_message">This message has been deleted</string>
|
||||
<string name="delete_message_for_me">Delete just for me</string>
|
||||
<string name="delete_message_for_everyone">Delete for everyone</string>
|
||||
<string name="delete_message_for_me_and_recipient">Delete for me and %s</string>
|
||||
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user