[SES-627] Fixed an issue where the DocumentView could run off the screen

This commit is contained in:
Morgan Pretty 2023-06-08 16:33:34 +10:00
parent 22a30f1907
commit 80104f6db8
2 changed files with 6 additions and 12 deletions

View File

@ -338,11 +338,9 @@ class VisibleMessageView : LinearLayout {
val container = binding.messageInnerContainer
val content = binding.messageContentView.root
val expiration = binding.expirationTimerView
val spacing = binding.messageContentSpacing
container.removeAllViewsInLayout()
container.addView(if (message.isOutgoing) expiration else content)
container.addView(if (message.isOutgoing) content else expiration)
container.addView(spacing, if (message.isOutgoing) 0 else 2)
val containerParams = container.layoutParams as ConstraintLayout.LayoutParams
containerParams.horizontalBias = if (message.isOutgoing) 1f else 0f
container.layoutParams = containerParams

View File

@ -79,8 +79,9 @@
<include layout="@layout/view_visible_message_content"
android:id="@+id/messageContentView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<org.thoughtcrime.securesms.conversation.v2.components.ExpirationTimerView
android:id="@+id/expirationTimerView"
@ -90,14 +91,9 @@
android:layout_marginHorizontal="@dimen/small_spacing"
android:contentDescription="@string/AccessibilityId_timer_icon"
android:visibility="invisible"
tools:visibility="visible" />
<View
android:id="@+id/messageContentSpacing"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1"
android:minWidth="@dimen/very_large_spacing" />
tools:visibility="visible"
tools:src="@drawable/timer60"
tools:tint="@color/black"/>
</LinearLayout>