Fix conversation header position.

This commit is contained in:
Michelle Tang
2025-03-19 11:18:38 -04:00
committed by Cody Henthorne
parent 2d9135da93
commit c1f96e5bd3
5 changed files with 15 additions and 20 deletions

View File

@@ -307,6 +307,9 @@ public class ConversationHeaderView extends ConstraintLayout {
if (getBackground() != null) {
ViewUtil.setPaddingTop(binding.messageRequestInfo, 0);
ViewUtil.setPaddingBottom(binding.messageRequestInfo, getContext().getResources().getDimensionPixelOffset(R.dimen.conversation_header_padding));
int margin = getContext().getResources().getDimensionPixelOffset(R.dimen.conversation_header_margin);
ViewUtil.setLeftMargin(this, margin);
ViewUtil.setRightMargin(this, margin);
}
int padding = visibleCount == 1 ? getContext().getResources().getDimensionPixelOffset(R.dimen.conversation_header_padding) : getContext().getResources().getDimensionPixelOffset(R.dimen.conversation_header_padding_expanded);

View File

@@ -531,7 +531,7 @@ class ConversationAdapterV2(
}
inner class ThreadHeaderViewHolder(itemView: View) : MappingViewHolder<ThreadHeader>(itemView) {
private val conversationBanner: ConversationHeaderView = itemView.findViewById(R.id.header)
private val conversationBanner: ConversationHeaderView = itemView as ConversationHeaderView
override fun bind(model: ThreadHeader) {
val (recipient, groupInfo, sharedGroups, messageRequestState) = model.recipientInfo

View File

@@ -89,10 +89,13 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textAlignment="center"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:textAppearance="@style/Signal.Text.MessageRequest.Subtitle"
app:layout_constraintTop_toBottomOf="@id/message_request_title"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
tools:text="Hangin' on the web" />
<View

View File

@@ -1,22 +1,10 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2023 Signal Messenger, LLC
~ SPDX-License-Identifier: AGPL-3.0-only
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<?xml version="1.0" encoding="utf-8"?>
<org.thoughtcrime.securesms.conversation.ConversationHeaderView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<org.thoughtcrime.securesms.conversation.ConversationHeaderView
android:id="@+id/header"
android:layout_gravity="center_horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:paddingTop="22dp"
android:paddingBottom="4dp"
app:layout_constraintTop_toTopOf="parent"
tools:viewBindingIgnore="true" />
</FrameLayout>
android:layout_height="wrap_content"
android:paddingTop="22dp"
android:paddingBottom="4dp"
app:layout_constraintTop_toTopOf="parent"
tools:viewBindingIgnore="true" />

View File

@@ -249,5 +249,6 @@
<dimen name="conversation_header_padding">24dp</dimen>
<dimen name="conversation_header_padding_expanded">32dp</dimen>
<dimen name="conversation_header_max_size">308dp</dimen>
<dimen name="conversation_header_margin">40dp</dimen>
</resources>