[Android] Make display async process mandatory to implement

Geoffrey Métais git at videolan.org
Mon Apr 20 15:00:46 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Apr 20 13:21:09 2015 +0200| [23c2150bd768eb3f1dff3c194c8f3e4fcb0ab284] | committer: Geoffrey Métais

Make display async process mandatory to implement

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=23c2150bd768eb3f1dff3c194c8f3e4fcb0ab284
---

 .../src/org/videolan/vlc/gui/MediaBrowserFragment.java       |   10 ++++++++--
 .../org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java |    3 +++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/MediaBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/MediaBrowserFragment.java
index 66190ff..518277d 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MediaBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MediaBrowserFragment.java
@@ -32,8 +32,14 @@ public abstract class MediaBrowserFragment extends Fragment {
     protected SwipeRefreshLayout mSwipeRefreshLayout;
     protected volatile boolean mReadyToDisplay = true;
 
-    protected void setReadyToDisplay(boolean ready){}
-    protected void display(){}
+    public void setReadyToDisplay(boolean ready) {
+        if (ready && !mReadyToDisplay)
+            display();
+        else
+            mReadyToDisplay = ready;
+    }
+
+    protected abstract void display();
 
     protected abstract String getTitle();
     public abstract void clear();
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
index 9149e0e..c45f0f9 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
@@ -170,6 +170,9 @@ public class AudioAlbumsSongsFragment extends MediaBrowserFragment implements Sw
     }
 
     @Override
+    protected void display() {}
+
+    @Override
     protected String getTitle() {
         return mTitle;
     }



More information about the Android mailing list