[Android] Fix empty audio screen on initial load

Nicolas Pomepuy git at videolan.org
Thu Jul 15 11:23:53 UTC 2021


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Jul 13 09:25:01 2021 +0200| [3fd43d8470f1cc46312071e2155b67e2e1f29597] | committer: Nicolas Pomepuy

Fix empty audio screen on initial load

Fixes #2092

> https://code.videolan.org/videolan/vlc-android/commit/3fd43d8470f1cc46312071e2155b67e2e1f29597
---

 .../src/org/videolan/vlc/gui/audio/AudioBrowserFragment.kt          | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.kt
index 16aa6dc13..d21eec11f 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.kt
@@ -220,11 +220,6 @@ class AudioBrowserFragment : BaseAudioBrowser<AudioBrowserViewModel>() {
         })
     }
 
-    override fun onResume() {
-        swipeRefreshLayout.visibility = if (Medialibrary.getInstance().isInitiated) View.VISIBLE else View.GONE
-        super.onResume()
-    }
-
     override fun onStart() {
         super.onStart()
         setFabPlayShuffleAllVisibility()
@@ -291,6 +286,7 @@ class AudioBrowserFragment : BaseAudioBrowser<AudioBrowserViewModel>() {
     override fun enableSearchOption() = true
 
     private fun updateEmptyView() {
+        swipeRefreshLayout.visibility = if (Medialibrary.getInstance().isInitiated) View.VISIBLE else View.GONE
         empty_loading.state =
             if (!Permissions.canReadStorage(requireActivity())) EmptyLoadingState.MISSING_PERMISSION else if (viewModel.providers[currentTab].loading.value == true && empty) EmptyLoadingState.LOADING else if (empty) EmptyLoadingState.EMPTY else EmptyLoadingState.NONE
     }



More information about the Android mailing list