Fixed toggling off full screen mode in active speaker if currently speaking participant is audio only + started to add audio only layout & participant muted icon

This commit is contained in:
Sylvain Berfini 2022-02-11 15:25:25 +01:00
parent 197b45536c
commit 668fd1d78a
11 changed files with 65 additions and 3 deletions

View file

@ -39,6 +39,8 @@ class ConferenceParticipantDeviceData(
val activeSpeaker = MutableLiveData<Boolean>()
val micMuted = MutableLiveData<Boolean>()
val isInConference = MutableLiveData<Boolean>()
private var textureView: TextureView? = null
@ -95,6 +97,7 @@ class ConferenceParticipantDeviceData(
activeSpeaker.value = false
videoEnabled.value = participantDevice.getStreamAvailability(StreamType.Video)
micMuted.value = false // TODO
isInConference.value = participantDevice.isInConference
val videoCapability = participantDevice.getStreamCapability(StreamType.Video)

View file

@ -45,6 +45,7 @@ class ConferenceViewModel : ViewModel() {
val conferenceParticipantDevices = MutableLiveData<List<ConferenceParticipantDeviceData>>()
val conferenceMosaicDisplayMode = MutableLiveData<Boolean>()
val conferenceActiveSpeakerDisplayMode = MutableLiveData<Boolean>()
val conferenceAudioOnlyDisplayMode = MutableLiveData<Boolean>()
val isRecording = MutableLiveData<Boolean>()
val isRemotelyRecorded = MutableLiveData<Boolean>()
@ -182,6 +183,7 @@ class ConferenceViewModel : ViewModel() {
conferenceParticipantDevices.value = arrayListOf()
conferenceMosaicDisplayMode.value = false
conferenceActiveSpeakerDisplayMode.value = false
conferenceAudioOnlyDisplayMode.value = false
subject.value = AppUtils.getString(R.string.conference_default_title)

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<bitmap android:src="@drawable/voip_conference_audio_only"
android:tint="?attr/voipDrawableColor"/>
</item>
</selector>

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<bitmap android:src="@drawable/voip_micro_off"
android:tint="@color/white_color"/>
</item>
</selector>

View file

@ -104,6 +104,7 @@
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:onClick="@{() -> controlsViewModel.toggleFullScreen()}"
android:background="@drawable/shape_remote_background"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -124,7 +125,6 @@
<org.linphone.activities.voip.views.RoundCornersTextureView
android:id="@+id/conference_active_speaker_remote_video"
android:onClick="@{() -> controlsViewModel.toggleFullScreen()}"
android:visibility="@{!conferenceViewModel.isConferenceLocallyPaused &amp;&amp; conferenceViewModel.speakingParticipant.videoEnabled ? View.VISIBLE : View.GONE}"
android:layout_width="0dp"
android:layout_height="0dp"

View file

@ -92,6 +92,22 @@
android:layout_height="1dp"
android:background="?attr/dividerColor" />
<RadioButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:text="@string/conference_display_mode_audio_only"
android:checked="@={conferenceViewModel.conferenceAudioOnlyDisplayMode}"
android:drawableEnd="@drawable/icon_conference_layout_audio_only"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dividerColor" />
</RadioGroup>
</androidx.core.widget.NestedScrollView>

View file

@ -69,7 +69,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:padding="10dp"
android:padding="5dp"
android:src="@drawable/icon_call_camera_switch"
android:contentDescription="@string/content_description_switch_camera"
app:layout_constraintTop_toTopOf="@id/participant_video_surface"
@ -110,6 +110,18 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@id/participant_name"/>-->
<ImageView
android:layout_width="@dimen/voip_conference_participant_mic_muted_icon_size"
android:layout_height="@dimen/voip_conference_participant_mic_muted_icon_size"
android:visibility="@{data.micMuted ? View.VISIBLE : View.GONE, default=gone}"
android:padding="5dp"
android:layout_margin="5dp"
android:background="@drawable/shape_button_disabled_background"
android:src="@drawable/icon_mic_muted"
android:contentDescription="@string/content_description_conference_participant_mic_muted"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View file

@ -101,12 +101,24 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:padding="10dp"
android:padding="5dp"
android:src="@drawable/icon_call_camera_switch"
android:contentDescription="@string/content_description_switch_camera"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<ImageView
android:layout_height="@dimen/voip_conference_participant_mic_muted_icon_size"
android:layout_width="@dimen/voip_conference_participant_mic_muted_icon_size"
android:visibility="@{data.micMuted ? View.VISIBLE : View.GONE, default=gone}"
android:background="@drawable/shape_button_disabled_background"
android:src="@drawable/icon_mic_muted"
android:padding="5dp"
android:layout_margin="5dp"
android:contentDescription="@string/content_description_conference_participant_mic_muted"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -56,4 +56,5 @@
<dimen name="voip_active_speaker_miniature_margin">10dp</dimen>
<dimen name="voip_call_header_height">60dp</dimen>
<dimen name="voip_conference_active_speaker_miniature_avatar_size">50dp</dimen>
<dimen name="voip_conference_participant_mic_muted_icon_size">30dp</dimen>
</resources>

View file

@ -265,6 +265,7 @@
<string name="conference_invite_participants_count" tools:ignore="PluralsCandidate">%d participants</string>
<string name="conference_display_mode_mosaic">Mosaic mode</string>
<string name="conference_display_mode_active_speaker">Active speaker mode</string>
<string name="conference_display_mode_audio_only">Audio only mode</string>
<string name="conference_waiting_room_start_call">Start</string>
<string name="conference_waiting_room_cancel_call">Cancel</string>
<string name="conference_waiting_room_video_disabled">Video is currently disabled</string>
@ -805,4 +806,5 @@
<string name="content_description_show_numpad">Show numpad</string>
<string name="content_description_hide_numpad">Hide numpad</string>
<string name="content_description_go_to_chat_rooms_list">Go to conversations list</string>
<string name="content_description_conference_participant_mic_muted">Participant has it\'s microphone muted</string>
</resources>