mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 18:56:44 -04:00
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.
This commit is contained in:
parent
61661a5aa0
commit
386a93699b
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user