Fix group message UI

This commit is contained in:
Niels Andriesse 2019-08-06 10:22:05 +10:00
parent 3a5f5a9a41
commit 8ad0069fec
2 changed files with 7 additions and 1 deletions

View File

@ -35,6 +35,7 @@
android:foreground="@drawable/contact_photo_background"
android:layout_width="@dimen/conversation_item_avatar_size"
android:layout_height="@dimen/conversation_item_avatar_size"
android:layout_marginBottom="2dp"
android:cropToPadding="true"
android:contentDescription="@string/conversation_item_received__contact_photo_description" />
@ -55,7 +56,6 @@
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/message_bubble_edge_margin"
android:layout_marginStart="8dp"
android:layout_toEndOf="@id/contact_photo_container"
android:orientation="vertical"
android:clipToPadding="false"
android:clipChildren="false"

View File

@ -678,6 +678,12 @@ public class ConversationItem extends LinearLayout
}
private void setContactPhoto(@NonNull Recipient recipient) {
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams)bodyBubble.getLayoutParams();
float scale = getResources().getDisplayMetrics().density;
float marginInDP = groupThread ? 44 : 8;
int marginInPX = Math.round(marginInDP * scale);
layoutParams.setMarginStart(marginInPX);
bodyBubble.setLayoutParams(layoutParams);
if (contactPhoto == null) return;
contactPhoto.setAvatar(glideRequests, recipient, true);
}