From e84b7948f64b4d63f9e27b8ef5c8c8ab1ec799c3 Mon Sep 17 00:00:00 2001 From: Robert Spencer Date: Thu, 11 Jul 2019 20:33:04 +0100 Subject: [PATCH] Use rounded images for selecting recipients, and for the recipient list. --- .../com/fsck/k9/view/RecipientSelectView.java | 9 +- .../res/layout/recipient_dropdown_item.xml | 2 +- .../main/res/layout/recipient_token_item.xml | 154 +++++++++--------- 3 files changed, 88 insertions(+), 77 deletions(-) diff --git a/app/ui/src/main/java/com/fsck/k9/view/RecipientSelectView.java b/app/ui/src/main/java/com/fsck/k9/view/RecipientSelectView.java index 28c6f4765..07d5dc82f 100644 --- a/app/ui/src/main/java/com/fsck/k9/view/RecipientSelectView.java +++ b/app/ui/src/main/java/com/fsck/k9/view/RecipientSelectView.java @@ -27,7 +27,6 @@ import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.inputmethod.InputMethodManager; -import android.widget.ImageView; import android.widget.ListPopupWindow; import android.widget.ListView; import android.widget.TextView; @@ -43,6 +42,7 @@ import com.fsck.k9.view.RecipientSelectView.Recipient; import com.tokenautocomplete.TokenCompleteTextView; import org.apache.james.mime4j.util.CharsetUtil; import timber.log.Timber; +import de.hdodenhof.circleimageview.CircleImageView; public class RecipientSelectView extends TokenCompleteTextView implements LoaderCallbacks>, @@ -120,7 +120,10 @@ public class RecipientSelectView extends TokenCompleteTextView implem @SuppressLint("InflateParams") private View inflateLayout() { LayoutInflater layoutInflater = LayoutInflater.from(getContext()); - return layoutInflater.inflate(R.layout.recipient_token_item, null, false); + View layout = layoutInflater.inflate(R.layout.recipient_token_item, null, false); + View contactPhoto = layout.findViewById(R.id.contact_photo); + contactPhoto.setZ(1.f); + return layout; } private void bindObjectView(Recipient recipient, View view) { @@ -536,7 +539,7 @@ public class RecipientSelectView extends TokenCompleteTextView implem private static class RecipientTokenViewHolder { final TextView vName; - final ImageView vContactPhoto; + final CircleImageView vContactPhoto; final View cryptoStatusRed; final View cryptoStatusOrange; final View cryptoStatusGreen; diff --git a/app/ui/src/main/res/layout/recipient_dropdown_item.xml b/app/ui/src/main/res/layout/recipient_dropdown_item.xml index 22e05a3e7..b4badedfe 100644 --- a/app/ui/src/main/res/layout/recipient_dropdown_item.xml +++ b/app/ui/src/main/res/layout/recipient_dropdown_item.xml @@ -7,7 +7,7 @@ android:gravity="center" android:orientation="horizontal"> - + android:layout_height="32dp"> - - + android:layout_height="match_parent" + android:background="?attr/contactTokenBackgroundColor" + android:layout_marginLeft="-16dp" + > - + - + - + - + - + - + + + + + \ No newline at end of file