Fixed scheduled conference background color in meetings list
This commit is contained in:
parent
a3f55b3baf
commit
b8e65b3ac7
2 changed files with 4 additions and 9 deletions
|
@ -28,9 +28,8 @@ import org.linphone.core.tools.Log
|
|||
import org.linphone.utils.LinphoneUtils
|
||||
import org.linphone.utils.TimestampUtils
|
||||
|
||||
class ScheduledConferenceData(val conferenceInfo: ConferenceInfo) {
|
||||
class ScheduledConferenceData(val conferenceInfo: ConferenceInfo, private val isFinished: Boolean) {
|
||||
val expanded = MutableLiveData<Boolean>()
|
||||
val isFinished = MutableLiveData<Boolean>()
|
||||
val backgroundResId = MutableLiveData<Int>()
|
||||
|
||||
val address = MutableLiveData<String>()
|
||||
|
@ -79,11 +78,7 @@ class ScheduledConferenceData(val conferenceInfo: ConferenceInfo) {
|
|||
Log.e("[Scheduled Conference] No organizer SIP URI found for: ${conferenceInfo.uri?.asStringUriOnly()}")
|
||||
}
|
||||
|
||||
val now = System.currentTimeMillis() / 1000 // Linphone uses time_t in seconds
|
||||
val limit = conferenceInfo.dateTime + conferenceInfo.duration
|
||||
isFinished.value = limit < now
|
||||
computeBackgroundResId()
|
||||
|
||||
computeParticipantsLists()
|
||||
}
|
||||
|
||||
|
@ -109,7 +104,7 @@ class ScheduledConferenceData(val conferenceInfo: ConferenceInfo) {
|
|||
}
|
||||
|
||||
private fun computeBackgroundResId() {
|
||||
backgroundResId.value = if (isFinished.value == true) {
|
||||
backgroundResId.value = if (isFinished) {
|
||||
if (expanded.value == true) {
|
||||
R.drawable.shape_round_dark_gray_background_with_orange_border
|
||||
} else {
|
||||
|
|
|
@ -81,14 +81,14 @@ class ScheduledConferencesViewModel : ViewModel() {
|
|||
if (conferenceInfo.duration == 0) continue // This isn't a scheduled conference, don't display it
|
||||
val limit = conferenceInfo.dateTime + conferenceInfo.duration
|
||||
if (limit >= now) continue // This isn't a terminated conference, don't display it
|
||||
val data = ScheduledConferenceData(conferenceInfo)
|
||||
val data = ScheduledConferenceData(conferenceInfo, true)
|
||||
conferencesList.add(0, data) // Keep terminated meetings list in reverse order to always display most recent on top
|
||||
}
|
||||
} else {
|
||||
val oneHourAgo = now - 7200 // Show all conferences from 2 hours ago and forward
|
||||
for (conferenceInfo in coreContext.core.getConferenceInformationListAfterTime(oneHourAgo)) {
|
||||
if (conferenceInfo.duration == 0) continue // This isn't a scheduled conference, don't display it
|
||||
val data = ScheduledConferenceData(conferenceInfo)
|
||||
val data = ScheduledConferenceData(conferenceInfo, false)
|
||||
conferencesList.add(data)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue