From 82855d9a1e80b4e3396e482f4c53461babedfc14 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 22 Aug 2018 16:22:41 +0000 Subject: [PATCH] Allow searching for multiple addresses --- .../main/java/eu/faircode/email/FragmentCompose.java | 12 ++++++++---- app/src/main/res/layout/fragment_compose.xml | 6 +++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index ba6c743b6d..627c92d04c 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -42,10 +42,10 @@ import android.view.View; import android.view.ViewGroup; import android.webkit.MimeTypeMap; import android.widget.ArrayAdapter; -import android.widget.AutoCompleteTextView; import android.widget.EditText; import android.widget.FilterQueryProvider; import android.widget.ImageView; +import android.widget.MultiAutoCompleteTextView; import android.widget.ProgressBar; import android.widget.Spinner; import android.widget.TextView; @@ -86,11 +86,11 @@ public class FragmentCompose extends FragmentEx { private ViewGroup view; private Spinner spFrom; private ImageView ivIdentityAdd; - private AutoCompleteTextView etTo; + private MultiAutoCompleteTextView etTo; private ImageView ivToAdd; - private AutoCompleteTextView etCc; + private MultiAutoCompleteTextView etCc; private ImageView ivCcAdd; - private AutoCompleteTextView etBcc; + private MultiAutoCompleteTextView etBcc; private ImageView ivBccAdd; private EditText etSubject; private RecyclerView rvAttachment; @@ -264,6 +264,10 @@ public class FragmentCompose extends FragmentEx { etCc.setAdapter(adapter); etBcc.setAdapter(adapter); + etTo.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer()); + etCc.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer()); + etBcc.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer()); + adapter.setFilterQueryProvider(new FilterQueryProvider() { public Cursor runQuery(CharSequence typed) { return getContext().getContentResolver().query( diff --git a/app/src/main/res/layout/fragment_compose.xml b/app/src/main/res/layout/fragment_compose.xml index 224de3b682..e1f01abcf5 100644 --- a/app/src/main/res/layout/fragment_compose.xml +++ b/app/src/main/res/layout/fragment_compose.xml @@ -24,7 +24,7 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="@id/spFrom" /> - - -