From d30da32582c3b2cace3e724c3735e17b4dcc6e0e Mon Sep 17 00:00:00 2001 From: adbenitez Date: Wed, 20 Oct 2021 23:42:59 -0400 Subject: [PATCH 1/2] improve selected recipients list --- res/layout/selected_recipient_list_item.xml | 31 ++++++++++++++++--- .../securesms/GroupCreateActivity.java | 4 +-- .../util/SelectedRecipientsAdapter.java | 22 ++++++++----- 3 files changed, 43 insertions(+), 14 deletions(-) diff --git a/res/layout/selected_recipient_list_item.xml b/res/layout/selected_recipient_list_item.xml index a11e73b97..6bce212c6 100644 --- a/res/layout/selected_recipient_list_item.xml +++ b/res/layout/selected_recipient_list_item.xml @@ -1,25 +1,46 @@ - + + + android:layout_toRightOf="@+id/contact_photo_image" + android:layout_toLeftOf="@+id/delete" + android:layout_marginLeft="16dp" + android:drawablePadding="5dp" + android:ellipsize="marquee" + android:singleLine="true" + android:fontFamily="sans-serif" + android:textSize="16sp" /> recipients; @NonNull private final DcContext dcContext; + @NonNull private final GlideRequests glideRequests; public SelectedRecipientsAdapter(@NonNull Context context, + @NonNull GlideRequests glideRequests, @NonNull Collection existingRecipients) { - this.context = context; - this.dcContext = DcHelper.getContext(context); - this.recipients = wrapExistingMembers(existingRecipients); + this.context = context; + this.glideRequests = glideRequests; + this.dcContext = DcHelper.getContext(context); + this.recipients = wrapExistingMembers(existingRecipients); } public void add(@NonNull Recipient recipient, boolean isPush) { @@ -113,10 +119,12 @@ public class SelectedRecipientsAdapter extends BaseAdapter { dcContact = dcContext.getContact(p.getAddress().getDcContactId()); } - TextView name = v.findViewById(R.id.name); - TextView phone = v.findViewById(R.id.phone); - ImageButton delete = v.findViewById(R.id.delete); + AvatarImageView avatar = v.findViewById(R.id.contact_photo_image); + EmojiTextView name = v.findViewById(R.id.name); + TextView phone = v.findViewById(R.id.phone); + ImageButton delete = v.findViewById(R.id.delete); + avatar.setAvatar(glideRequests, p, false); name.setText(dcContact.getDisplayName()); phone.setText(dcContact.getAddr()); delete.setVisibility(modifiable ? View.VISIBLE : View.GONE); @@ -172,4 +180,4 @@ public class SelectedRecipientsAdapter extends BaseAdapter { return modifiable; } } -} \ No newline at end of file +} From 66d6e249e783f21080b66a39a13354c42aace31f Mon Sep 17 00:00:00 2001 From: Hocuri Date: Tue, 26 Oct 2021 14:21:49 +0200 Subject: [PATCH 2/2] Improve RTL layout support --- res/layout/selected_recipient_list_item.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/res/layout/selected_recipient_list_item.xml b/res/layout/selected_recipient_list_item.xml index 6bce212c6..9c6e4f360 100644 --- a/res/layout/selected_recipient_list_item.xml +++ b/res/layout/selected_recipient_list_item.xml @@ -11,6 +11,7 @@ android:layout_width="40dp" android:layout_height="40dp" android:layout_alignParentLeft="true" + android:layout_alignParentStart="true" android:layout_alignParentTop="true" android:foreground="@drawable/contact_photo_background" android:cropToPadding="true" @@ -22,8 +23,11 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@+id/contact_photo_image" + android:layout_toEndOf="@+id/contact_photo_image" android:layout_toLeftOf="@+id/delete" + android:layout_toStartOf="@+id/delete" android:layout_marginLeft="16dp" + android:layout_marginStart="16dp" android:drawablePadding="5dp" android:ellipsize="marquee" android:singleLine="true" @@ -35,8 +39,10 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/name" + android:layout_alignStart="@+id/name" android:layout_below="@id/name" android:layout_toLeftOf="@+id/delete" + android:layout_toStartOf="@+id/delete" android:singleLine="true" android:ellipsize="marquee" android:textAppearance="?android:attr/textAppearanceSmall" @@ -48,6 +54,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" + android:layout_alignParentEnd="true" android:layout_centerVertical="true" android:contentDescription="@string/delete" android:background="#00ffffff"