add (edited) tag in incoming and outgoing messages layout

Signed-off-by:Sowjanya Kota <sowjanya.kch@gmail.com>
This commit is contained in:
sowjanyakch 2024-02-01 22:34:20 +01:00
parent 253c3fe024
commit 6db42115ba
5 changed files with 45 additions and 1 deletions

View file

@ -114,6 +114,14 @@ class IncomingTextMessageViewHolder(itemView: View, payload: Any) :
binding.messageText.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize) binding.messageText.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize)
binding.messageText.text = processedMessageText binding.messageText.text = processedMessageText
if (message.parentMessage?.id != null && message.systemMessageType == ChatMessage.SystemMessageType
.MESSAGE_EDITED
) {
binding.messageType.visibility = View.VISIBLE
} else {
binding.messageType.visibility = View.GONE
}
binding.messageTime.text = dateUtils.getLocalTimeStringFromTimestamp(message.timestamp) binding.messageTime.text = dateUtils.getLocalTimeStringFromTimestamp(message.timestamp)
// parent message handling // parent message handling

View file

@ -100,6 +100,13 @@ class OutcomingTextMessageViewHolder(itemView: View) : OutcomingTextMessageViewH
setBubbleOnChatMessage(message) setBubbleOnChatMessage(message)
binding.messageText.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize) binding.messageText.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize)
if (message.parentMessage?.id != null && message.systemMessageType == ChatMessage.SystemMessageType
.MESSAGE_EDITED
) {
binding.messageType.visibility = View.VISIBLE
} else {
binding.messageType.visibility = View.GONE
}
binding.messageTime.layoutParams = layoutParams binding.messageTime.layoutParams = layoutParams
viewThemeUtils.platform.colorTextView(binding.messageText, ColorRole.ON_SURFACE_VARIANT) viewThemeUtils.platform.colorTextView(binding.messageText, ColorRole.ON_SURFACE_VARIANT)
binding.messageText.text = processedMessageText binding.messageText.text = processedMessageText

View file

@ -78,6 +78,19 @@
app:layout_wrapBefore="true" app:layout_wrapBefore="true"
tools:text="Talk to you later!" /> tools:text="Talk to you later!" />
<TextView
android:id="@+id/messageType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/messageText"
android:layout_marginStart="8dp"
android:text="@string/hint_edited_message"
app:layout_alignSelf="center"
app:layout_flexGrow="1"
app:layout_wrapBefore="false">
</TextView>
<TextView <TextView
android:id="@id/messageTime" android:id="@id/messageTime"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -57,6 +57,20 @@
android:textIsSelectable="false" android:textIsSelectable="false"
tools:text="Talk to you later!" /> tools:text="Talk to you later!" />
<TextView
android:id="@+id/messageType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/messageText"
android:layout_marginStart="8dp"
app:layout_alignSelf="center"
app:layout_flexGrow="1"
app:layout_wrapBefore="false"
android:text = "@string/hint_edited_message">
</TextView>
<TextView <TextView
android:id="@id/messageTime" android:id="@id/messageTime"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -72,6 +86,7 @@
app:layout_wrapBefore="false" app:layout_wrapBefore="false"
tools:text="10:35" /> tools:text="10:35" />
<ImageView <ImageView
android:id="@+id/checkMark" android:id="@+id/checkMark"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -793,4 +793,5 @@ How to translate with transifex:
<string name="edit_error_24_hours_old_message">Cannot Edit Messages older than 24 hours</string> <string name="edit_error_24_hours_old_message">Cannot Edit Messages older than 24 hours</string>
<string name="conversation_is_read_only">Conversation is read Only</string> <string name="conversation_is_read_only">Conversation is read Only</string>
<string name="nc_edit_message_text">Edit Message Text</string> <string name="nc_edit_message_text">Edit Message Text</string>
<string name="hint_edited_message">(edited)</string>
</resources> </resources>