[Android] Execute update on hidden state change
Geoffrey Métais
git at videolan.org
Wed Feb 14 17:36:21 CET 2018
vlc-android | branch: 3.0.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Feb 12 14:59:11 2018 +0100| [7bb86946cefe1e1614b25cf8055527e00ecd2bfc] | committer: Geoffrey Métais
Execute update on hidden state change
(cherry picked from commit 1e59c419a0a98b609223060cb29b49db2b2b0188)
> https://code.videolan.org/videolan/vlc-android/commit/7bb86946cefe1e1614b25cf8055527e00ecd2bfc
---
.../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