From 9a1a0006ce7c593982a69f8a54452fbb8313c52c Mon Sep 17 00:00:00 2001 From: Alejandro Date: Fri, 29 Sep 2023 10:19:38 -0300 Subject: [PATCH 1/2] Fix payments endpoint --- .../feature_network_query_message/NetworkQueryMessageImpl.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx/application/network/features/queries/feature-network-query-message/src/main/java/chat/sphinx/feature_network_query_message/NetworkQueryMessageImpl.kt b/sphinx/application/network/features/queries/feature-network-query-message/src/main/java/chat/sphinx/feature_network_query_message/NetworkQueryMessageImpl.kt index 16fb963cf2..7d7c57ac97 100644 --- a/sphinx/application/network/features/queries/feature-network-query-message/src/main/java/chat/sphinx/feature_network_query_message/NetworkQueryMessageImpl.kt +++ b/sphinx/application/network/features/queries/feature-network-query-message/src/main/java/chat/sphinx/feature_network_query_message/NetworkQueryMessageImpl.kt @@ -36,7 +36,7 @@ class NetworkQueryMessageImpl( private const val ENDPOINT_MESSAGES_READ = "/messages/%d/read" private const val ENDPOINT_MESSAGES = "/messages" private const val ENDPOINT_PAYMENT = "/payment" - private const val ENDPOINT_PAYMENTS = "payments" + private const val ENDPOINT_PAYMENTS = "/payments" private const val ENDPOINT_PAY_ATTACHMENT = "/purchase" private const val ENDPOINT_INVOICES = "/invoices" } From 3cd52c64f29e1b2630265cfaef1eca9f77bfda92 Mon Sep 17 00:00:00 2001 From: Alejandro Date: Fri, 29 Sep 2023 17:58:54 -0300 Subject: [PATCH 2/2] Add progress bar for list of contacts on dashboard --- .../sphinx/dashboard/ui/ChatListFragment.kt | 19 +++++++++++++++++++ .../main/res/layout/fragment_chat_list.xml | 13 +++++++++++++ 2 files changed, 32 insertions(+) diff --git a/sphinx/screens/dashboard/dashboard/src/main/java/chat/sphinx/dashboard/ui/ChatListFragment.kt b/sphinx/screens/dashboard/dashboard/src/main/java/chat/sphinx/dashboard/ui/ChatListFragment.kt index 0da13c0f87..01b69e50f8 100644 --- a/sphinx/screens/dashboard/dashboard/src/main/java/chat/sphinx/dashboard/ui/ChatListFragment.kt +++ b/sphinx/screens/dashboard/dashboard/src/main/java/chat/sphinx/dashboard/ui/ChatListFragment.kt @@ -24,6 +24,7 @@ import chat.sphinx.dashboard.ui.adapter.DashboardFooterAdapter import chat.sphinx.dashboard.ui.viewstates.ChatFilter import chat.sphinx.dashboard.ui.viewstates.ChatListFooterButtonsViewState import chat.sphinx.dashboard.ui.viewstates.ChatListViewState +import chat.sphinx.dashboard.ui.viewstates.ChatViewState import chat.sphinx.resources.SphinxToastUtils import chat.sphinx.resources.inputMethodManager import chat.sphinx.wrapper_chat.ChatType @@ -32,6 +33,7 @@ import io.matthewnelson.android_feature_screens.navigation.CloseAppOnBackPress import io.matthewnelson.android_feature_screens.ui.sideeffect.SideEffectFragment import io.matthewnelson.android_feature_screens.util.gone import io.matthewnelson.android_feature_screens.util.goneIfFalse +import io.matthewnelson.android_feature_screens.util.visible import io.matthewnelson.concept_views.viewstate.collect import kotlinx.coroutines.launch import javax.inject.Inject @@ -217,4 +219,21 @@ internal class ChatListFragment : SideEffectFragment< } } } + + override fun subscribeToViewStateFlow() { + onStopSupervisor.scope.launch(viewModel.mainImmediate) { + viewModel.chatViewStateContainer.collect { viewState -> + when { + viewState.list.isEmpty() -> { + binding.progressBarChatList.visible + } + viewState.list.isNotEmpty() -> { + binding.progressBarChatList.gone + } + } + } + } + + super.subscribeToViewStateFlow() + } } diff --git a/sphinx/screens/dashboard/dashboard/src/main/res/layout/fragment_chat_list.xml b/sphinx/screens/dashboard/dashboard/src/main/res/layout/fragment_chat_list.xml index e40d60edf4..a94a4e78e6 100644 --- a/sphinx/screens/dashboard/dashboard/src/main/res/layout/fragment_chat_list.xml +++ b/sphinx/screens/dashboard/dashboard/src/main/res/layout/fragment_chat_list.xml @@ -23,4 +23,17 @@ app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintTop_toBottomOf="@+id/layout_search_bar" /> + +