Added video preview to participants & layout conference fragments so other participants will still see the user video while he's naviagating in conference related fragments
This commit is contained in:
parent
c9a9059d68
commit
0fa68e2379
4 changed files with 89 additions and 52 deletions
|
@ -23,6 +23,7 @@ import android.os.Bundle
|
|||
import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
import androidx.navigation.navGraphViewModels
|
||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.R
|
||||
import org.linphone.activities.GenericFragment
|
||||
import org.linphone.activities.voip.viewmodels.ConferenceViewModel
|
||||
|
@ -64,6 +65,8 @@ class ConferenceLayoutFragment : GenericFragment<VoipConferenceLayoutFragmentBin
|
|||
if (conferenceViewModel.conferenceParticipantDevices.value.orEmpty().size > conferenceViewModel.maxParticipantsForMosaicLayout) {
|
||||
showTooManyParticipantsForMosaicLayoutDialog()
|
||||
}
|
||||
|
||||
coreContext.core.nativePreviewWindowId = binding.localPreviewVideoSurface
|
||||
}
|
||||
|
||||
private fun showTooManyParticipantsForMosaicLayoutDialog() {
|
||||
|
|
|
@ -23,15 +23,14 @@ import android.os.Bundle
|
|||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import androidx.navigation.navGraphViewModels
|
||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.R
|
||||
import org.linphone.activities.GenericFragment
|
||||
import org.linphone.activities.voip.viewmodels.CallsViewModel
|
||||
import org.linphone.activities.voip.viewmodels.ConferenceViewModel
|
||||
import org.linphone.core.tools.Log
|
||||
import org.linphone.databinding.VoipConferenceParticipantsFragmentBinding
|
||||
|
||||
class ConferenceParticipantsFragment : GenericFragment<VoipConferenceParticipantsFragmentBinding>() {
|
||||
private val callsViewModel: CallsViewModel by navGraphViewModels(R.id.call_nav_graph)
|
||||
private val conferenceViewModel: ConferenceViewModel by navGraphViewModels(R.id.call_nav_graph)
|
||||
|
||||
override fun getLayoutId(): Int = R.layout.voip_conference_participants_fragment
|
||||
|
@ -41,8 +40,6 @@ class ConferenceParticipantsFragment : GenericFragment<VoipConferenceParticipant
|
|||
|
||||
binding.lifecycleOwner = viewLifecycleOwner
|
||||
|
||||
binding.callsViewModel = callsViewModel
|
||||
|
||||
binding.conferenceViewModel = conferenceViewModel
|
||||
|
||||
conferenceViewModel.conferenceExists.observe(
|
||||
|
@ -77,4 +74,10 @@ class ConferenceParticipantsFragment : GenericFragment<VoipConferenceParticipant
|
|||
// TODO: go to conferences view outside of call activity in edition mode
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
|
||||
coreContext.core.nativePreviewWindowId = binding.localPreviewVideoSurface
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,14 +3,19 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<import type="org.linphone.core.ConferenceLayout" />
|
||||
|
||||
<variable
|
||||
name="cancelClickListener"
|
||||
type="android.view.View.OnClickListener"/>
|
||||
type="android.view.View.OnClickListener" />
|
||||
|
||||
<variable
|
||||
name="dismissDialogClickListener"
|
||||
type="android.view.View.OnClickListener"/>
|
||||
type="android.view.View.OnClickListener" />
|
||||
|
||||
<variable
|
||||
name="conferenceViewModel"
|
||||
type="org.linphone.activities.voip.viewmodels.ConferenceViewModel" />
|
||||
|
@ -28,22 +33,22 @@
|
|||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
style="@style/calls_list_header_font"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginStart="20dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/call_action_change_conf_layout"
|
||||
style="@style/calls_list_header_font"
|
||||
app:layout_constraintTop_toBottomOf="@id/top_bar"/>
|
||||
app:layout_constraintTop_toBottomOf="@id/top_bar" />
|
||||
|
||||
<ImageView
|
||||
android:onClick="@{cancelClickListener}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:contentDescription="@string/cancel"
|
||||
android:onClick="@{cancelClickListener}"
|
||||
android:padding="10dp"
|
||||
android:src="@drawable/icon_cancel"
|
||||
android:contentDescription="@string/cancel"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
@ -51,8 +56,8 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:background="?attr/voipBackgroundBWColor"
|
||||
app:layout_constraintTop_toBottomOf="@id/top_bar"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/top_bar">
|
||||
|
||||
<RadioGroup
|
||||
android:layout_width="match_parent"
|
||||
|
@ -60,18 +65,18 @@
|
|||
android:orientation="vertical">
|
||||
|
||||
<RadioButton
|
||||
android:onClickListener="@{() -> conferenceViewModel.changeLayout(ConferenceLayout.Grid)}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="@string/conference_display_mode_mosaic"
|
||||
android:enabled="@{conferenceViewModel.conferenceParticipantDevices.size() > conferenceViewModel.maxParticipantsForMosaicLayout ? false : true}"
|
||||
android:checked="@{conferenceViewModel.conferenceMosaicDisplayMode}"
|
||||
android:drawableEnd="@drawable/icon_conference_layout_grid"
|
||||
android:drawableTint="?attr/voipDrawableColor"/>
|
||||
android:drawableTint="?attr/voipDrawableColor"
|
||||
android:enabled="@{conferenceViewModel.conferenceParticipantDevices.size() > conferenceViewModel.maxParticipantsForMosaicLayout ? false : true}"
|
||||
android:onClickListener="@{() -> conferenceViewModel.changeLayout(ConferenceLayout.Grid)}"
|
||||
android:text="@string/conference_display_mode_mosaic" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
|
@ -79,18 +84,18 @@
|
|||
android:background="?attr/dividerColor" />
|
||||
|
||||
<RadioButton
|
||||
android:onClickListener="@{() -> conferenceViewModel.changeLayout(ConferenceLayout.ActiveSpeaker)}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="@string/conference_display_mode_active_speaker"
|
||||
android:enabled="@{conferenceViewModel.conferenceParticipantDevices.size() > conferenceViewModel.maxParticipantsForMosaicLayout ? false : true}"
|
||||
android:checked="@{conferenceViewModel.conferenceActiveSpeakerDisplayMode}"
|
||||
android:drawableEnd="@drawable/icon_conference_layout_active_speaker"
|
||||
android:drawableTint="?attr/voipDrawableColor"/>
|
||||
android:drawableTint="?attr/voipDrawableColor"
|
||||
android:enabled="@{conferenceViewModel.conferenceParticipantDevices.size() > conferenceViewModel.maxParticipantsForMosaicLayout ? false : true}"
|
||||
android:onClickListener="@{() -> conferenceViewModel.changeLayout(ConferenceLayout.ActiveSpeaker)}"
|
||||
android:text="@string/conference_display_mode_active_speaker" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
|
@ -99,17 +104,17 @@
|
|||
|
||||
<!-- TODO: FIXME: Use AudioOnly layout -->
|
||||
<RadioButton
|
||||
android:onClickListener="@{() -> conferenceViewModel.changeLayout(ConferenceLayout.Legacy)}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="@string/conference_display_mode_audio_only"
|
||||
android:checked="@{conferenceViewModel.conferenceAudioOnlyDisplayMode}"
|
||||
android:drawableEnd="@drawable/icon_conference_layout_audio_only"
|
||||
android:drawableTint="?attr/voipDrawableColor"/>
|
||||
android:drawableTint="?attr/voipDrawableColor"
|
||||
android:onClickListener="@{() -> conferenceViewModel.changeLayout(ConferenceLayout.Legacy)}"
|
||||
android:text="@string/conference_display_mode_audio_only" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
|
@ -120,14 +125,27 @@
|
|||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<org.linphone.activities.voip.views.RoundCornersTextureView
|
||||
android:id="@+id/local_preview_video_surface"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_size="@{@dimen/video_preview_max_size}"
|
||||
app:alignTopRight="true"
|
||||
app:displayMode="black_bars"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="200dp"
|
||||
app:layout_constraintWidth_max="200dp" />
|
||||
|
||||
<include
|
||||
android:id="@+id/too_many_participants_dialog"
|
||||
layout="@layout/voip_dialog_info"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"
|
||||
app:dialogMessage="@{@string/conference_layout_too_many_participants_for_mosaic}"
|
||||
app:dismissClickListener="@{dismissDialogClickListener}"/>
|
||||
app:dismissClickListener="@{dismissDialogClickListener}" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
|
|
@ -3,16 +3,17 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="editClickListener"
|
||||
type="android.view.View.OnClickListener"/>
|
||||
type="android.view.View.OnClickListener" />
|
||||
|
||||
<variable
|
||||
name="cancelClickListener"
|
||||
type="android.view.View.OnClickListener"/>
|
||||
<variable
|
||||
name="callsViewModel"
|
||||
type="org.linphone.activities.voip.viewmodels.CallsViewModel" />
|
||||
type="android.view.View.OnClickListener" />
|
||||
|
||||
<variable
|
||||
name="conferenceViewModel"
|
||||
type="org.linphone.activities.voip.viewmodels.ConferenceViewModel" />
|
||||
|
@ -30,34 +31,33 @@
|
|||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
style="@style/calls_list_header_font"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginStart="20dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/call_action_participants_list"
|
||||
style="@style/calls_list_header_font"
|
||||
app:layout_constraintTop_toBottomOf="@id/top_bar"/>
|
||||
app:layout_constraintTop_toBottomOf="@id/top_bar" />
|
||||
|
||||
<ImageView
|
||||
android:onClick="@{editClickListener}"
|
||||
android:visibility="@{conferenceViewModel.isMeAdmin ? View.VISIBLE : View.GONE}"
|
||||
android:enabled="false"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@drawable/icon_edit_alt"
|
||||
android:contentDescription="@string/content_description_add_participants"
|
||||
android:onClick="@{editClickListener}"
|
||||
android:src="@drawable/icon_edit_alt"
|
||||
android:visibility="@{conferenceViewModel.isMeAdmin ? View.GONE : View.GONE, default=gone}"
|
||||
app:layout_constraintEnd_toStartOf="@id/cancel" />
|
||||
<!-- TODO: remove enabled=false -->
|
||||
<!-- TODO: set visibility to VISIBLE when isMeAdmin -->
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/cancel"
|
||||
android:onClick="@{cancelClickListener}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:contentDescription="@string/cancel"
|
||||
android:onClick="@{cancelClickListener}"
|
||||
android:padding="10dp"
|
||||
android:src="@drawable/icon_cancel"
|
||||
android:contentDescription="@string/cancel"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
@ -65,27 +65,40 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:background="?attr/voipBackgroundBWColor"
|
||||
app:layout_constraintTop_toBottomOf="@id/top_bar"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/top_bar">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:entries="@{conferenceViewModel.conferenceParticipants}"
|
||||
app:layout="@{@layout/voip_conference_participant_cell}"/>
|
||||
app:layout="@{@layout/voip_conference_participant_cell}" />
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<TextView
|
||||
android:visibility="@{conferenceViewModel.conferenceParticipants.empty ? View.VISIBLE : View.GONE}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/conference_empty"
|
||||
app:layout_constraintTop_toBottomOf="@id/top_bar"
|
||||
android:visibility="@{conferenceViewModel.conferenceParticipants.empty ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
app:layout_constraintTop_toBottomOf="@id/top_bar" />
|
||||
|
||||
<org.linphone.activities.voip.views.RoundCornersTextureView
|
||||
android:id="@+id/local_preview_video_surface"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_size="@{@dimen/video_preview_max_size}"
|
||||
app:alignTopRight="true"
|
||||
app:displayMode="black_bars"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="200dp"
|
||||
app:layout_constraintWidth_max="200dp" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
|
Loading…
Reference in a new issue