fill the suggested contacts before the remaining ones
This commit is contained in:
parent
5a462775fd
commit
827be7225b
|
@ -39,14 +39,15 @@ class NewMessageActivity : SimpleActivity() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
getAvailableContacts {
|
fillSuggestedContacts {
|
||||||
allContacts = it
|
getAvailableContacts {
|
||||||
runOnUiThread {
|
allContacts = it
|
||||||
setupAdapter(allContacts)
|
runOnUiThread {
|
||||||
|
setupAdapter(allContacts)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fillSuggestedContacts()
|
|
||||||
new_message_to.onTextChangeListener {
|
new_message_to.onTextChangeListener {
|
||||||
val searchString = it
|
val searchString = it
|
||||||
val filteredContacts = ArrayList<Contact>()
|
val filteredContacts = ArrayList<Contact>()
|
||||||
|
@ -89,7 +90,7 @@ class NewMessageActivity : SimpleActivity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun fillSuggestedContacts() {
|
private fun fillSuggestedContacts(callback: () -> Unit) {
|
||||||
ensureBackgroundThread {
|
ensureBackgroundThread {
|
||||||
val suggestions = getSuggestedContacts()
|
val suggestions = getSuggestedContacts()
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
|
@ -107,6 +108,7 @@ class NewMessageActivity : SimpleActivity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
callback()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue