mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-08 06:42:21 -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() {
|
private fun showProgressBarOfFetchingOnlineLibrary() {
|
||||||
onRefreshStateChange(false)
|
onRefreshStateChange(false)
|
||||||
fragmentDestinationDownloadBinding?.apply {
|
fragmentDestinationDownloadBinding?.apply {
|
||||||
|
libraryErrorText.visibility = View.GONE
|
||||||
librarySwipeRefresh.isEnabled = false
|
librarySwipeRefresh.isEnabled = false
|
||||||
onlineLibraryProgressLayout.visibility = View.VISIBLE
|
onlineLibraryProgressLayout.visibility = View.VISIBLE
|
||||||
onlineLibraryProgressStatusText.setText(string.reaching_remote_library)
|
onlineLibraryProgressStatusText.setText(string.reaching_remote_library)
|
||||||
@ -324,7 +325,9 @@ class OnlineLibraryFragment : BaseFragment(), FragmentActivityExtensions {
|
|||||||
private fun onRefreshStateChange(isRefreshing: Boolean?) {
|
private fun onRefreshStateChange(isRefreshing: Boolean?) {
|
||||||
var refreshing = isRefreshing == true
|
var refreshing = isRefreshing == true
|
||||||
// do not show the refreshing when the online library is downloading
|
// 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
|
refreshing = false
|
||||||
}
|
}
|
||||||
fragmentDestinationDownloadBinding?.librarySwipeRefresh?.isRefreshing = refreshing
|
fragmentDestinationDownloadBinding?.librarySwipeRefresh?.isRefreshing = refreshing
|
||||||
|
Loading…
x
Reference in New Issue
Block a user