[Android] Videos: disable permission view if not empty

Duncan McNamara git at videolan.org
Mon Feb 14 09:15:39 UTC 2022


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Thu Feb 10 18:34:17 2022 +0100| [577a1efb4a85ee546e262a410217ca069eb8a6b7] | committer: Duncan McNamara

Videos: disable permission view if not empty

> https://code.videolan.org/videolan/vlc-android/commit/577a1efb4a85ee546e262a410217ca069eb8a6b7
---

 .../vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
index 35345c42f..f5a9329c2 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
@@ -306,7 +306,7 @@ class VideoGridFragment : MediaBrowserFragment<VideosViewModel>(), SwipeRefreshL
         val empty = viewModel.isEmpty() && videoListAdapter.currentList.isNullOrEmpty()
         val working = viewModel.provider.loading.value != false
         binding.emptyLoading.state = when {
-            !Permissions.canReadStorage(AppContextProvider.appContext) -> EmptyLoadingState.MISSING_PERMISSION
+            !Permissions.canReadStorage(AppContextProvider.appContext) && empty -> EmptyLoadingState.MISSING_PERMISSION
             empty && working -> EmptyLoadingState.LOADING
             empty && !working -> EmptyLoadingState.EMPTY
             else -> EmptyLoadingState.NONE



More information about the Android mailing list