From e38040428bca57e11c6bdbea55b1d6fe49762b55 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Mon, 5 May 2025 13:45:01 +0200 Subject: [PATCH] Improved empty lists (contacts & conversations) labels + added button to let user know it can change account --- .../main/viewmodel/AbstractMainViewModel.kt | 13 ++++++++ .../res/layout-land/chat_list_fragment.xml | 33 ++++++++++++++++--- .../layout-land/contacts_list_fragment.xml | 6 ++-- .../res/layout-land/history_list_fragment.xml | 31 ++++++++++++++--- .../main/res/layout/chat_list_fragment.xml | 24 +++++++++++++- .../res/layout/contacts_list_fragment.xml | 3 +- app/src/main/res/layout/drawer_menu.xml | 14 ++------ .../main/res/layout/history_list_fragment.xml | 24 +++++++++++++- app/src/main/res/values-fr/strings.xml | 5 +-- app/src/main/res/values/strings.xml | 5 +-- 10 files changed, 128 insertions(+), 30 deletions(-) diff --git a/app/src/main/java/org/linphone/ui/main/viewmodel/AbstractMainViewModel.kt b/app/src/main/java/org/linphone/ui/main/viewmodel/AbstractMainViewModel.kt index 7482d4b92..e81993a00 100644 --- a/app/src/main/java/org/linphone/ui/main/viewmodel/AbstractMainViewModel.kt +++ b/app/src/main/java/org/linphone/ui/main/viewmodel/AbstractMainViewModel.kt @@ -70,6 +70,8 @@ open class AbstractMainViewModel val isFilterEmpty = MutableLiveData() + val moreThanOneAccount = MutableLiveData() + val focusSearchBarEvent: MutableLiveData> by lazy { MutableLiveData>() } @@ -146,6 +148,16 @@ open class AbstractMainViewModel } } + @WorkerThread + override fun onAccountAdded(core: Core, account: Account) { + moreThanOneAccount.postValue(core.accountList.size > 1) + } + + @WorkerThread + override fun onAccountRemoved(core: Core, account: Account) { + moreThanOneAccount.postValue(core.accountList.size > 1) + } + @WorkerThread override fun onDefaultAccountChanged(core: Core, defaultAccount: Account?) { updateAvailableMenus() @@ -175,6 +187,7 @@ open class AbstractMainViewModel hideMeetings.value = !coreContext.defaultAccountHasVideoConferenceFactoryUri coreContext.postOnCoreThread { core -> + moreThanOneAccount.postValue(core.accountList.size > 1) core.addListener(coreListener) configure() } diff --git a/app/src/main/res/layout-land/chat_list_fragment.xml b/app/src/main/res/layout-land/chat_list_fragment.xml index 164e0e38a..b804759a3 100644 --- a/app/src/main/res/layout-land/chat_list_fragment.xml +++ b/app/src/main/res/layout-land/chat_list_fragment.xml @@ -74,22 +74,45 @@ android:src="@drawable/illu" android:contentDescription="@null" app:layout_constraintHeight_max="200dp" - app:layout_constraintBottom_toTopOf="@id/no_conversation_label" app:layout_constraintDimensionRatio="1:1" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@id/bottom_nav_bar" - app:layout_constraintTop_toBottomOf="@id/background" /> + app:layout_constraintTop_toTopOf="@id/background" + app:layout_constraintBottom_toTopOf="@id/no_conversation_label" /> + app:layout_constraintTop_toBottomOf="@id/no_conversation_image" + app:layout_constraintBottom_toTopOf="@id/show_accounts_list"/> + + @@ -154,6 +155,7 @@ android:background="@drawable/secondary_button_background" android:visibility="@{viewModel.contactsList.empty && !viewModel.areAllContactsDisplayed ? View.VISIBLE : View.GONE}" app:layout_constraintTop_toBottomOf="@id/no_contacts_label" + app:layout_constraintBottom_toTopOf="@id/lists" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@id/bottom_nav_bar"/> diff --git a/app/src/main/res/layout-land/history_list_fragment.xml b/app/src/main/res/layout-land/history_list_fragment.xml index e279286d0..8ea1a46ef 100644 --- a/app/src/main/res/layout-land/history_list_fragment.xml +++ b/app/src/main/res/layout-land/history_list_fragment.xml @@ -88,18 +88,41 @@ app:layout_constraintDimensionRatio="1:1" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@id/bottom_nav_bar" - app:layout_constraintTop_toBottomOf="@id/background" /> + app:layout_constraintTop_toTopOf="@id/background" /> + app:layout_constraintTop_toBottomOf="@id/no_calls_image" + app:layout_constraintBottom_toTopOf="@id/show_accounts_list"/> + + + + + android:contentDescription="@null" /> + android:gravity="center" /> diff --git a/app/src/main/res/layout/history_list_fragment.xml b/app/src/main/res/layout/history_list_fragment.xml index 17f21ccaf..b331ac434 100644 --- a/app/src/main/res/layout/history_list_fragment.xml +++ b/app/src/main/res/layout/history_list_fragment.xml @@ -91,14 +91,36 @@ + + Aucun contact ni suggestion pour le moment… Nommer l\'appel de groupe Nom de l\'appel de groupe - Aucun appel dans votre historique… + Aucun appel vers/depuis ce compte n\'a été trouvé… + Changer de compte Conversation Supprimer l\'historique d\'appels ? @@ -431,7 +432,7 @@ Appareil sans nom - Aucune conversation pour le moment… + Aucune conversation liée à ce compte pour le moment… En cours de suppression… %s : diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 36962cc7c..cbb1b586b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -403,7 +403,8 @@ No suggestion and no contact for the moment… Set group call subject Group call subject - No call for the moment… + No call from/to this account was found… + Change account Conversation Do you really want to delete all calls history? @@ -472,7 +473,7 @@ Unnamed device - No conversation for the moment… + No conversation related to this account for the moment… Removal in progress… %s: