Browse Source

Allow searching for multiple addresses

main
M66B 6 years ago
parent
commit
82855d9a1e
2 changed files with 11 additions and 7 deletions
  1. +8
    -4
      app/src/main/java/eu/faircode/email/FragmentCompose.java
  2. +3
    -3
      app/src/main/res/layout/fragment_compose.xml

+ 8
- 4
app/src/main/java/eu/faircode/email/FragmentCompose.java 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(


+ 3
- 3
app/src/main/res/layout/fragment_compose.xml 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"


Loading…
Cancel
Save