Merge branch 'dev' into comp

This commit is contained in:
andrew 2023-07-21 10:42:13 +09:30
commit d0415c5bf1
2 changed files with 34 additions and 23 deletions

View File

@ -8,9 +8,11 @@ import android.graphics.drawable.ColorDrawable
import android.os.Handler import android.os.Handler
import android.os.Looper import android.os.Looper
import android.util.AttributeSet import android.util.AttributeSet
import android.view.Gravity
import android.view.HapticFeedbackConstants import android.view.HapticFeedbackConstants
import android.view.MotionEvent import android.view.MotionEvent
import android.view.View import android.view.View
import android.widget.FrameLayout
import android.widget.LinearLayout import android.widget.LinearLayout
import androidx.annotation.ColorInt import androidx.annotation.ColorInt
import androidx.annotation.DrawableRes import androidx.annotation.DrawableRes
@ -113,6 +115,7 @@ class VisibleMessageView : LinearLayout {
binding.root.disableClipping() binding.root.disableClipping()
binding.mainContainer.disableClipping() binding.mainContainer.disableClipping()
binding.messageInnerContainer.disableClipping() binding.messageInnerContainer.disableClipping()
binding.messageInnerLayout.disableClipping()
binding.messageContentView.root.disableClipping() binding.messageContentView.root.disableClipping()
} }
// endregion // endregion
@ -340,11 +343,14 @@ class VisibleMessageView : LinearLayout {
private fun updateExpirationTimer(message: MessageRecord) { private fun updateExpirationTimer(message: MessageRecord) {
val container = binding.messageInnerContainer val container = binding.messageInnerContainer
val content = binding.messageContentView.root val layout = binding.messageInnerLayout
val expiration = binding.expirationTimerView
container.removeAllViewsInLayout() if (message.isOutgoing) binding.messageContentView.root.bringToFront()
container.addView(if (message.isOutgoing) expiration else content) else binding.expirationTimerView.bringToFront()
container.addView(if (message.isOutgoing) content else expiration)
layout.layoutParams = layout.layoutParams.let { it as FrameLayout.LayoutParams }
.apply { gravity = if (message.isOutgoing) Gravity.END else Gravity.START }
val containerParams = container.layoutParams as ConstraintLayout.LayoutParams val containerParams = container.layoutParams as ConstraintLayout.LayoutParams
containerParams.horizontalBias = if (message.isOutgoing) 1f else 0f containerParams.horizontalBias = if (message.isOutgoing) 1f else 0f
container.layoutParams = containerParams container.layoutParams = containerParams

View File

@ -106,21 +106,25 @@
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:text="@tools:sample/full_names" /> tools:text="@tools:sample/full_names" />
<LinearLayout <FrameLayout
android:id="@+id/messageInnerContainer" android:id="@+id/messageInnerContainer"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="@+id/profilePictureView" app:layout_constraintBottom_toBottomOf="@+id/profilePictureView"
app:layout_constraintStart_toEndOf="@+id/profilePictureView" app:layout_constraintStart_toEndOf="@+id/profilePictureView"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/senderNameTextView"> app:layout_constraintTop_toBottomOf="@+id/senderNameTextView">
<LinearLayout
android:id="@+id/messageInnerLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<include layout="@layout/view_visible_message_content" <include layout="@layout/view_visible_message_content"
android:id="@+id/messageContentView" android:id="@+id/messageContentView"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content" />
android:layout_weight="1"/>
<org.thoughtcrime.securesms.conversation.v2.components.ExpirationTimerView <org.thoughtcrime.securesms.conversation.v2.components.ExpirationTimerView
android:id="@+id/expirationTimerView" android:id="@+id/expirationTimerView"
@ -135,6 +139,7 @@
tools:tint="@color/black"/> tools:tint="@color/black"/>
</LinearLayout> </LinearLayout>
</FrameLayout>
<include layout="@layout/view_emoji_reactions" <include layout="@layout/view_emoji_reactions"
android:id="@+id/emojiReactionsView" android:id="@+id/emojiReactionsView"