mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-02-16 19:40:43 +01:00
Rename AutoFill
to AutoComplete
This commit is contained in:
parent
45bb46f433
commit
b5d760aa54
@ -259,7 +259,7 @@ class EditContactActivity : ContactActivity() {
|
||||
|
||||
val nameTextViews = arrayOf(contact_first_name, contact_middle_name, contact_surname).filter { it.isVisible() }
|
||||
if (nameTextViews.isNotEmpty()) {
|
||||
setupAutofill(nameTextViews)
|
||||
setupAutoComplete(nameTextViews)
|
||||
}
|
||||
|
||||
updateTextColors(contact_scrollview)
|
||||
@ -1535,7 +1535,7 @@ class EditContactActivity : ContactActivity() {
|
||||
else -> Im.PROTOCOL_CUSTOM
|
||||
}
|
||||
|
||||
private fun setupAutofill(nameTextViews: List<MyAutoCompleteTextView>) {
|
||||
private fun setupAutoComplete(nameTextViews: List<MyAutoCompleteTextView>) {
|
||||
ContactsHelper(this).getContacts { contacts ->
|
||||
val adapter = AutoCompleteTextViewAdapter(this, contacts)
|
||||
val handler = Handler(mainLooper)
|
||||
@ -1556,7 +1556,7 @@ class EditContactActivity : ContactActivity() {
|
||||
}
|
||||
view.doAfterTextChanged {
|
||||
handler.postDelayed({
|
||||
adapter.enableAutoFill = true
|
||||
adapter.autoComplete = true
|
||||
adapter.filter.filter(it)
|
||||
}, AUTO_FILL_DELAY)
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ import kotlinx.android.synthetic.main.item_autocomplete_name_number.view.item_au
|
||||
class AutoCompleteTextViewAdapter(
|
||||
val activity: SimpleActivity,
|
||||
val contacts: ArrayList<Contact>,
|
||||
var enableAutoFill: Boolean = false
|
||||
var autoComplete: Boolean = false
|
||||
) : ArrayAdapter<Contact>(activity, 0, contacts) {
|
||||
var resultList = ArrayList<Contact>()
|
||||
|
||||
@ -76,7 +76,7 @@ class AutoCompleteTextViewAdapter(
|
||||
val filterResults = FilterResults()
|
||||
if (constraint != null) {
|
||||
resultList.clear()
|
||||
if (enableAutoFill) {
|
||||
if (autoComplete) {
|
||||
val searchString = constraint.toString().normalizeString()
|
||||
contacts.forEach {
|
||||
if (it.getNameToDisplay().contains(searchString, true)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user