mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Improved connection to meeting waiting screen
This commit is contained in:
parent
4d8b74ee41
commit
16d15242c7
14 changed files with 162 additions and 1 deletions
|
|
@ -39,6 +39,7 @@ import org.linphone.core.tools.Log
|
|||
import org.linphone.databinding.MeetingWaitingRoomFragmentBinding
|
||||
import org.linphone.ui.call.fragment.AudioDevicesMenuDialogFragment
|
||||
import org.linphone.ui.call.model.AudioDeviceModel
|
||||
import org.linphone.ui.main.MainActivity
|
||||
import org.linphone.ui.main.fragment.GenericFragment
|
||||
import org.linphone.ui.main.meetings.viewmodel.MeetingWaitingRoomViewModel
|
||||
|
||||
|
|
@ -132,6 +133,17 @@ class MeetingWaitingRoomFragment : GenericFragment() {
|
|||
}
|
||||
}
|
||||
|
||||
viewModel.conferenceCreationError.observe(viewLifecycleOwner) {
|
||||
it.consume {
|
||||
Log.e("$TAG Error joining the conference!")
|
||||
val message = getString(
|
||||
R.string.toast_no_app_registered_to_handle_content_type_error
|
||||
)
|
||||
val icon = R.drawable.x
|
||||
(requireActivity() as MainActivity).showRedToast(message, icon)
|
||||
}
|
||||
}
|
||||
|
||||
if (!isCameraPermissionGranted()) {
|
||||
viewModel.isVideoAvailable.value = false
|
||||
Log.w("$TAG Camera permission wasn't granted yet, asking for it now")
|
||||
|
|
|
|||
|
|
@ -70,6 +70,8 @@ class MeetingWaitingRoomViewModel @UiThread constructor() : ViewModel() {
|
|||
|
||||
val hideVideo = MutableLiveData<Boolean>()
|
||||
|
||||
val joining = MutableLiveData<Boolean>()
|
||||
|
||||
val conferenceInfoFoundEvent = MutableLiveData<Event<Boolean>>()
|
||||
|
||||
val showAudioDevicesListEvent: MutableLiveData<Event<ArrayList<AudioDeviceModel>>> by lazy {
|
||||
|
|
@ -80,6 +82,10 @@ class MeetingWaitingRoomViewModel @UiThread constructor() : ViewModel() {
|
|||
MutableLiveData<Event<Boolean>>()
|
||||
}
|
||||
|
||||
val conferenceCreationError: MutableLiveData<Event<Boolean>> by lazy {
|
||||
MutableLiveData<Event<Boolean>>()
|
||||
}
|
||||
|
||||
private lateinit var conferenceInfo: ConferenceInfo
|
||||
|
||||
private lateinit var selectedOutputAudioDevice: AudioDevice
|
||||
|
|
@ -97,11 +103,17 @@ class MeetingWaitingRoomViewModel @UiThread constructor() : ViewModel() {
|
|||
Log.i("$TAG Conference state changed: [$state]")
|
||||
if (conference.state == Conference.State.Created) {
|
||||
conferenceCreatedEvent.postValue(Event(true))
|
||||
joining.postValue(false)
|
||||
} else if (conference.state == Conference.State.CreationFailed) {
|
||||
conferenceCreationError.postValue(Event(true))
|
||||
joining.postValue(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
joining.value = false
|
||||
|
||||
coreContext.postOnCoreThread { core ->
|
||||
core.addListener(coreListener)
|
||||
|
||||
|
|
@ -193,6 +205,7 @@ class MeetingWaitingRoomViewModel @UiThread constructor() : ViewModel() {
|
|||
params.outputAudioDevice = selectedOutputAudioDevice
|
||||
}
|
||||
params.account = core.defaultAccount
|
||||
joining.postValue(true)
|
||||
coreContext.startCall(conferenceUri, params)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -206,7 +206,13 @@ fun AppCompatTextView.setDrawableTint(@ColorInt color: Int) {
|
|||
@UiThread
|
||||
@BindingAdapter("presenceIcon")
|
||||
fun ImageView.setPresenceIcon(presence: ConsolidatedPresence?) {
|
||||
visibility = if (presence == null || presence == ConsolidatedPresence.Offline) {
|
||||
setPresenceIcon(presence, false)
|
||||
}
|
||||
|
||||
@UiThread
|
||||
@BindingAdapter("presenceIcon", "hidePresence")
|
||||
fun ImageView.setPresenceIcon(presence: ConsolidatedPresence?, hidePresence: Boolean) {
|
||||
visibility = if (hidePresence || presence == null || presence == ConsolidatedPresence.Offline) {
|
||||
View.GONE
|
||||
} else {
|
||||
View.VISIBLE
|
||||
|
|
|
|||
|
|
@ -192,6 +192,60 @@
|
|||
app:layout_constraintStart_toEndOf="@id/half_screen"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="@color/gray_900"
|
||||
android:visibility="@{viewModel.joining ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintTop_toBottomOf="@id/back"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style_300"
|
||||
android:id="@+id/joining_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/meeting_waiting_room_joining_title"
|
||||
android:textSize="22sp"
|
||||
android:textColor="@color/white"
|
||||
android:gravity="center"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/joining_subtitle"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style_300"
|
||||
android:id="@+id/joining_subtitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="@string/meeting_waiting_room_joining_subtitle"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/white"
|
||||
android:gravity="center"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/joining_title"
|
||||
app:layout_constraintBottom_toTopOf="@id/joining_progress"/>
|
||||
|
||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
android:id="@+id/joining_progress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="40dp"
|
||||
android:indeterminate="true"
|
||||
app:indicatorColor="?attr/color_main1_500"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/joining_subtitle"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
|
|
@ -30,6 +30,7 @@
|
|||
android:visibility="@{model.isSendingVideo || model.isJoining || !model.isInConference ? View.GONE : View.VISIBLE}"
|
||||
layout="@layout/contact_avatar_medium"
|
||||
bind:model="@{model.avatarModel}"
|
||||
bind:hidePresence="@{true}"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
android:layout_marginStart="10dp"
|
||||
layout="@layout/contact_avatar"
|
||||
bind:model="@{model.avatarModel}"
|
||||
bind:hidePresence="@{true}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
android:visibility="@{model.isSendingVideo || model.isJoining || !model.isInConference ? View.GONE : View.VISIBLE}"
|
||||
layout="@layout/contact_avatar_big"
|
||||
bind:model="@{model.avatarModel}"
|
||||
bind:hidePresence="@{true}"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@
|
|||
<variable
|
||||
name="model"
|
||||
type="org.linphone.contacts.AbstractAvatarModel" />
|
||||
<variable
|
||||
name="hidePresence"
|
||||
type="Boolean" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
|
|
@ -47,6 +50,7 @@
|
|||
android:padding="@dimen/avatar_presence_badge_padding"
|
||||
android:contentDescription="@{model.presenceStatus == ConsolidatedPresence.Online ? @string/content_description_contact_online : @string/content_description_contact_away}"
|
||||
app:presenceIcon="@{model.presenceStatus}"
|
||||
app:hidePresence="@{hidePresence}"
|
||||
app:layout_constraintEnd_toEndOf="@id/avatar"
|
||||
app:layout_constraintBottom_toBottomOf="@id/avatar" />
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@
|
|||
<variable
|
||||
name="model"
|
||||
type="org.linphone.contacts.AbstractAvatarModel" />
|
||||
<variable
|
||||
name="hidePresence"
|
||||
type="Boolean" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
|
|
@ -47,6 +50,7 @@
|
|||
android:padding="@dimen/avatar_presence_badge_big_padding"
|
||||
android:contentDescription="@{model.presenceStatus == ConsolidatedPresence.Online ? @string/content_description_contact_online : @string/content_description_contact_away}"
|
||||
app:presenceIcon="@{model.presenceStatus}"
|
||||
app:hidePresence="@{hidePresence}"
|
||||
app:layout_constraintEnd_toEndOf="@id/avatar"
|
||||
app:layout_constraintBottom_toBottomOf="@id/avatar" />
|
||||
|
||||
|
|
@ -62,4 +66,5 @@
|
|||
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
|
|
@ -9,6 +9,9 @@
|
|||
<variable
|
||||
name="model"
|
||||
type="org.linphone.contacts.AbstractAvatarModel" />
|
||||
<variable
|
||||
name="hidePresence"
|
||||
type="Boolean" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
|
|
@ -47,6 +50,7 @@
|
|||
android:padding="@dimen/avatar_presence_badge_padding"
|
||||
android:contentDescription="@{model.presenceStatus == ConsolidatedPresence.Online ? @string/content_description_contact_online : @string/content_description_contact_away}"
|
||||
app:presenceIcon="@{model.presenceStatus}"
|
||||
app:hidePresence="@{hidePresence}"
|
||||
app:layout_constraintEnd_toEndOf="@id/avatar"
|
||||
app:layout_constraintBottom_toBottomOf="@id/avatar" />
|
||||
|
||||
|
|
@ -62,4 +66,5 @@
|
|||
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
|
|
@ -62,4 +62,5 @@
|
|||
app:layout_constraintBottom_toBottomOf="@id/avatar"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
|
|
@ -188,6 +188,60 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="@color/gray_900"
|
||||
android:visibility="@{viewModel.joining ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintTop_toBottomOf="@id/back"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style_300"
|
||||
android:id="@+id/joining_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/meeting_waiting_room_joining_title"
|
||||
android:textSize="22sp"
|
||||
android:textColor="@color/white"
|
||||
android:gravity="center"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/joining_subtitle"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style_300"
|
||||
android:id="@+id/joining_subtitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="@string/meeting_waiting_room_joining_subtitle"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/white"
|
||||
android:gravity="center"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/joining_title"
|
||||
app:layout_constraintBottom_toTopOf="@id/joining_progress"/>
|
||||
|
||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
android:id="@+id/joining_progress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="40dp"
|
||||
android:indeterminate="true"
|
||||
app:indicatorColor="?attr/color_main1_500"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/joining_subtitle"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
|
|
@ -485,6 +485,8 @@
|
|||
<string name="meeting_info_cancelled_toast">La réunion a été annulée</string>
|
||||
|
||||
<string name="meeting_waiting_room_join">Rejoindre</string>
|
||||
<string name="meeting_waiting_room_joining_title">Connexion à la réunion</string>
|
||||
<string name="meeting_waiting_room_joining_subtitle">Vous allez rejoindre la réunion dans quelques instants…</string>
|
||||
|
||||
<string name="call_outgoing">Appel sortant</string>
|
||||
<string name="call_incoming">Appel entrant</string>
|
||||
|
|
|
|||
|
|
@ -534,6 +534,8 @@
|
|||
<string name="meeting_info_cancelled_toast">Meeting has been cancelled</string>
|
||||
|
||||
<string name="meeting_waiting_room_join">Join</string>
|
||||
<string name="meeting_waiting_room_joining_title">Connection in progress</string>
|
||||
<string name="meeting_waiting_room_joining_subtitle">You\'ll be joining in a short moment</string>
|
||||
|
||||
<!-- Call related -->
|
||||
<string name="call_outgoing">Outgoing call</string>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue