[Android] Use MediaComparators
Geoffrey Métais
git at videolan.org
Tue Feb 17 10:55:31 CET 2015
vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Feb 16 16:49:18 2015 +0100| [e8e26ed1d23331b3a8d90d84f49af855fed19b90] | committer: Geoffrey Métais
Use MediaComparators
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=e8e26ed1d23331b3a8d90d84f49af855fed19b90
---
.../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 {
More information about the Android
mailing list