From 4ab54a50c12e5547013d852234b0c2dd781b60f2 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 1 Jul 2022 16:02:10 +0200 Subject: [PATCH] Updated conference layouts to adapt like single call when foldable device is folded --- .../voip/fragments/ConferenceCallFragment.kt | 15 ++- .../voip_conference_active_speaker.xml | 99 ++++++++++++++++--- .../res/layout-land/voip_conference_grid.xml | 95 +++++++++++++++--- .../layout/voip_conference_active_speaker.xml | 95 +++++++++++++++--- .../res/layout/voip_conference_audio_only.xml | 97 +++++++++++++++--- .../layout/voip_conference_call_fragment.xml | 11 ++- ...onference_creation_pending_wait_layout.xml | 2 + .../main/res/layout/voip_conference_grid.xml | 95 +++++++++++++++--- .../res/layout/voip_conference_header.xml | 77 --------------- .../res/layout/voip_single_call_fragment.xml | 2 +- app/src/main/res/values/dimen.xml | 3 +- 11 files changed, 426 insertions(+), 165 deletions(-) delete mode 100644 app/src/main/res/layout/voip_conference_header.xml diff --git a/app/src/main/java/org/linphone/activities/voip/fragments/ConferenceCallFragment.kt b/app/src/main/java/org/linphone/activities/voip/fragments/ConferenceCallFragment.kt index 7167d85e6..060209de7 100644 --- a/app/src/main/java/org/linphone/activities/voip/fragments/ConferenceCallFragment.kt +++ b/app/src/main/java/org/linphone/activities/voip/fragments/ConferenceCallFragment.kt @@ -27,6 +27,7 @@ import android.view.View import android.widget.Chronometer import android.widget.Toast import androidx.constraintlayout.widget.ConstraintLayout +import androidx.constraintlayout.widget.ConstraintSet import androidx.databinding.DataBindingUtil import androidx.databinding.ViewDataBinding import androidx.navigation.navGraphViewModels @@ -89,10 +90,8 @@ class ConferenceCallFragment : GenericFragment(R.id.conference_active_speaker_layout) val window = - layout?.findViewById(R.id.conference_active_speaker_remote_video) + binding.root.findViewById(R.id.conference_active_speaker_remote_video) coreContext.core.nativeVideoWindowId = window } else { Log.i("[Conference Call] Either not in conference or current layout isn't active speaker, updating Core's native window id") @@ -330,21 +329,21 @@ class ConferenceCallFragment : GenericFragment(R.id.conference_active_speaker_layout) - constraintLayout ?: return - + val constraintLayout = binding.root.findViewById(R.id.conference_constraint_layout) + ?: return val set = ConstraintSet() set.clone(constraintLayout) if (state == FoldingFeature.State.HALF_OPENED) { set.setGuidelinePercent(R.id.hinge_top, 0.5f) set.setGuidelinePercent(R.id.hinge_bottom, 0.5f) + controlsViewModel.folded.value = true } else { set.setGuidelinePercent(R.id.hinge_top, 0f) set.setGuidelinePercent(R.id.hinge_bottom, 1f) + controlsViewModel.folded.value = false } - set.applyTo(constraintLayout)*/ + set.applyTo(constraintLayout) } } diff --git a/app/src/main/res/layout-land/voip_conference_active_speaker.xml b/app/src/main/res/layout-land/voip_conference_active_speaker.xml index d27dd6cf7..6be978e31 100644 --- a/app/src/main/res/layout-land/voip_conference_active_speaker.xml +++ b/app/src/main/res/layout-land/voip_conference_active_speaker.xml @@ -20,37 +20,103 @@ - + + + + + + + app:constraint_referenced_ids="remote_name,active_conference_timer,toggle_conference_recording,toggle_pause_conference" /> + + + + + + + + - - diff --git a/app/src/main/res/layout-land/voip_conference_grid.xml b/app/src/main/res/layout-land/voip_conference_grid.xml index 06fd5be8d..0e9146eae 100644 --- a/app/src/main/res/layout-land/voip_conference_grid.xml +++ b/app/src/main/res/layout-land/voip_conference_grid.xml @@ -20,45 +20,112 @@ - + + + + + + + app:constraint_referenced_ids="remote_name,active_conference_timer,toggle_conference_recording,toggle_pause_conference" /> + + + + + + + + - - - + + + + + + + app:constraint_referenced_ids="remote_name,active_conference_timer,toggle_conference_recording,toggle_pause_conference" /> + + + + + + + + - - - + + + + + + + app:constraint_referenced_ids="remote_name,active_conference_timer,toggle_conference_recording,toggle_pause_conference" /> + + + + + + + + - - @@ -43,13 +44,12 @@ android:id="@+id/stubbed_conference_active_speaker_layout" android:layout_width="match_parent" android:layout_height="0dp" - android:inflatedId="@+id/conference_active_speaker_layout" android:layout="@layout/voip_conference_active_speaker" android:visibility="@{conferenceViewModel.conferenceDisplayMode == ConferenceDisplayMode.ACTIVE_SPEAKER && conferenceViewModel.conferenceExists && !callsViewModel.currentCallData.isActiveAndNotInConference ? View.VISIBLE : View.GONE, default=gone}" app:conferenceViewModel="@{conferenceViewModel}" app:controlsViewModel="@{controlsViewModel}" app:inflatedVisibility="@{conferenceViewModel.conferenceDisplayMode == ConferenceDisplayMode.ACTIVE_SPEAKER && conferenceViewModel.conferenceExists && !callsViewModel.currentCallData.isActiveAndNotInConference ? View.VISIBLE : View.GONE}" - app:layout_constraintBottom_toTopOf="@id/primary_buttons" + app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintTop_toTopOf="parent" /> diff --git a/app/src/main/res/layout/voip_conference_creation_pending_wait_layout.xml b/app/src/main/res/layout/voip_conference_creation_pending_wait_layout.xml index e0aa9338e..c0869421c 100644 --- a/app/src/main/res/layout/voip_conference_creation_pending_wait_layout.xml +++ b/app/src/main/res/layout/voip_conference_creation_pending_wait_layout.xml @@ -9,6 +9,7 @@ @@ -22,6 +23,7 @@ android:indeterminateTint="?attr/accentColor" /> - + + + + + + + app:constraint_referenced_ids="remote_name,active_conference_timer,toggle_conference_recording,toggle_pause_conference" /> + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/voip_single_call_fragment.xml b/app/src/main/res/layout/voip_single_call_fragment.xml index b4d4f11aa..f5f656311 100644 --- a/app/src/main/res/layout/voip_single_call_fragment.xml +++ b/app/src/main/res/layout/voip_single_call_fragment.xml @@ -133,7 +133,7 @@ android:id="@+id/background" android:layout_width="0dp" android:layout_height="0dp" - android:layout_margin="@{controlsViewModel.fullScreenMode || controlsViewModel.pipMode ? @dimen/voip_remote_margin_full_screen : @dimen/voip_remote_margin, default=@dimen/voip_remote_margin}" + android:layout_margin="@{controlsViewModel.fullScreenMode || controlsViewModel.pipMode ? @dimen/margin_0dp : @dimen/voip_remote_margin, default=@dimen/voip_remote_margin}" android:background="@drawable/shape_remote_background" app:layout_constraintBottom_toTopOf="@id/bottom_barrier" app:layout_constraintEnd_toEndOf="parent" diff --git a/app/src/main/res/values/dimen.xml b/app/src/main/res/values/dimen.xml index 11f3807d5..b9b8fd0b5 100644 --- a/app/src/main/res/values/dimen.xml +++ b/app/src/main/res/values/dimen.xml @@ -38,8 +38,8 @@ 14sp 1sp 50dp + 55dp 10dp - 0dp 60dp 80dp 50dp @@ -72,4 +72,5 @@ 0dp 50dp 85dp + 30dp \ No newline at end of file