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" } 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" /> + +