Disable join conference button if cancel ICS is received
This commit is contained in:
parent
68d34735a6
commit
31ef42c829
5 changed files with 8 additions and 1 deletions
|
@ -89,7 +89,7 @@ class ChatRoomsListViewModel : MessageNotifierViewModel() {
|
|||
}
|
||||
|
||||
private val contactsListener = object : ContactsUpdatedListenerStub() {
|
||||
override fun onContactUpdated(friend: Friend) {
|
||||
override fun onContactsUpdated() {
|
||||
updateChatRooms()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ import java.util.concurrent.TimeUnit
|
|||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.R
|
||||
import org.linphone.core.ConferenceInfo
|
||||
import org.linphone.core.ConferenceInfoState
|
||||
import org.linphone.core.tools.Log
|
||||
import org.linphone.utils.LinphoneUtils
|
||||
import org.linphone.utils.TimestampUtils
|
||||
|
@ -43,6 +44,7 @@ class ScheduledConferenceData(val conferenceInfo: ConferenceInfo, private val is
|
|||
val participantsShort = MutableLiveData<String>()
|
||||
val participantsExpanded = MutableLiveData<String>()
|
||||
val showDuration = MutableLiveData<Boolean>()
|
||||
val isConferenceCancelled = MutableLiveData<Boolean>()
|
||||
|
||||
init {
|
||||
expanded.value = false
|
||||
|
@ -53,6 +55,7 @@ class ScheduledConferenceData(val conferenceInfo: ConferenceInfo, private val is
|
|||
|
||||
time.value = TimestampUtils.timeToString(conferenceInfo.dateTime)
|
||||
date.value = TimestampUtils.toString(conferenceInfo.dateTime, onlyDate = true, shortDate = false, hideYear = false)
|
||||
isConferenceCancelled.value = conferenceInfo.state == ConferenceInfoState.Cancelled
|
||||
|
||||
val minutes = conferenceInfo.duration
|
||||
val hours = TimeUnit.MINUTES.toHours(minutes.toLong())
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true"
|
||||
android:drawable="@drawable/shape_rect_orange_button" />
|
||||
<item android:state_enabled="false"
|
||||
android:drawable="@drawable/shape_rect_gray_button" />
|
||||
<item
|
||||
android:drawable="@drawable/shape_rect_green_button" />
|
||||
</selector>
|
||||
|
|
|
@ -124,6 +124,7 @@
|
|||
android:layout_gravity="center_vertical|end"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/button_green_background"
|
||||
android:enabled="@{data.isOutgoing || !data.isConferenceCancelled}"
|
||||
android:onClick="@{() -> data.callConferenceAddress()}"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="8dp"
|
||||
|
|
|
@ -248,6 +248,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/button_green_background"
|
||||
android:enabled="@{!data.isConferenceCancelled}"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingRight="20dp"
|
||||
|
|
Loading…
Reference in a new issue