mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-06-05 21:59:27 +02:00
fill AddFavorite dialog asynchronously
This commit is contained in:
@ -30,23 +30,23 @@ class AddFavoritesDialog(val activity: SimpleActivity, val callback: () -> Unit)
|
|||||||
allContacts = allContacts.filter { contactSources.contains(it.source) } as ArrayList<Contact>
|
allContacts = allContacts.filter { contactSources.contains(it.source) } as ArrayList<Contact>
|
||||||
}
|
}
|
||||||
|
|
||||||
view.apply {
|
|
||||||
add_favorites_list.adapter = AddFavoritesAdapter(activity, allContacts, config.favorites)
|
|
||||||
add_favorites_fastscroller.allowBubbleDisplay = activity.baseConfig.showInfoBubble
|
|
||||||
add_favorites_fastscroller.setViews(add_favorites_list) {
|
|
||||||
add_favorites_fastscroller.updateBubbleText(allContacts[it].getBubbleText())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
activity.runOnUiThread {
|
activity.runOnUiThread {
|
||||||
dialog = AlertDialog.Builder(activity)
|
view.apply {
|
||||||
.setPositiveButton(R.string.ok, { dialog, which -> dialogConfirmed() })
|
add_favorites_list.adapter = AddFavoritesAdapter(activity, allContacts, config.favorites)
|
||||||
.setNegativeButton(R.string.cancel, null)
|
add_favorites_fastscroller.allowBubbleDisplay = activity.baseConfig.showInfoBubble
|
||||||
.create().apply {
|
add_favorites_fastscroller.setViews(add_favorites_list) {
|
||||||
activity.setupDialogStuff(view, this)
|
add_favorites_fastscroller.updateBubbleText(allContacts[it].getBubbleText())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dialog = AlertDialog.Builder(activity)
|
||||||
|
.setPositiveButton(R.string.ok, { dialog, which -> dialogConfirmed() })
|
||||||
|
.setNegativeButton(R.string.cancel, null)
|
||||||
|
.create().apply {
|
||||||
|
activity.setupDialogStuff(view, this)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun dialogConfirmed() {
|
private fun dialogConfirmed() {
|
||||||
|
Reference in New Issue
Block a user