1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-27 02:07:12 +00:00

Allow searching for multiple addresses

This commit is contained in:
M66B 2018-08-22 16:22:41 +00:00
parent 2e3ce7b708
commit 82855d9a1e
2 changed files with 11 additions and 7 deletions

View file

@ -42,10 +42,10 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.webkit.MimeTypeMap; import android.webkit.MimeTypeMap;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.EditText; import android.widget.EditText;
import android.widget.FilterQueryProvider; import android.widget.FilterQueryProvider;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.MultiAutoCompleteTextView;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.Spinner; import android.widget.Spinner;
import android.widget.TextView; import android.widget.TextView;
@ -86,11 +86,11 @@ public class FragmentCompose extends FragmentEx {
private ViewGroup view; private ViewGroup view;
private Spinner spFrom; private Spinner spFrom;
private ImageView ivIdentityAdd; private ImageView ivIdentityAdd;
private AutoCompleteTextView etTo; private MultiAutoCompleteTextView etTo;
private ImageView ivToAdd; private ImageView ivToAdd;
private AutoCompleteTextView etCc; private MultiAutoCompleteTextView etCc;
private ImageView ivCcAdd; private ImageView ivCcAdd;
private AutoCompleteTextView etBcc; private MultiAutoCompleteTextView etBcc;
private ImageView ivBccAdd; private ImageView ivBccAdd;
private EditText etSubject; private EditText etSubject;
private RecyclerView rvAttachment; private RecyclerView rvAttachment;
@ -264,6 +264,10 @@ public class FragmentCompose extends FragmentEx {
etCc.setAdapter(adapter); etCc.setAdapter(adapter);
etBcc.setAdapter(adapter); etBcc.setAdapter(adapter);
etTo.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
etCc.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
etBcc.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
adapter.setFilterQueryProvider(new FilterQueryProvider() { adapter.setFilterQueryProvider(new FilterQueryProvider() {
public Cursor runQuery(CharSequence typed) { public Cursor runQuery(CharSequence typed) {
return getContext().getContentResolver().query( return getContext().getContentResolver().query(

View file

@ -24,7 +24,7 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/spFrom" /> app:layout_constraintTop_toTopOf="@id/spFrom" />
<AutoCompleteTextView <MultiAutoCompleteTextView
android:id="@+id/etTo" android:id="@+id/etTo"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -49,7 +49,7 @@
app:layout_constraintStart_toEndOf="@id/etTo" app:layout_constraintStart_toEndOf="@id/etTo"
app:layout_constraintTop_toTopOf="@+id/etTo" /> app:layout_constraintTop_toTopOf="@+id/etTo" />
<AutoCompleteTextView <MultiAutoCompleteTextView
android:id="@+id/etCc" android:id="@+id/etCc"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -74,7 +74,7 @@
app:layout_constraintStart_toEndOf="@id/etCc" app:layout_constraintStart_toEndOf="@id/etCc"
app:layout_constraintTop_toTopOf="@+id/etCc" /> app:layout_constraintTop_toTopOf="@+id/etCc" />
<AutoCompleteTextView <MultiAutoCompleteTextView
android:id="@+id/etBcc" android:id="@+id/etBcc"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"