From 386a93699b0188bc5793a212f5e3437e2dd8c501 Mon Sep 17 00:00:00 2001 From: MohitMaliFtechiz Date: Thu, 19 Sep 2024 11:11:58 +0530 Subject: [PATCH] Hiding the refresh layout when no internet connection is available. * Hiding the "No internet connection" text when user turn on the internet and previous this text is showing. --- .../nav/destination/library/OnlineLibraryFragment.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/OnlineLibraryFragment.kt b/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/OnlineLibraryFragment.kt index 9d2bca91f..9957ea7e7 100644 --- a/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/OnlineLibraryFragment.kt +++ b/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/OnlineLibraryFragment.kt @@ -286,6 +286,7 @@ class OnlineLibraryFragment : BaseFragment(), FragmentActivityExtensions { private fun showProgressBarOfFetchingOnlineLibrary() { onRefreshStateChange(false) fragmentDestinationDownloadBinding?.apply { + libraryErrorText.visibility = View.GONE librarySwipeRefresh.isEnabled = false onlineLibraryProgressLayout.visibility = View.VISIBLE onlineLibraryProgressStatusText.setText(string.reaching_remote_library) @@ -324,7 +325,9 @@ class OnlineLibraryFragment : BaseFragment(), FragmentActivityExtensions { private fun onRefreshStateChange(isRefreshing: Boolean?) { var refreshing = isRefreshing == true // do not show the refreshing when the online library is downloading - if (fragmentDestinationDownloadBinding?.onlineLibraryProgressLayout?.isVisible == true) { + if (fragmentDestinationDownloadBinding?.onlineLibraryProgressLayout?.isVisible == true || + fragmentDestinationDownloadBinding?.libraryErrorText?.isVisible == true + ) { refreshing = false } fragmentDestinationDownloadBinding?.librarySwipeRefresh?.isRefreshing = refreshing