Showing snack bar when you're the first to join a conference or when you're the last one in it
This commit is contained in:
parent
5fd69bcd4c
commit
2ab24f893a
5 changed files with 40 additions and 3 deletions
|
@ -56,6 +56,5 @@ class PdfViewerFragment : GenericViewerFragment<FilePdfViewerFragmentBinding>()
|
||||||
|
|
||||||
adapter = PdfPagesListAdapter(viewModel)
|
adapter = PdfPagesListAdapter(viewModel)
|
||||||
binding.pdfViewPager.adapter = adapter
|
binding.pdfViewPager.adapter = adapter
|
||||||
//adapter.notifyDataSetChanged()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,6 +136,24 @@ class ConferenceCallFragment : GenericFragment<VoipConferenceCallFragmentBinding
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
conferenceViewModel.firstToJoinEvent.observe(
|
||||||
|
viewLifecycleOwner
|
||||||
|
) {
|
||||||
|
Snackbar
|
||||||
|
.make(binding.coordinator, R.string.conference_first_to_join, Snackbar.LENGTH_LONG)
|
||||||
|
.setAnchorView(binding.primaryButtons.hangup)
|
||||||
|
.show()
|
||||||
|
}
|
||||||
|
|
||||||
|
conferenceViewModel.allParticipantsLeftEvent.observe(
|
||||||
|
viewLifecycleOwner
|
||||||
|
) {
|
||||||
|
Snackbar
|
||||||
|
.make(binding.coordinator, R.string.conference_last_user, Snackbar.LENGTH_LONG)
|
||||||
|
.setAnchorView(binding.primaryButtons.hangup)
|
||||||
|
.show()
|
||||||
|
}
|
||||||
|
|
||||||
controlsViewModel.goToConferenceParticipantsListEvent.observe(
|
controlsViewModel.goToConferenceParticipantsListEvent.observe(
|
||||||
viewLifecycleOwner
|
viewLifecycleOwner
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -49,13 +49,21 @@ class ConferenceViewModel : ViewModel() {
|
||||||
val isRecording = MutableLiveData<Boolean>()
|
val isRecording = MutableLiveData<Boolean>()
|
||||||
val isRemotelyRecorded = MutableLiveData<Boolean>()
|
val isRemotelyRecorded = MutableLiveData<Boolean>()
|
||||||
|
|
||||||
|
val maxParticipantsForMosaicLayout = corePreferences.maxConferenceParticipantsForMosaicLayout
|
||||||
|
|
||||||
|
val speakingParticipant = MutableLiveData<ConferenceParticipantDeviceData>()
|
||||||
|
|
||||||
val participantAdminStatusChangedEvent: MutableLiveData<Event<ConferenceParticipantData>> by lazy {
|
val participantAdminStatusChangedEvent: MutableLiveData<Event<ConferenceParticipantData>> by lazy {
|
||||||
MutableLiveData<Event<ConferenceParticipantData>>()
|
MutableLiveData<Event<ConferenceParticipantData>>()
|
||||||
}
|
}
|
||||||
|
|
||||||
val maxParticipantsForMosaicLayout = corePreferences.maxConferenceParticipantsForMosaicLayout
|
val firstToJoinEvent: MutableLiveData<Event<Boolean>> by lazy {
|
||||||
|
MutableLiveData<Event<Boolean>>()
|
||||||
|
}
|
||||||
|
|
||||||
val speakingParticipant = MutableLiveData<ConferenceParticipantDeviceData>()
|
val allParticipantsLeftEvent: MutableLiveData<Event<Boolean>> by lazy {
|
||||||
|
MutableLiveData<Event<Boolean>>()
|
||||||
|
}
|
||||||
|
|
||||||
private val conferenceListener = object : ConferenceListenerStub() {
|
private val conferenceListener = object : ConferenceListenerStub() {
|
||||||
override fun onParticipantAdded(conference: Conference, participant: Participant) {
|
override fun onParticipantAdded(conference: Conference, participant: Participant) {
|
||||||
|
@ -72,6 +80,10 @@ class ConferenceViewModel : ViewModel() {
|
||||||
override fun onParticipantRemoved(conference: Conference, participant: Participant) {
|
override fun onParticipantRemoved(conference: Conference, participant: Participant) {
|
||||||
Log.i("[Conference] Participant removed: ${participant.address.asStringUriOnly()}")
|
Log.i("[Conference] Participant removed: ${participant.address.asStringUriOnly()}")
|
||||||
updateParticipantsList(conference)
|
updateParticipantsList(conference)
|
||||||
|
|
||||||
|
if (conferenceParticipants.value.orEmpty().isEmpty()) {
|
||||||
|
allParticipantsLeftEvent.value = Event(true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onParticipantDeviceAdded(
|
override fun onParticipantDeviceAdded(
|
||||||
|
@ -246,6 +258,10 @@ class ConferenceViewModel : ViewModel() {
|
||||||
isRecording.value = conference.isRecording
|
isRecording.value = conference.isRecording
|
||||||
|
|
||||||
updateConferenceLayout(conference)
|
updateConferenceLayout(conference)
|
||||||
|
|
||||||
|
if (conferenceParticipants.value.orEmpty().isEmpty()) {
|
||||||
|
firstToJoinEvent.value = Event(true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun configureConference(conference: Conference) {
|
fun configureConference(conference: Conference) {
|
||||||
|
|
|
@ -721,4 +721,6 @@
|
||||||
<string name="conference_low_bandwidth">Faible bande passante détectée, vidéo désactivée</string>
|
<string name="conference_low_bandwidth">Faible bande passante détectée, vidéo désactivée</string>
|
||||||
<string name="content_description_toggle_conference_info_details">Afficher/cacher les détails de la conférence</string>
|
<string name="content_description_toggle_conference_info_details">Afficher/cacher les détails de la conférence</string>
|
||||||
<string name="content_description_conference_participants">Participants de la conférence</string>
|
<string name="content_description_conference_participants">Participants de la conférence</string>
|
||||||
|
<string name="conference_first_to_join">Vous êtes le premier à avoir rejoint la conférence</string>
|
||||||
|
<string name="conference_last_user">Tous les autres participants ont quitté la conférence</string>
|
||||||
</resources>
|
</resources>
|
|
@ -290,6 +290,8 @@
|
||||||
<string name="conference_invitation_received_notification">You have been invited to a conference</string>
|
<string name="conference_invitation_received_notification">You have been invited to a conference</string>
|
||||||
<string name="conference_invitation">Conference invitation</string>
|
<string name="conference_invitation">Conference invitation</string>
|
||||||
<string name="conference_low_bandwidth">Low bandwidth detected, disabling video</string>
|
<string name="conference_low_bandwidth">Low bandwidth detected, disabling video</string>
|
||||||
|
<string name="conference_first_to_join">You\'re the first to join the conference</string>
|
||||||
|
<string name="conference_last_user">All other participants have left the conference</string>
|
||||||
|
|
||||||
<!-- Call -->
|
<!-- Call -->
|
||||||
<string name="call_incoming_title">Incoming Call</string>
|
<string name="call_incoming_title">Incoming Call</string>
|
||||||
|
|
Loading…
Reference in a new issue