diff --git a/tools/check/forbidden_strings_in_code.txt b/tools/check/forbidden_strings_in_code.txt
index a0c7c2f4c6..cbfaf20247 100644
--- a/tools/check/forbidden_strings_in_code.txt
+++ b/tools/check/forbidden_strings_in_code.txt
@@ -160,7 +160,7 @@ Formatter\.formatShortFileSize===1
# android\.text\.TextUtils
### This is not a rule, but a warning: the number of "enum class" has changed. For Json classes, it is mandatory that they have `@JsonClass(generateAdapter = false)`. If the enum is not used as a Json class, change the value in file forbidden_strings_in_code.txt
-enum class===115
+enum class===116
### Do not import temporary legacy classes
import org.matrix.android.sdk.internal.legacy.riot===3
diff --git a/vector/src/main/java/im/vector/app/features/home/AvatarRenderer.kt b/vector/src/main/java/im/vector/app/features/home/AvatarRenderer.kt
index be689eb27a..2ee3233637 100644
--- a/vector/src/main/java/im/vector/app/features/home/AvatarRenderer.kt
+++ b/vector/src/main/java/im/vector/app/features/home/AvatarRenderer.kt
@@ -145,7 +145,6 @@ class AvatarRenderer @Inject constructor(private val activeSessionHolder: Active
}
else -> {
it.apply(RequestOptions.circleCropTransform())
-
}
}
}
diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/MessageInformationDataFactory.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/MessageInformationDataFactory.kt
index 2edab8af74..276802e574 100644
--- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/MessageInformationDataFactory.kt
+++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/MessageInformationDataFactory.kt
@@ -65,7 +65,8 @@ class MessageInformationDataFactory @Inject constructor(private val session: Ses
val addDaySeparator = date.toLocalDate() != nextDate?.toLocalDate()
val isFirstFromThisSender = nextDisplayableEvent?.root?.senderId != event.root.senderId || addDaySeparator
- val isLastFromThisSender = prevDisplayableEvent?.root?.senderId != event.root.senderId || prevDisplayableEvent?.root?.localDateTime()?.toLocalDate() != date.toLocalDate()
+ val isLastFromThisSender = prevDisplayableEvent?.root?.senderId != event.root.senderId ||
+ prevDisplayableEvent?.root?.localDateTime()?.toLocalDate() != date.toLocalDate()
val time = dateFormatter.format(event.root.originServerTs, DateFormatKind.MESSAGE_SIMPLE)
val e2eDecoration = getE2EDecoration(roomSummary, event)
diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/style/TimelineMessageLayout.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/style/TimelineMessageLayout.kt
index 50f4e95cee..bd4be10783 100644
--- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/style/TimelineMessageLayout.kt
+++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/style/TimelineMessageLayout.kt
@@ -30,16 +30,21 @@ sealed interface TimelineMessageLayout : Parcelable {
data class Default(override val showAvatar: Boolean,
override val showDisplayName: Boolean,
override val showTimestamp: Boolean,
- // Keep defaultLayout generated on epoxy items
+ // Keep defaultLayout generated on epoxy items
override val layoutRes: Int = 0) : TimelineMessageLayout
@Parcelize
- data class Bubble(override val showAvatar: Boolean,
- override val showDisplayName: Boolean,
- override val showTimestamp: Boolean = true,
- val isIncoming: Boolean,
- val isFirstFromThisSender: Boolean,
- val isLastFromThisSender: Boolean,
- override val layoutRes: Int = if (isIncoming) R.layout.item_timeline_event_bubble_incoming_base else R.layout.item_timeline_event_bubble_outgoing_base,
+ data class Bubble(
+ override val showAvatar: Boolean,
+ override val showDisplayName: Boolean,
+ override val showTimestamp: Boolean = true,
+ val isIncoming: Boolean,
+ val isFirstFromThisSender: Boolean,
+ val isLastFromThisSender: Boolean,
+ override val layoutRes: Int = if (isIncoming) {
+ R.layout.item_timeline_event_bubble_incoming_base
+ } else {
+ R.layout.item_timeline_event_bubble_outgoing_base
+ },
) : TimelineMessageLayout
}
diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/style/TimelineMessageLayoutFactory.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/style/TimelineMessageLayoutFactory.kt
index 9b2877f0f8..6c26679105 100644
--- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/style/TimelineMessageLayoutFactory.kt
+++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/style/TimelineMessageLayoutFactory.kt
@@ -45,7 +45,6 @@ class TimelineMessageLayoutFactory @Inject constructor(private val session: Sess
}
fun create(params: TimelineItemFactoryParams): TimelineMessageLayout {
-
val event = params.event
val nextDisplayableEvent = params.nextDisplayableEvent
val prevDisplayableEvent = params.prevDisplayableEvent
@@ -78,8 +77,8 @@ class TimelineMessageLayoutFactory @Inject constructor(private val session: Sess
buildModernLayout(showInformation)
}
val isFirstFromThisSender = nextDisplayableEvent?.root?.senderId != event.root.senderId || addDaySeparator
- val isLastFromThisSender = prevDisplayableEvent?.root?.senderId != event.root.senderId
- || prevDisplayableEvent?.root?.localDateTime()?.toLocalDate() != date.toLocalDate()
+ val isLastFromThisSender = prevDisplayableEvent?.root?.senderId != event.root.senderId ||
+ prevDisplayableEvent?.root?.localDateTime()?.toLocalDate() != date.toLocalDate()
TimelineMessageLayout.Bubble(
showAvatar = showInformation && !isSentByMe,
diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/view/MessageBubbleView.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/view/MessageBubbleView.kt
index 46e3edca44..68e32861c3 100644
--- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/view/MessageBubbleView.kt
+++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/view/MessageBubbleView.kt
@@ -37,8 +37,8 @@ import im.vector.app.core.utils.DimensionConverter
import im.vector.app.features.themes.ThemeUtils
class MessageBubbleView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null,
- defStyleAttr: Int = 0)
- : RelativeLayout(context, attrs, defStyleAttr), MessageViewConfiguration {
+ defStyleAttr: Int = 0) :
+ RelativeLayout(context, attrs, defStyleAttr), MessageViewConfiguration {
override var isIncoming: Boolean = false
set(value) {
diff --git a/vector/src/main/res/values/strings.xml b/vector/src/main/res/values/strings.xml
index 34ac5fcddc..4e927701d7 100644
--- a/vector/src/main/res/values/strings.xml
+++ b/vector/src/main/res/values/strings.xml
@@ -3701,4 +3701,5 @@
Poll ended
Remove poll
Are you sure you want to remove this poll? You won\'t be able to recover it once removed.
+ Message bubbles
diff --git a/vector/src/main/res/xml/vector_settings_preferences.xml b/vector/src/main/res/xml/vector_settings_preferences.xml
index ac8a48fb2e..a25562e3d2 100644
--- a/vector/src/main/res/xml/vector_settings_preferences.xml
+++ b/vector/src/main/res/xml/vector_settings_preferences.xml
@@ -25,7 +25,7 @@
+ android:title="@string/message_bubbles" />