mirror of
https://github.com/oxen-io/session-android.git
synced 2025-04-03 20:05:40 +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 network.loki.messenger.R
|
||||||
import org.thoughtcrime.securesms.database.model.MessageRecord
|
import org.thoughtcrime.securesms.database.model.MessageRecord
|
||||||
import org.thoughtcrime.securesms.database.model.MmsMessageRecord
|
import org.thoughtcrime.securesms.database.model.MmsMessageRecord
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
class DeletedMessageView : LinearLayout {
|
class DeletedMessageView : LinearLayout {
|
||||||
|
|
||||||
@ -27,7 +28,8 @@ class DeletedMessageView : LinearLayout {
|
|||||||
|
|
||||||
// region Updating
|
// region Updating
|
||||||
fun bind(message: MessageRecord, @ColorInt textColor: Int) {
|
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)
|
deleteTextView.setTextColor(textColor)
|
||||||
deletedMessageViewIconImageView.imageTintList = ColorStateList.valueOf(textColor)
|
deletedMessageViewIconImageView.imageTintList = ColorStateList.valueOf(textColor)
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,11 @@ class VisibleMessageContentView : LinearLayout {
|
|||||||
mainContainer.removeAllViews()
|
mainContainer.removeAllViews()
|
||||||
onContentClick = null
|
onContentClick = null
|
||||||
onContentDoubleTap = 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)
|
val linkPreviewView = LinkPreviewView(context)
|
||||||
linkPreviewView.bind(message, glide, isStartOfMessageCluster, isEndOfMessageCluster, searchQuery)
|
linkPreviewView.bind(message, glide, isStartOfMessageCluster, isEndOfMessageCluster, searchQuery)
|
||||||
mainContainer.addView(linkPreviewView)
|
mainContainer.addView(linkPreviewView)
|
||||||
|
@ -893,4 +893,9 @@
|
|||||||
<string name="dialog_send_seed_send_button_title">Send</string>
|
<string name="dialog_send_seed_send_button_title">Send</string>
|
||||||
<string name="notify_type_all">All</string>
|
<string name="notify_type_all">All</string>
|
||||||
<string name="notify_type_mentions">Mentions</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>
|
</resources>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user