Minor code improvements
This commit is contained in:
parent
d72f19810d
commit
95c02be871
|
@ -61,15 +61,14 @@ class NewConversationActivity : SimpleActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchContacts()
|
fetchContacts()
|
||||||
new_conversation_address.onTextChangeListener {
|
new_conversation_address.onTextChangeListener { searchString ->
|
||||||
val searchString = it
|
|
||||||
val filteredContacts = ArrayList<SimpleContact>()
|
val filteredContacts = ArrayList<SimpleContact>()
|
||||||
allContacts.forEach {
|
allContacts.forEach { contact ->
|
||||||
if (it.phoneNumbers.any { it.normalizedNumber.contains(searchString, true) } ||
|
if (contact.phoneNumbers.any { it.normalizedNumber.contains(searchString, true) } ||
|
||||||
it.name.contains(searchString, true) ||
|
contact.name.contains(searchString, true) ||
|
||||||
it.name.contains(searchString.normalizeString(), true) ||
|
contact.name.contains(searchString.normalizeString(), true) ||
|
||||||
it.name.normalizeString().contains(searchString, true)) {
|
contact.name.normalizeString().contains(searchString, true)) {
|
||||||
filteredContacts.add(it)
|
filteredContacts.add(contact)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue