[Android] [PATCH 3/3] Use MediaComparators
Geoffrey Métais
geoffrey.metais at gmail.com
Mon Feb 16 17:12:11 CET 2015
---
vlc-android/src/org/videolan/vlc/gui/SearchResultAdapter.java | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/SearchResultAdapter.java b/vlc-android/src/org/videolan/vlc/gui/SearchResultAdapter.java
index ea7d7b3..cf177f1 100644
--- a/vlc-android/src/org/videolan/vlc/gui/SearchResultAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/SearchResultAdapter.java
@@ -23,6 +23,7 @@ package org.videolan.vlc.gui;
import java.util.Comparator;
import org.videolan.vlc.MediaWrapper;
+import org.videolan.vlc.gui.audio.MediaComparators;
import android.content.Context;
import android.view.LayoutInflater;
@@ -31,8 +32,7 @@ import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
-public class SearchResultAdapter extends ArrayAdapter<MediaWrapper>
- implements Comparator<MediaWrapper> {
+public class SearchResultAdapter extends ArrayAdapter<MediaWrapper> {
public SearchResultAdapter(Context context) {
super(context, 0);
@@ -57,13 +57,8 @@ public class SearchResultAdapter extends ArrayAdapter<MediaWrapper>
return view;
}
- @Override
- public int compare(MediaWrapper object1, MediaWrapper object2) {
- return object1.getTitle().compareToIgnoreCase(object2.getTitle());
- }
-
public void sort() {
- super.sort(this);
+ super.sort(MediaComparators.byName);
}
static class ViewHolder {
--
2.1.0
More information about the Android
mailing list