Updated picto in calls history when call log was for a conference

This commit is contained in:
Sylvain Berfini 2024-01-25 16:48:48 +01:00
parent 8870564066
commit e6d5e35f29
2 changed files with 10 additions and 7 deletions

View file

@ -31,10 +31,12 @@ class CallLogModel @WorkerThread constructor(private val callLog: CallLog) {
val avatarModel: ContactAvatarModel
@IntegerRes
val iconResId = MutableLiveData<Int>()
val wasConference: Boolean
val dateTime = MutableLiveData<String>()
@IntegerRes
val iconResId: Int
val dateTime: String
val friendRefKey: String?
@ -49,9 +51,10 @@ class CallLogModel @WorkerThread constructor(private val callLog: CallLog) {
TimestampUtils.toString(timestamp, onlyDate = true, shortDate = true, hideYear = true)
}
val time = TimestampUtils.timeToString(timestamp)
dateTime.postValue("$date | $time")
dateTime = "$date | $time"
if (callLog.wasConference()) {
wasConference = callLog.wasConference()
if (wasConference) {
val conferenceInfo = coreContext.core.findConferenceInformationFromUri(address)
if (conferenceInfo != null) {
avatarModel = coreContext.contactsManager.getContactAvatarModelForConferenceInfo(
@ -78,7 +81,7 @@ class CallLogModel @WorkerThread constructor(private val callLog: CallLog) {
}
displayedAddress = avatarModel.friend.address?.asStringUriOnly() ?: address.asStringUriOnly()
iconResId.postValue(LinphoneUtils.getCallIconResId(callLog.status, callLog.dir))
iconResId = LinphoneUtils.getCallIconResId(callLog.status, callLog.dir)
}
@UiThread

View file

@ -109,7 +109,7 @@
android:layout_width="@dimen/icon_size"
android:layout_height="@dimen/icon_size"
android:layout_marginEnd="6dp"
android:src="@drawable/phone"
android:src="@{model.wasConference ? @drawable/meeting : @drawable/phone, default=@drawable/phone}"
app:tint="?attr/color_main2_500"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/name"