mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-06-05 21:49:22 +02:00
fill the suggested contacts before the remaining ones
This commit is contained in:
@@ -39,14 +39,15 @@ class NewMessageActivity : SimpleActivity() {
|
||||
return
|
||||
}
|
||||
|
||||
getAvailableContacts {
|
||||
allContacts = it
|
||||
runOnUiThread {
|
||||
setupAdapter(allContacts)
|
||||
fillSuggestedContacts {
|
||||
getAvailableContacts {
|
||||
allContacts = it
|
||||
runOnUiThread {
|
||||
setupAdapter(allContacts)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fillSuggestedContacts()
|
||||
new_message_to.onTextChangeListener {
|
||||
val searchString = it
|
||||
val filteredContacts = ArrayList<Contact>()
|
||||
@@ -89,7 +90,7 @@ class NewMessageActivity : SimpleActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun fillSuggestedContacts() {
|
||||
private fun fillSuggestedContacts(callback: () -> Unit) {
|
||||
ensureBackgroundThread {
|
||||
val suggestions = getSuggestedContacts()
|
||||
runOnUiThread {
|
||||
@@ -107,6 +108,7 @@ class NewMessageActivity : SimpleActivity() {
|
||||
}
|
||||
}
|
||||
}
|
||||
callback()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user