Skip to content

Commit

Permalink
Hiding the refresh layout when no internet connection is available.
Browse files Browse the repository at this point in the history
* Hiding the "No internet connection" text when user turn on the internet and previous this text is showing.
  • Loading branch information
MohitMaliDeveloper committed Sep 19, 2024
1 parent 61661a5 commit 386a936
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 386a936

Please sign in to comment.