Skip to content

Commit bcb062c

Browse files
committed
fill AddFavorite dialog asynchronously
1 parent 85c303e commit bcb062c

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

app/src/main/kotlin/com/simplemobiletools/contacts/dialogs/AddFavoritesDialog.kt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,23 @@ class AddFavoritesDialog(val activity: SimpleActivity, val callback: () -> Unit)
3030
allContacts = allContacts.filter { contactSources.contains(it.source) } as ArrayList<Contact>
3131
}
3232

33-
view.apply {
34-
add_favorites_list.adapter = AddFavoritesAdapter(activity, allContacts, config.favorites)
35-
add_favorites_fastscroller.allowBubbleDisplay = activity.baseConfig.showInfoBubble
36-
add_favorites_fastscroller.setViews(add_favorites_list) {
37-
add_favorites_fastscroller.updateBubbleText(allContacts[it].getBubbleText())
38-
}
39-
}
40-
4133
activity.runOnUiThread {
42-
dialog = AlertDialog.Builder(activity)
43-
.setPositiveButton(R.string.ok, { dialog, which -> dialogConfirmed() })
44-
.setNegativeButton(R.string.cancel, null)
45-
.create().apply {
46-
activity.setupDialogStuff(view, this)
34+
view.apply {
35+
add_favorites_list.adapter = AddFavoritesAdapter(activity, allContacts, config.favorites)
36+
add_favorites_fastscroller.allowBubbleDisplay = activity.baseConfig.showInfoBubble
37+
add_favorites_fastscroller.setViews(add_favorites_list) {
38+
add_favorites_fastscroller.updateBubbleText(allContacts[it].getBubbleText())
39+
}
4740
}
4841
}
4942
}
43+
44+
dialog = AlertDialog.Builder(activity)
45+
.setPositiveButton(R.string.ok, { dialog, which -> dialogConfirmed() })
46+
.setNegativeButton(R.string.cancel, null)
47+
.create().apply {
48+
activity.setupDialogStuff(view, this)
49+
}
5050
}
5151

5252
private fun dialogConfirmed() {

0 commit comments

Comments
 (0)