diff --git a/app/src/main/java/eu/faircode/email/DaoContact.java b/app/src/main/java/eu/faircode/email/DaoContact.java index 20ace8667a..eafc1470d7 100644 --- a/app/src/main/java/eu/faircode/email/DaoContact.java +++ b/app/src/main/java/eu/faircode/email/DaoContact.java @@ -59,16 +59,12 @@ public interface DaoContact { EntityContact getContact(long account, int type, String email); @Query("SELECT id AS _id, name, email" + - ", CASE type" + - " WHEN " + EntityContact.TYPE_TO + " THEN '>'" + - " WHEN " + EntityContact.TYPE_FROM + " THEN '<'" + - " ELSE '?'" + - " END AS type" + " FROM contact" + " WHERE (:account IS NULL OR account = :account)" + " AND (:type IS NULL OR type = :type)" + " AND (email LIKE :query COLLATE NOCASE OR name LIKE :query COLLATE NOCASE)" + " AND state <> " + EntityContact.STATE_IGNORE + + " GROUP BY name, email" + " ORDER BY" + " CASE WHEN name IS NULL THEN 1 ELSE 0 END" + ", name COLLATE NOCASE, email COLLATE NOCASE") diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 58026e4a94..2d76159cb9 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -440,16 +440,9 @@ public class FragmentCompose extends FragmentBase { contacts ? new String[]{ ContactsContract.Contacts.DISPLAY_NAME, - ContactsContract.CommonDataKinds.Email.DATA - } - : new String[]{ - "name", - "email", - "type" - }, - contacts - ? new int[]{android.R.id.text1, android.R.id.text2} - : new int[]{android.R.id.text1, android.R.id.text2, R.id.tvType}, + ContactsContract.CommonDataKinds.Email.DATA} + : new String[]{"name", "email"}, + new int[]{android.R.id.text1, android.R.id.text2}, 0); etTo.setAdapter(cadapter); diff --git a/app/src/main/res/layout/spinner_contact.xml b/app/src/main/res/layout/spinner_contact.xml index 21d38216c0..8294407115 100644 --- a/app/src/main/res/layout/spinner_contact.xml +++ b/app/src/main/res/layout/spinner_contact.xml @@ -22,21 +22,11 @@ android:id="@android:id/text2" android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_marginEnd="6dp" android:ellipsize="middle" android:singleLine="true" android:text="Text2" android:textAppearance="@style/TextAppearance.AppCompat.Small" - app:layout_constraintEnd_toStartOf="@+id/tvType" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@android:id/text1" /> - - \ No newline at end of file