From 64855cba770f13946c45b27da2e06352817c693d Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Sun, 20 Aug 2023 18:39:18 +0200 Subject: [PATCH] Added speaker off/on icons --- .../ui/voip/viewmodel/CurrentCallViewModel.kt | 2 ++ app/src/main/res/drawable/speaker.xml | 13 ------------- app/src/main/res/drawable/speaker_off.xml | 13 +++++++++++++ app/src/main/res/drawable/speaker_on.xml | 13 +++++++++++++ app/src/main/res/layout/voip_call_main_actions.xml | 2 +- 5 files changed, 29 insertions(+), 14 deletions(-) delete mode 100644 app/src/main/res/drawable/speaker.xml create mode 100644 app/src/main/res/drawable/speaker_off.xml create mode 100644 app/src/main/res/drawable/speaker_on.xml diff --git a/app/src/main/java/org/linphone/ui/voip/viewmodel/CurrentCallViewModel.kt b/app/src/main/java/org/linphone/ui/voip/viewmodel/CurrentCallViewModel.kt index 411ee3348..fd41900d1 100644 --- a/app/src/main/java/org/linphone/ui/voip/viewmodel/CurrentCallViewModel.kt +++ b/app/src/main/java/org/linphone/ui/voip/viewmodel/CurrentCallViewModel.kt @@ -53,6 +53,8 @@ class CurrentCallViewModel() : ViewModel() { val isMicrophoneMuted = MutableLiveData() + val isSpeakerEnabled = MutableLiveData() + val fullScreenMode = MutableLiveData() // To synchronize chronometers in UI diff --git a/app/src/main/res/drawable/speaker.xml b/app/src/main/res/drawable/speaker.xml deleted file mode 100644 index 1101a5c00..000000000 --- a/app/src/main/res/drawable/speaker.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/speaker_off.xml b/app/src/main/res/drawable/speaker_off.xml new file mode 100644 index 000000000..a38f6a2c5 --- /dev/null +++ b/app/src/main/res/drawable/speaker_off.xml @@ -0,0 +1,13 @@ + + + diff --git a/app/src/main/res/drawable/speaker_on.xml b/app/src/main/res/drawable/speaker_on.xml new file mode 100644 index 000000000..87ff088d3 --- /dev/null +++ b/app/src/main/res/drawable/speaker_on.xml @@ -0,0 +1,13 @@ + + + diff --git a/app/src/main/res/layout/voip_call_main_actions.xml b/app/src/main/res/layout/voip_call_main_actions.xml index 3d807b156..82391abb1 100644 --- a/app/src/main/res/layout/voip_call_main_actions.xml +++ b/app/src/main/res/layout/voip_call_main_actions.xml @@ -81,7 +81,7 @@ android:layout_height="@dimen/voip_button_size" android:layout_marginEnd="30dp" android:padding="@dimen/voip_button_icon_padding" - android:src="@drawable/speaker" + android:src="@{viewModel.isSpeakerEnabled ? @drawable/speaker_off : @drawable/speaker_on, default=@drawable/speaker_off}" android:background="@drawable/in_call_button_background" app:tint="@color/white" app:layout_constraintBottom_toBottomOf="parent"