From c40c15b66f2157fa40c94e55a0c0f840d947b16e Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Thu, 22 Aug 2024 11:03:04 +0200 Subject: [PATCH] Added undertermined progress bar while fetching devices list in account profile --- .../settings/viewmodel/AccountProfileViewModel.kt | 5 +++++ .../main/res/layout/account_profile_fragment.xml | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/app/src/main/java/org/linphone/ui/main/settings/viewmodel/AccountProfileViewModel.kt b/app/src/main/java/org/linphone/ui/main/settings/viewmodel/AccountProfileViewModel.kt index 8bf428ad5..1479a02d2 100644 --- a/app/src/main/java/org/linphone/ui/main/settings/viewmodel/AccountProfileViewModel.kt +++ b/app/src/main/java/org/linphone/ui/main/settings/viewmodel/AccountProfileViewModel.kt @@ -72,6 +72,8 @@ class AccountProfileViewModel @UiThread constructor() : GenericViewModel() { val devicesAvailable = MutableLiveData() + val devicesFetchInProgress = MutableLiveData() + val hideAccountSettings = MutableLiveData() val deviceId = MutableLiveData() @@ -117,6 +119,7 @@ class AccountProfileViewModel @UiThread constructor() : GenericViewModel() { ) } devices.postValue(devicesList) + devicesFetchInProgress.postValue(false) } @WorkerThread @@ -140,6 +143,7 @@ class AccountProfileViewModel @UiThread constructor() : GenericViewModel() { ) ) ) + devicesFetchInProgress.postValue(false) } else -> {} } @@ -151,6 +155,7 @@ class AccountProfileViewModel @UiThread constructor() : GenericViewModel() { expandDetails.value = true expandDevices.value = false showDeviceId.value = false + devicesFetchInProgress.value = true coreContext.postOnCoreThread { hideAccountSettings.postValue(corePreferences.hideAccountSettings) diff --git a/app/src/main/res/layout/account_profile_fragment.xml b/app/src/main/res/layout/account_profile_fragment.xml index 1353d4c65..2da6dae9c 100644 --- a/app/src/main/res/layout/account_profile_fragment.xml +++ b/app/src/main/res/layout/account_profile_fragment.xml @@ -457,6 +457,20 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toBottomOf="@id/devices" /> + +