From 62bea960e3f2e16757de1f00c7f69ed103bf7664 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 13 Mar 2019 22:49:25 +0100 Subject: [PATCH] apply attendees search string to contact names too, not just emails --- .../calendar/pro/adapters/AutoCompleteTextViewAdapter.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/AutoCompleteTextViewAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/AutoCompleteTextViewAdapter.kt index 7782cf3bb..5337a950a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/AutoCompleteTextViewAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/AutoCompleteTextViewAdapter.kt @@ -8,6 +8,7 @@ import android.widget.Filter import com.simplemobiletools.calendar.pro.R import com.simplemobiletools.calendar.pro.activities.SimpleActivity import com.simplemobiletools.calendar.pro.models.Attendee +import com.simplemobiletools.commons.extensions.normalizeString import kotlinx.android.synthetic.main.item_autocomplete.view.* class AutoCompleteTextViewAdapter(val activity: SimpleActivity, val contacts: ArrayList) : ArrayAdapter(activity, 0, contacts) { @@ -30,8 +31,9 @@ class AutoCompleteTextViewAdapter(val activity: SimpleActivity, val contacts: Ar val filterResults = Filter.FilterResults() if (constraint != null) { resultList.clear() + val searchString = constraint.toString().normalizeString() contacts.forEach { - if (it.email.contains(constraint, true)) { + if (it.email.contains(searchString, true) || it.name.contains(searchString, true)) { resultList.add(it) } }