mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-23 12:38:33 +00:00
Fix margins on message clusters and 1:1 messages.
This commit is contained in:
committed by
Greyson Parrelli
parent
26c9b5166e
commit
833f90ce53
@@ -727,6 +727,14 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
|
||||
bodyText.setText(StringUtil.trim(styledText));
|
||||
bodyText.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
if (!messageRecord.isOutgoing()) {
|
||||
if (!messageRecord.isMms()) {
|
||||
ViewUtil.setTopMargin(bodyText, readDimen(R.dimen.message_bubble_content_top_padding));
|
||||
} else {
|
||||
ViewUtil.setTopMargin(bodyText, readDimen(R.dimen.message_bubble_text_top_padding));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setMediaAttributes(@NonNull MessageRecord messageRecord,
|
||||
@@ -1123,6 +1131,7 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
|
||||
}
|
||||
|
||||
private void setQuote(@NonNull MessageRecord current, @NonNull Optional<MessageRecord> previous, @NonNull Optional<MessageRecord> next, boolean isGroupThread, @NonNull ChatColors chatColors) {
|
||||
boolean startOfCluster = isStartOfMessageCluster(current, previous, isGroupThread);
|
||||
if (current.isMms() && !current.isMmsNotification() && ((MediaMmsMessageRecord)current).getQuote() != null) {
|
||||
if (quoteView == null) {
|
||||
throw new AssertionError();
|
||||
@@ -1144,7 +1153,7 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
|
||||
|
||||
quoteView.setOnLongClickListener(passthroughClickListener);
|
||||
|
||||
if (isStartOfMessageCluster(current, previous, isGroupThread)) {
|
||||
if (startOfCluster) {
|
||||
if (current.isOutgoing()) {
|
||||
quoteView.setTopCornerSizes(true, true);
|
||||
} else if (isGroupThread) {
|
||||
@@ -1172,7 +1181,7 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
|
||||
quoteView.dismiss();
|
||||
}
|
||||
|
||||
int topMargin = current.isOutgoing() ? 0 : readDimen(R.dimen.message_bubble_content_top_padding);
|
||||
int topMargin = (current.isOutgoing() || !startOfCluster || !groupThread) ? 0 : readDimen(R.dimen.message_bubble_content_top_padding);
|
||||
if (mediaThumbnailStub.resolved()) {
|
||||
ViewUtil.setTopMargin(mediaThumbnailStub.get(), topMargin);
|
||||
}
|
||||
|
||||
@@ -60,7 +60,6 @@
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="@dimen/message_bubble_edge_margin"
|
||||
android:layout_toEndOf="@id/contact_photo_container"
|
||||
android:paddingTop="@dimen/message_bubble_top_padding"
|
||||
android:background="@color/white"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
@@ -73,6 +72,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginEnd="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginTop="@dimen/message_bubble_top_padding"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
@@ -98,6 +98,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="1dp"
|
||||
android:layout_marginBottom="@dimen/message_bubble_collapsed_footer_padding"
|
||||
android:layout_marginStart="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginEnd="@dimen/message_bubble_horizontal_padding"
|
||||
android:ellipsize="end"
|
||||
@@ -112,7 +113,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginTop="-4dp"
|
||||
android:layout_marginEnd="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginBottom="@dimen/message_bubble_bottom_padding"
|
||||
android:alpha="0.7"
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
<dimen name="message_bubble_shadow_distance">1.5dp</dimen>
|
||||
<dimen name="message_bubble_horizontal_padding">12dp</dimen>
|
||||
<dimen name="message_bubble_top_padding">7dp</dimen>
|
||||
<dimen name="message_bubble_text_top_padding">1dp</dimen>
|
||||
<dimen name="message_bubble_content_top_padding">4dp</dimen>
|
||||
<dimen name="message_bubble_top_padding_audio">12dp</dimen>
|
||||
<dimen name="message_bubble_collapsed_footer_padding">6dp</dimen>
|
||||
|
||||
Reference in New Issue
Block a user