[Android] Fix videos 'loading' view visibility

Geoffrey Métais git at videolan.org
Fri Aug 3 14:56:08 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Aug  3 14:55:28 2018 +0200| [90a57f5c081ea456eb157474cbabf9af65eef291] | committer: Geoffrey Métais

Fix videos 'loading' view visibility

> https://code.videolan.org/videolan/vlc-android/commit/90a57f5c081ea456eb157474cbabf9af65eef291
---

 .../src/org/videolan/vlc/gui/video/VideoGridFragment.java      | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
index a80004afe..2da3e7f13 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -113,6 +113,16 @@ public class VideoGridFragment extends MediaBrowserFragment<VideosModel> impleme
         return mBinding.getRoot();
     }
 
+    @Override
+    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
+        super.onViewCreated(view, savedInstanceState);
+        restart = false;
+        final boolean empty = viewModel.getDataset().getValue().isEmpty();
+        mBinding.loadingFlipper.setVisibility(empty ? View.VISIBLE : View.GONE);
+        mBinding.loadingTitle.setVisibility(empty ? View.VISIBLE : View.GONE);
+        mBinding.setEmpty(empty);
+    }
+
     @Override
     public void onActivityCreated(@Nullable Bundle savedInstanceState) {
         super.onActivityCreated(savedInstanceState);



More information about the Android mailing list