[Android] Execute update on hidden state change

Geoffrey Métais git at videolan.org
Mon Feb 12 15:02:03 CET 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Feb 12 14:59:11 2018 +0100| [1e59c419a0a98b609223060cb29b49db2b2b0188] | committer: Geoffrey Métais

Execute update on hidden state change

> https://code.videolan.org/videolan/vlc-android/commit/1e59c419a0a98b609223060cb29b49db2b2b0188
---

 .../src/org/videolan/vlc/gui/video/VideoGridFragment.java  | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

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 59e3ad66b..ae6a077be 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -147,19 +147,7 @@ public class VideoGridFragment extends SortableFragment<VideoListAdapter> implem
         mGridView.setAdapter(mAdapter);
     }
 
-    @Override
-    public void onResume() {
-        super.onResume();
-        if (restart && !mMediaLibrary.isWorking()) updateList();
-    }
-
     private boolean restart = false;
-    @Override
-    public void onPause() {
-        super.onPause();
-        restart = true;
-    }
-
     @Override
     public void onHiddenChanged(boolean hidden) {
         super.onHiddenChanged(hidden);
@@ -173,10 +161,12 @@ public class VideoGridFragment extends SortableFragment<VideoListAdapter> implem
             updateViewMode();
             mFabPlay.setImageResource(R.drawable.ic_fab_play);
             setFabPlayVisibility(true);
+            if (restart && !mMediaLibrary.isWorking()) updateList();
         } else {
             mMediaLibrary.removeMediaUpdatedCb();
             mMediaLibrary.removeMediaAddedCb();
             unregisterForContextMenu(mGridView);
+            restart = true;
         }
     }
 



More information about the Android mailing list