fill AddFavorite dialog asynchronously

This commit is contained in:
tibbi 2017-12-31 12:54:24 +01:00
parent 85c303e6dc
commit bcb062c08a
1 changed files with 13 additions and 13 deletions

View File

@ -30,23 +30,23 @@ class AddFavoritesDialog(val activity: SimpleActivity, val callback: () -> Unit)
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 {
dialog = AlertDialog.Builder(activity)
.setPositiveButton(R.string.ok, { dialog, which -> dialogConfirmed() })
.setNegativeButton(R.string.cancel, null)
.create().apply {
activity.setupDialogStuff(view, this)
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())
}
}
}
}
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() {