Added forwarded message indicator

This commit is contained in:
Sylvain Berfini 2023-12-13 11:55:23 +01:00
parent 637f424a70
commit d5b0d82adc
5 changed files with 59 additions and 4 deletions

View file

@ -29,12 +29,12 @@ import org.linphone.utils.LinphoneUtils
class EventLogModel @WorkerThread constructor(
val eventLog: EventLog,
val avatarModel: ContactAvatarModel,
val isFromGroup: Boolean = false,
isFromGroup: Boolean = false,
isGroupedWithPreviousOne: Boolean = false,
isGroupedWithNextOne: Boolean = false,
val onContentClicked: ((file: String) -> Unit)? = null,
val onJoinConferenceClicked: ((uri: String) -> Unit)? = null,
val onWebUrlClicked: ((url: String) -> Unit)? = null
onContentClicked: ((file: String) -> Unit)? = null,
onJoinConferenceClicked: ((uri: String) -> Unit)? = null,
onWebUrlClicked: ((url: String) -> Unit)? = null
) {
companion object {
private const val TAG = "[Event Log Model]"
@ -78,6 +78,7 @@ class EventLogModel @WorkerThread constructor(
replyTo,
replyText,
chatMessage.replyMessageId,
chatMessage.isForward,
isGroupedWithPreviousOne,
isGroupedWithNextOne,
onContentClicked,

View file

@ -66,6 +66,7 @@ class MessageModel @WorkerThread constructor(
val replyTo: String,
val replyText: String,
val replyToMessageId: String?,
val isForward: Boolean,
isGroupedWithPreviousOne: Boolean,
isGroupedWithNextOne: Boolean,
private val onContentClicked: ((file: String) -> Unit)? = null,

View file

@ -130,6 +130,32 @@
app:layout_constraintStart_toStartOf="@id/bubble"
app:layout_constraintTop_toBottomOf="@id/reply_name" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style_300"
android:id="@+id/forward_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="@string/message_forwarded_label"
android:textSize="12sp"
android:textColor="?attr/color_main2_500"
android:visibility="@{model.isForward ? View.VISIBLE : View.GONE, default=gone}"
app:drawableTint="?attr/color_main2_500"
app:layout_constraintStart_toEndOf="@id/forward_icon"
app:layout_constraintTop_toBottomOf="@id/name"
app:layout_constraintBottom_toTopOf="@id/bubble" />
<ImageView
android:id="@+id/forward_icon"
android:layout_width="@dimen/small_icon_size"
android:layout_height="@dimen/small_icon_size"
android:layout_marginStart="8dp"
android:src="@drawable/forward"
android:visibility="@{model.isForward ? View.VISIBLE : View.GONE, default=gone}"
app:layout_constraintStart_toStartOf="@id/bubble"
app:layout_constraintTop_toTopOf="@id/forward_label"
app:layout_constraintBottom_toBottomOf="@id/forward_label" />
<LinearLayout
android:id="@+id/bubble"
android:layout_width="wrap_content"

View file

@ -93,6 +93,32 @@
app:layout_constraintEnd_toEndOf="@id/bubble"
app:layout_constraintTop_toBottomOf="@id/reply_name" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style_300"
android:id="@+id/forward_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:text="@string/message_forwarded_label"
android:textSize="12sp"
android:textColor="?attr/color_main2_500"
android:visibility="@{model.isForward ? View.VISIBLE : View.GONE, default=gone}"
app:drawableTint="?attr/color_main2_500"
app:layout_constraintEnd_toEndOf="@id/bubble"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/bubble" />
<ImageView
android:id="@+id/forward_icon"
android:layout_width="@dimen/small_icon_size"
android:layout_height="@dimen/small_icon_size"
android:layout_marginEnd="8dp"
android:src="@drawable/forward"
android:visibility="@{model.isForward ? View.VISIBLE : View.GONE, default=gone}"
app:layout_constraintEnd_toStartOf="@id/forward_label"
app:layout_constraintTop_toTopOf="@id/forward_label"
app:layout_constraintBottom_toBottomOf="@id/forward_label" />
<LinearLayout
android:id="@+id/bubble"
android:layout_width="wrap_content"

View file

@ -433,6 +433,7 @@
<string name="message_reactions_info_all_title">Reactions %s</string>
<string name="message_reactions_info_emoji_title">%s %s</string>
<string name="message_reaction_click_to_remove_label">Click to remove</string>
<string name="message_forwarded_label">Forwarded</string>
<string name="meetings_list_empty">No meeting for the moment…</string>
<string name="meetings_list_today_indicator">Today</string>