Improved conference waiting room landscape UI + prevent camera to record when local preview is disabled
This commit is contained in:
parent
1de4999a65
commit
4c3c79e8a2
2 changed files with 300 additions and 4 deletions
|
@ -124,7 +124,6 @@ class ConferenceWaitingRoomViewModel : MessageNotifierViewModel() {
|
|||
|
||||
callParams.isVideoEnabled = isVideoAvailableInCore()
|
||||
callParams.videoDirection = if (core.videoActivationPolicy.automaticallyInitiate) MediaDirection.SendRecv else MediaDirection.RecvOnly
|
||||
Log.i("[Conference Waiting Room] Video will be ${if (callParams.isVideoEnabled) "enabled" else "disabled"}")
|
||||
updateVideoState()
|
||||
|
||||
isLowBandwidth.value = false
|
||||
|
@ -274,12 +273,10 @@ class ConferenceWaitingRoomViewModel : MessageNotifierViewModel() {
|
|||
}
|
||||
callParams.isVideoEnabled = isVideoAvailableInCore()
|
||||
callParams.videoDirection = if (callParams.videoDirection == MediaDirection.SendRecv) MediaDirection.RecvOnly else MediaDirection.SendRecv
|
||||
Log.i("[Conference Waiting Room] Video will be ${if (callParams.isVideoEnabled) "enabled" else "disabled"}")
|
||||
updateVideoState()
|
||||
}
|
||||
|
||||
fun enableVideo() {
|
||||
Log.i("[Conference Waiting Room] Video will be enabled")
|
||||
callParams.isVideoEnabled = isVideoAvailableInCore()
|
||||
callParams.videoDirection = MediaDirection.SendRecv
|
||||
updateVideoState()
|
||||
|
@ -342,8 +339,10 @@ class ConferenceWaitingRoomViewModel : MessageNotifierViewModel() {
|
|||
private fun updateVideoState() {
|
||||
isVideoAvailable.value = callParams.isVideoEnabled
|
||||
isVideoEnabled.value = callParams.isVideoEnabled && callParams.videoDirection == MediaDirection.SendRecv
|
||||
Log.i("[Conference Waiting Room] Video will be ${if (callParams.isVideoEnabled) "enabled" else "disabled"} with direction ${callParams.videoDirection}")
|
||||
|
||||
isSwitchCameraAvailable.value = callParams.isVideoEnabled && coreContext.showSwitchCameraButton()
|
||||
coreContext.core.isVideoPreviewEnabled = callParams.isVideoEnabled
|
||||
coreContext.core.isVideoPreviewEnabled = isVideoEnabled.value == true
|
||||
}
|
||||
|
||||
private fun isVideoAvailableInCore(): Boolean {
|
||||
|
|
|
@ -0,0 +1,297 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<import type="org.linphone.activities.voip.ConferenceDisplayMode" />
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="org.linphone.activities.main.conference.viewmodels.ConferenceWaitingRoomViewModel" />
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/voipBackgroundColor">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/shape_remote_video_background"
|
||||
android:visibility="@{viewModel.isVideoEnabled ? View.VISIBLE : View.GONE, default=gone}">
|
||||
|
||||
<org.linphone.activities.voip.views.RoundCornersTextureView
|
||||
android:id="@+id/local_preview_video_surface"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:alignTopRight="false"
|
||||
app:displayMode="occupy_all_space"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:contentDescription="@string/content_description_switch_camera"
|
||||
android:enabled="@{!viewModel.joinInProgress}"
|
||||
android:onClick="@{() -> viewModel.switchCamera()}"
|
||||
android:padding="10dp"
|
||||
android:src="@drawable/icon_call_camera_switch"
|
||||
android:visibility="@{viewModel.isSwitchCameraAvailable ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/conference_subject"
|
||||
style="@style/conference_waiting_room_subject_font"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_margin="20dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@{viewModel.subject, default=`Conference subject`}" />
|
||||
|
||||
<TextView
|
||||
style="@style/conference_waiting_room_no_video_font"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="@string/conference_waiting_room_video_disabled"
|
||||
android:visibility="@{viewModel.isVideoEnabled ? View.GONE : View.VISIBLE}" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/conference_controls"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@id/buttons"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/big_orange_button_font"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/shape_rect_gray_button"
|
||||
android:gravity="center"
|
||||
android:onClick="@{() -> viewModel.cancel()}"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:text="@string/conference_waiting_room_cancel_call" />
|
||||
|
||||
<TextView
|
||||
style="@style/big_orange_button_bold_font"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/button_orange_background"
|
||||
android:enabled="@{!viewModel.joinInProgress}"
|
||||
android:gravity="center"
|
||||
android:onClick="@{() -> viewModel.start()}"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:text="@string/conference_waiting_room_start_call" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@id/buttons"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:background="@drawable/shape_audio_routes_background"
|
||||
android:orientation="vertical"
|
||||
android:visibility="@{viewModel.audioRoutesSelected ? View.VISIBLE : View.GONE, default=gone}">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/voip_call_button_size"
|
||||
android:layout_height="@dimen/voip_call_button_size"
|
||||
android:layout_margin="5dp"
|
||||
android:background="@drawable/button_toggle_background_reverse"
|
||||
android:contentDescription="@string/content_description_use_bluetooth_headset"
|
||||
android:onClick="@{() -> viewModel.setBluetoothAudioRoute()}"
|
||||
android:selected="@{viewModel.isBluetoothHeadsetSelected}"
|
||||
android:src="@drawable/icon_bluetooth" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/voip_call_button_size"
|
||||
android:layout_height="@dimen/voip_call_button_size"
|
||||
android:layout_margin="5dp"
|
||||
android:background="@drawable/button_toggle_background_reverse"
|
||||
android:contentDescription="@string/content_description_use_earpiece"
|
||||
android:onClick="@{() -> viewModel.setEarpieceAudioRoute()}"
|
||||
android:selected="@{!viewModel.isSpeakerSelected && !viewModel.isBluetoothHeadsetSelected}"
|
||||
android:src="@drawable/icon_earpiece" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/voip_call_button_size"
|
||||
android:layout_height="@dimen/voip_call_button_size"
|
||||
android:layout_margin="5dp"
|
||||
android:background="@drawable/button_toggle_background_reverse"
|
||||
android:contentDescription="@string/content_description_use_speaker"
|
||||
android:onClick="@{() -> viewModel.setSpeakerAudioRoute()}"
|
||||
android:selected="@{viewModel.isSpeakerSelected}"
|
||||
android:src="@drawable/icon_speaker" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@id/buttons"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:background="@drawable/shape_audio_routes_background"
|
||||
android:orientation="vertical"
|
||||
android:visibility="@{viewModel.layoutMenuSelected ? View.VISIBLE : View.GONE, default=gone}">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/voip_call_button_size"
|
||||
android:layout_height="@dimen/voip_call_button_size"
|
||||
android:layout_margin="5dp"
|
||||
android:background="@drawable/button_toggle_background_reverse"
|
||||
android:contentDescription="@string/conference_display_mode_mosaic"
|
||||
android:onClick="@{() -> viewModel.setMosaicLayout()}"
|
||||
android:padding="5dp"
|
||||
android:selected="@{viewModel.selectedLayout == ConferenceDisplayMode.GRID}"
|
||||
android:src="@drawable/icon_conference_layout_grid"
|
||||
app:tint="@color/white_color" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/voip_call_button_size"
|
||||
android:layout_height="@dimen/voip_call_button_size"
|
||||
android:layout_margin="5dp"
|
||||
android:background="@drawable/button_toggle_background_reverse"
|
||||
android:contentDescription="@string/conference_display_mode_active_speaker"
|
||||
android:onClick="@{() -> viewModel.setActiveSpeakerLayout()}"
|
||||
android:padding="5dp"
|
||||
android:selected="@{viewModel.selectedLayout == ConferenceDisplayMode.ACTIVE_SPEAKER}"
|
||||
android:src="@drawable/icon_conference_layout_active_speaker"
|
||||
app:tint="@color/white_color" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/voip_call_button_size"
|
||||
android:layout_height="@dimen/voip_call_button_size"
|
||||
android:layout_margin="5dp"
|
||||
android:background="@drawable/button_toggle_background_reverse"
|
||||
android:contentDescription="@string/conference_display_mode_audio_only"
|
||||
android:onClick="@{() -> viewModel.setAudioOnlyLayout()}"
|
||||
android:padding="5dp"
|
||||
android:selected="@{viewModel.selectedLayout == ConferenceDisplayMode.AUDIO_ONLY}"
|
||||
android:src="@drawable/icon_conference_layout_audio_only"
|
||||
app:tint="@color/white_color" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/buttons"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/voip_buttons_fragment_size"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="10dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:background="@drawable/button_background_reverse"
|
||||
android:contentDescription="@{viewModel.isMicrophoneMuted ? @string/content_description_disable_mic_mute : @string/content_description_enable_mic_mute}"
|
||||
android:enabled="@{!viewModel.joinInProgress}"
|
||||
android:onClick="@{() -> viewModel.toggleMuteMicrophone()}"
|
||||
android:padding="5dp"
|
||||
android:selected="@{viewModel.isMicrophoneMuted}"
|
||||
android:src="@drawable/icon_toggle_mic"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="W,1:1"
|
||||
app:layout_constraintEnd_toStartOf="@id/speaker" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/speaker"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="W,1:1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/button_background_reverse"
|
||||
android:contentDescription="@{viewModel.isSpeakerSelected ? @string/content_description_disable_speaker : @string/content_description_enable_speaker}"
|
||||
android:enabled="@{!viewModel.joinInProgress}"
|
||||
android:onClick="@{() -> viewModel.toggleSpeaker()}"
|
||||
android:padding="5dp"
|
||||
android:selected="@{viewModel.isSpeakerSelected}"
|
||||
android:src="@drawable/icon_toggle_speaker"
|
||||
android:visibility="@{viewModel.audioRoutesEnabled ? View.GONE : View.VISIBLE}" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/button_toggle_background_reverse"
|
||||
android:contentDescription="@string/content_description_toggle_audio_menu"
|
||||
android:enabled="@{!viewModel.joinInProgress}"
|
||||
android:onClick="@{() -> viewModel.toggleAudioRoutesMenu()}"
|
||||
android:padding="5dp"
|
||||
android:selected="@{viewModel.audioRoutesSelected}"
|
||||
android:src="@drawable/icon_audio_routes"
|
||||
android:visibility="@{viewModel.audioRoutesEnabled ? View.VISIBLE : View.GONE, default=gone}" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="5dp"
|
||||
android:background="@drawable/button_background_reverse"
|
||||
android:contentDescription="@{viewModel.isVideoEnabled ? @string/content_description_disable_video : @string/content_description_enable_video}"
|
||||
android:enabled="@{!viewModel.joinInProgress && viewModel.isVideoAvailable && !viewModel.isLowBandwidth}"
|
||||
android:onClick="@{() -> viewModel.toggleVideo()}"
|
||||
android:padding="5dp"
|
||||
android:selected="@{viewModel.isVideoEnabled}"
|
||||
android:src="@drawable/icon_toggle_camera"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="W,1:1"
|
||||
app:layout_constraintStart_toEndOf="@id/speaker" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:background="@drawable/button_toggle_background_reverse"
|
||||
android:contentDescription="@string/content_description_toggle_layout_menu"
|
||||
android:enabled="@{!viewModel.joinInProgress && !viewModel.isLowBandwidth}"
|
||||
android:onClick="@{() -> viewModel.toggleLayoutMenu()}"
|
||||
android:padding="10dp"
|
||||
android:selected="@{viewModel.layoutMenuSelected}"
|
||||
android:src="@{viewModel.selectedLayout == ConferenceDisplayMode.ACTIVE_SPEAKER ? @drawable/icon_conference_layout_active_speaker : viewModel.selectedLayout == ConferenceDisplayMode.AUDIO_ONLY ? @drawable/icon_conference_layout_audio_only : @drawable/icon_conference_layout_grid, default=@drawable/icon_conference_layout_grid}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="W,1:1"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</layout>
|
Loading…
Reference in a new issue