[Android] Add filter feature to History

Geoffrey Métais git at videolan.org
Wed Apr 4 18:34:52 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Mar  2 15:52:25 2018 +0100| [54a51a93dce888962206c4610aee21cf13d56fb3] | committer: Geoffrey Métais

Add filter feature to History

> https://code.videolan.org/videolan/vlc-android/commit/54a51a93dce888962206c4610aee21cf13d56fb3
---

 .../src/org/videolan/vlc/gui/HistoryFragment.java   | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java b/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
index 4c196ac3a..bf234adc4 100644
--- a/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
@@ -40,6 +40,7 @@ import org.videolan.medialibrary.media.MediaWrapper;
 import org.videolan.vlc.R;
 import org.videolan.vlc.gui.browser.MediaBrowserFragment;
 import org.videolan.vlc.gui.view.SwipeRefreshLayout;
+import org.videolan.vlc.interfaces.Filterable;
 import org.videolan.vlc.interfaces.IEventsHandler;
 import org.videolan.vlc.interfaces.IHistory;
 import org.videolan.vlc.interfaces.IRefreshable;
@@ -48,7 +49,7 @@ import org.videolan.vlc.viewmodels.HistoryProvider;
 
 import java.util.List;
 
-public class HistoryFragment extends MediaBrowserFragment implements IRefreshable, IHistory, SwipeRefreshLayout.OnRefreshListener, IEventsHandler {
+public class HistoryFragment extends MediaBrowserFragment implements IRefreshable, IHistory, SwipeRefreshLayout.OnRefreshListener, IEventsHandler, Filterable {
 
     public final static String TAG = "VLC/HistoryFragment";
 
@@ -243,4 +244,22 @@ public class HistoryFragment extends MediaBrowserFragment implements IRefreshabl
     public void onUpdateFinished(RecyclerView.Adapter adapter) {
         invalidateActionMode();
     }
+
+    @Override
+    public boolean enableSearchOption() {
+        return true;
+    }
+
+    @Override
+    public void filter(String query) {
+        provider.filter(query);
+    }
+
+    @Override
+    public void restoreList() {
+        provider.filter(null);
+    }
+
+    @Override
+    public void setSearchVisibility(boolean visible) {}
 }



More information about the Android mailing list