mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-08 07:58:51 +01:00
avoid fetching event attendees on the main thread
This commit is contained in:
parent
499cf50c4c
commit
711a26dbfc
@ -528,11 +528,9 @@ class EventActivity : SimpleActivity() {
|
|||||||
private fun checkAttendees() {
|
private fun checkAttendees() {
|
||||||
ensureBackgroundThread {
|
ensureBackgroundThread {
|
||||||
fillAvailableContacts()
|
fillAvailableContacts()
|
||||||
runOnUiThread {
|
|
||||||
updateAttendees()
|
updateAttendees()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private fun handleNotificationAvailability(callback: () -> Unit) {
|
private fun handleNotificationAvailability(callback: () -> Unit) {
|
||||||
if (NotificationManagerCompat.from(applicationContext).areNotificationsEnabled()) {
|
if (NotificationManagerCompat.from(applicationContext).areNotificationsEnabled()) {
|
||||||
@ -1357,6 +1355,7 @@ class EventActivity : SimpleActivity() {
|
|||||||
{ it.status })
|
{ it.status })
|
||||||
mAttendees.reverse()
|
mAttendees.reverse()
|
||||||
|
|
||||||
|
runOnUiThread {
|
||||||
mAttendees.forEach {
|
mAttendees.forEach {
|
||||||
val attendee = it
|
val attendee = it
|
||||||
val deviceContact = mAvailableContacts.firstOrNull { it.email.isNotEmpty() && it.email == attendee.email && it.photoUri.isNotEmpty() }
|
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) {
|
private fun addAttendee(attendee: Attendee? = null) {
|
||||||
val attendeeHolder = layoutInflater.inflate(R.layout.item_attendee, event_attendees_holder, false) as RelativeLayout
|
val attendeeHolder = layoutInflater.inflate(R.layout.item_attendee, event_attendees_holder, false) as RelativeLayout
|
||||||
|
Loading…
x
Reference in New Issue
Block a user