avoid fetching event attendees on the main thread
This commit is contained in:
parent
499cf50c4c
commit
711a26dbfc
1 changed files with 17 additions and 17 deletions
|
@ -528,11 +528,9 @@ class EventActivity : SimpleActivity() {
|
|||
private fun checkAttendees() {
|
||||
ensureBackgroundThread {
|
||||
fillAvailableContacts()
|
||||
runOnUiThread {
|
||||
updateAttendees()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleNotificationAvailability(callback: () -> Unit) {
|
||||
if (NotificationManagerCompat.from(applicationContext).areNotificationsEnabled()) {
|
||||
|
@ -1357,6 +1355,7 @@ class EventActivity : SimpleActivity() {
|
|||
{ it.status })
|
||||
mAttendees.reverse()
|
||||
|
||||
runOnUiThread {
|
||||
mAttendees.forEach {
|
||||
val attendee = it
|
||||
val deviceContact = mAvailableContacts.firstOrNull { it.email.isNotEmpty() && it.email == attendee.email && it.photoUri.isNotEmpty() }
|
||||
|
@ -1376,6 +1375,7 @@ class EventActivity : SimpleActivity() {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun addAttendee(attendee: Attendee? = null) {
|
||||
val attendeeHolder = layoutInflater.inflate(R.layout.item_attendee, event_attendees_holder, false) as RelativeLayout
|
||||
|
|
Loading…
Reference in a new issue