diff --git a/app/src/main/java/org/linphone/ui/call/fragment/ActiveCallFragment.kt b/app/src/main/java/org/linphone/ui/call/fragment/ActiveCallFragment.kt index 429789fe7..6b8f52c93 100644 --- a/app/src/main/java/org/linphone/ui/call/fragment/ActiveCallFragment.kt +++ b/app/src/main/java/org/linphone/ui/call/fragment/ActiveCallFragment.kt @@ -94,9 +94,8 @@ class ActiveCallFragment : GenericCallFragment() { } } - private val bottomSheetCallback = object : BottomSheetBehavior.BottomSheetCallback() { + private val numpadBottomSheetCallback = object : BottomSheetBehavior.BottomSheetCallback() { override fun onStateChanged(bottomSheet: View, newState: Int) { - Log.i("$TAG Bottom sheet state is [$newState]") if (newState == BottomSheetBehavior.STATE_COLLAPSED) { val numpadBottomSheetBehavior = BottomSheetBehavior.from(bottomSheet) numpadBottomSheetBehavior.state = BottomSheetBehavior.STATE_HIDDEN @@ -106,6 +105,14 @@ class ActiveCallFragment : GenericCallFragment() { override fun onSlide(bottomSheet: View, slideOffset: Float) { } } + private val actionsBottomSheetCallback = object : BottomSheetBehavior.BottomSheetCallback() { + override fun onStateChanged(bottomSheet: View, newState: Int) { + callViewModel.extraActionsBottomSheetVisible.value = newState != BottomSheetBehavior.STATE_COLLAPSED + } + + override fun onSlide(bottomSheet: View, slideOffset: Float) { } + } + override fun onCreateAnimation(transit: Int, enter: Boolean, nextAnim: Int): Animation? { if (findNavController().currentDestination?.id == R.id.newCallFragment || findNavController().currentDestination?.id == R.id.callsListFragment) { // Holds fragment in place while new fragment slides over it @@ -141,10 +148,15 @@ class ActiveCallFragment : GenericCallFragment() { val actionsBottomSheetBehavior = BottomSheetBehavior.from(binding.bottomBar.root) actionsBottomSheetBehavior.state = BottomSheetBehavior.STATE_COLLAPSED + actionsBottomSheetBehavior.addBottomSheetCallback(actionsBottomSheetCallback) val numpadBottomSheetBehavior = BottomSheetBehavior.from(binding.callNumpad.root) numpadBottomSheetBehavior.state = BottomSheetBehavior.STATE_HIDDEN - numpadBottomSheetBehavior.addBottomSheetCallback(bottomSheetCallback) + numpadBottomSheetBehavior.addBottomSheetCallback(numpadBottomSheetCallback) + + binding.setBackClickListener { + requireActivity().finish() + } binding.setNewCallClickListener { val action = ActiveCallFragmentDirections.actionActiveCallFragmentToNewCallFragment() diff --git a/app/src/main/java/org/linphone/ui/call/viewmodel/CurrentCallViewModel.kt b/app/src/main/java/org/linphone/ui/call/viewmodel/CurrentCallViewModel.kt index beb2c8098..5fc997717 100644 --- a/app/src/main/java/org/linphone/ui/call/viewmodel/CurrentCallViewModel.kt +++ b/app/src/main/java/org/linphone/ui/call/viewmodel/CurrentCallViewModel.kt @@ -39,6 +39,7 @@ import org.linphone.core.Core import org.linphone.core.CoreListenerStub import org.linphone.core.MediaDirection import org.linphone.core.MediaEncryption +import org.linphone.core.StreamType import org.linphone.core.tools.Log import org.linphone.ui.call.model.AudioDeviceModel import org.linphone.ui.call.model.CallMediaEncryptionModel @@ -150,6 +151,8 @@ class CurrentCallViewModel @UiThread constructor() : ViewModel() { // Extras actions + val extraActionsBottomSheetVisible = MutableLiveData() + val toggleExtraActionsBottomSheetEvent: MutableLiveData> by lazy { MutableLiveData>() } @@ -711,8 +714,12 @@ class CurrentCallViewModel @UiThread constructor() : ViewModel() { } isMediaEncrypted.postValue(true) - // When Post Quantum is available, ZRTP is Post Quantum - isZrtpPq.postValue(coreContext.core.postQuantumAvailable) + + // When Post Quantum is available, ZRTP is Post Quantum if key exchange was made with Post Quantum algorithm + val stats = currentCall.getStats(StreamType.Audio) + isZrtpPq.postValue( + coreContext.core.postQuantumAvailable && stats?.isZrtpKeyAgreementAlgoPostQuantum == true + ) if (!isDeviceTrusted && !authToken.isNullOrEmpty()) { Log.i("$TAG Showing ZRTP SAS confirmation dialog") diff --git a/app/src/main/res/drawable/atom.xml b/app/src/main/res/drawable/atom.xml new file mode 100644 index 000000000..e51c3ba36 --- /dev/null +++ b/app/src/main/res/drawable/atom.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/handle.xml b/app/src/main/res/drawable/handle.xml new file mode 100644 index 000000000..167d1369e --- /dev/null +++ b/app/src/main/res/drawable/handle.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/lock_simple.xml b/app/src/main/res/drawable/lock_simple.xml new file mode 100644 index 000000000..3f544790f --- /dev/null +++ b/app/src/main/res/drawable/lock_simple.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/layout-land/call_actions_bottom_sheet.xml b/app/src/main/res/layout-land/call_actions_bottom_sheet.xml index 07696a747..d832eb71c 100644 --- a/app/src/main/res/layout-land/call_actions_bottom_sheet.xml +++ b/app/src/main/res/layout-land/call_actions_bottom_sheet.xml @@ -11,9 +11,6 @@ - @@ -26,6 +23,7 @@ android:layout_width="match_parent" android:layout_height="@dimen/call_all_actions_menu_height" android:background="@drawable/shape_call_bottom_sheet_background" + android:visibility="@{viewModel.fullScreenMode || viewModel.pipMode ? View.INVISIBLE : View.VISIBLE}" app:behavior_hideable="false" app:behavior_peekHeight="@dimen/call_main_actions_menu_height" app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"> @@ -126,28 +124,12 @@ android:background="@drawable/shape_round_in_call_disabled_button_background" android:padding="@dimen/call_button_icon_padding" android:src="@drawable/chat_teardrop_text" - android:visibility="gone" app:layout_constraintDimensionRatio="1:1" app:layout_constraintEnd_toEndOf="@id/chat_label" app:layout_constraintStart_toStartOf="@id/chat_label" app:layout_constraintTop_toBottomOf="@id/main_actions" app:tint="@color/gray_500" /> - - @@ -238,23 +220,10 @@ android:layout_height="wrap_content" android:paddingBottom="15dp" android:text="@string/call_action_show_messages" - android:visibility="gone" app:layout_constraintEnd_toStartOf="@id/pause_call_label" app:layout_constraintStart_toEndOf="@id/numpad_label" app:layout_constraintTop_toBottomOf="@id/chat" /> - - - @@ -26,6 +23,7 @@ android:layout_width="match_parent" android:layout_height="@dimen/call_all_actions_menu_height" android:background="@drawable/shape_call_bottom_sheet_background" + android:visibility="@{viewModel.fullScreenMode || viewModel.pipMode ? View.INVISIBLE : View.VISIBLE}" app:behavior_hideable="false" app:behavior_peekHeight="@dimen/call_main_actions_menu_height" app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"> @@ -126,28 +124,12 @@ android:padding="@dimen/call_button_icon_padding" android:src="@drawable/chat_teardrop_text" android:background="@drawable/shape_round_in_call_disabled_button_background" - android:visibility="gone" app:tint="?attr/color_grey_500" app:layout_constraintDimensionRatio="1:1" app:layout_constraintTop_toBottomOf="@id/transfer_label" app:layout_constraintStart_toStartOf="@id/transfer" app:layout_constraintEnd_toEndOf="@id/transfer"/> - - - - + @@ -58,7 +61,7 @@ android:layout_marginStart="12dp" android:layout_marginEnd="12dp" android:layout_marginBottom="@dimen/call_main_actions_menu_margin" - app:layout_constraintTop_toBottomOf="@id/call_direction_label" + app:layout_constraintTop_toBottomOf="@id/media_encryption" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" /> @@ -77,7 +80,7 @@ app:layout_constraintEnd_toEndOf="@id/background" app:layout_constraintStart_toStartOf="@id/background" app:layout_constraintTop_toTopOf="@id/background" - app:layout_constraintBottom_toTopOf="@id/name"/> + app:layout_constraintBottom_toTopOf="@id/address"/> - - @@ -134,31 +124,30 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="@{viewModel.fullScreenMode || viewModel.pipMode ? View.INVISIBLE : View.VISIBLE}" - app:constraint_referenced_ids="call_direction_icon, call_direction_label, separator, chronometer" /> + app:constraint_referenced_ids="back, name, separator, chronometer" /> + app:layout_constraintTop_toTopOf="parent" + app:tint="@color/white" /> + android:text="@{viewModel.displayedName, default=`John Doe`}" + app:layout_constraintStart_toEndOf="@id/back" + app:layout_constraintTop_toTopOf="@id/back" + app:layout_constraintBottom_toBottomOf="@id/back"/> + app:layout_constraintStart_toEndOf="@id/name" + app:layout_constraintTop_toTopOf="@id/name"/> + app:layout_constraintEnd_toStartOf="@id/switch_camera" + app:layout_constraintTop_toTopOf="@id/name"/> + app:layout_constraintTop_toTopOf="@id/name"/> + + + android:src="@drawable/cell_signal_full" + android:visibility="@{!viewModel.fullScreenMode && !viewModel.pipMode ? View.VISIBLE : View.GONE}" + app:tint="@color/white" + app:layout_constraintTop_toTopOf="@id/back" + app:layout_constraintBottom_toBottomOf="@id/back" + app:layout_constraintEnd_toEndOf="parent" /> + app:layout_constraintTop_toTopOf="@id/back" + app:layout_constraintBottom_toBottomOf="@id/back" + app:layout_constraintEnd_toStartOf="@+id/stats" /> + bind:callsListClickListener="@{callsListClickListener}"/> Paused by remote Resuming… Ended + End-to-end encrypted by ZRTP + End-to-end encrypted by post-quantum ZRTP Calls list Transfer call to %s is recording