[Android] Video fragment: Avoid useless refresh

Geoffrey Métais git at videolan.org
Mon Feb 19 09:52:55 CET 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Feb 19 09:48:33 2018 +0100| [4ef3217793ea38d96b465028bc512c1660a76193] | committer: Geoffrey Métais

Video fragment: Avoid useless refresh

> https://code.videolan.org/videolan/vlc-android/commit/4ef3217793ea38d96b465028bc512c1660a76193
---

 vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java | 5 ++---
 1 file changed, 2 insertions(+), 3 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 ae6a077be..4da309119 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -402,7 +402,7 @@ public class VideoGridFragment extends SortableFragment<VideoListAdapter> implem
     protected void onParsingServiceFinished() {
         mMediaLibrary.removeMediaUpdatedCb();
         mMediaLibrary.removeMediaAddedCb();
-        mHandler.sendEmptyMessage(UPDATE_LIST);
+        if (!isHidden()) mHandler.sendEmptyMessage(UPDATE_LIST);
     }
 
     @Override
@@ -417,8 +417,7 @@ public class VideoGridFragment extends SortableFragment<VideoListAdapter> implem
 
     @Override
     public void restoreList() {
-        if (mAdapter != null && mGridView != null)
-            mAdapter.restoreList();
+        if (mAdapter != null && mGridView != null) mAdapter.restoreList();
     }
 
     @Override



More information about the Android mailing list