[Android] Clear method in Browser fragments

Geoffrey Métais git at videolan.org
Thu Mar 19 12:02:38 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Mar 19 11:57:52 2015 +0100| [bf6248f8ead255258c9ba390ba0a65d47c10defb] | committer: Geoffrey Métais

Clear method in Browser fragments

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

 vlc-android/src/org/videolan/vlc/gui/BrowserFragment.java       |    1 +
 vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java       |    2 ++
 .../org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java    |    5 +++++
 .../src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java    |    7 +++++++
 .../src/org/videolan/vlc/gui/network/NetworkFragment.java       |    4 ++++
 .../src/org/videolan/vlc/gui/video/VideoGridFragment.java       |    4 ++++
 6 files changed, 23 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/BrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/BrowserFragment.java
index f57913d..e11394f 100644
--- a/vlc-android/src/org/videolan/vlc/gui/BrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/BrowserFragment.java
@@ -35,6 +35,7 @@ public abstract class BrowserFragment extends Fragment {
     protected void display(){}
 
     protected abstract String getTitle();
+    public abstract void clear();
     public void onStart(){
         super.onStart();
         ((ActionBarActivity) getActivity()).getSupportActionBar().setTitle(getTitle());
diff --git a/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java b/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
index e4b74ee..1b6be37 100644
--- a/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
@@ -181,4 +181,6 @@ public class HistoryFragment extends BrowserFragment implements IRefreshable, Sw
     protected String getTitle() {
         return getString(R.string.history);
     }
+
+    public 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 1e8cc07..02f2a99 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
@@ -379,4 +379,9 @@ public class AudioAlbumsSongsFragment extends BrowserFragment implements SwipeRe
             return false;
         }
     };
+
+    public void clear(){
+        mAlbumsAdapter.clear();
+        mSongsAdapter.clear();
+    }
 }
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
index f25e4e9..5af0c0f 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
@@ -662,4 +662,11 @@ public class AudioBrowserFragment extends BrowserFragment implements SwipeRefres
             return false;
         }
     };
+
+    public void clear(){
+        mGenresAdapter.clear();
+        mArtistsAdapter.clear();
+        mAlbumsAdapter.clear();
+        mSongsAdapter.clear();
+    }
 }
diff --git a/vlc-android/src/org/videolan/vlc/gui/network/NetworkFragment.java b/vlc-android/src/org/videolan/vlc/gui/network/NetworkFragment.java
index 3f9cd16..387fb23 100644
--- a/vlc-android/src/org/videolan/vlc/gui/network/NetworkFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/network/NetworkFragment.java
@@ -333,4 +333,8 @@ public class NetworkFragment extends BrowserFragment implements IRefreshable, Me
         main.setMenuFocusDown(idIsEmpty, R.id.network_list);
         main.setSearchAsFocusDown(idIsEmpty, parent, R.id.network_list);
     }
+
+    public void clear(){
+        mAdapter.clear();
+    }
 }
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 b089f7a..654bf7a 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -556,4 +556,8 @@ public class VideoGridFragment extends BrowserFragment implements ISortable, IVi
                 }
             });
     }
+
+    public void clear(){
+        mVideoAdapter.clear();
+    }
 }



More information about the Android mailing list