[Android] don't sort by album tracks by name, keep files order

Sébastien Toque git at videolan.org
Sat Nov 10 15:43:42 CET 2012


vlc-ports/android | branch: master | Sébastien Toque <xilasz at gmail.com> | Sat Nov 10 15:43:30 2012 +0100| [aa7c5419cf9692155b324f147c6283ce31100eb4] | committer: Sébastien Toque

don't sort by album tracks by name, keep files order

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

 .../src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java  |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

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 df564cc..ca246b6 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
@@ -397,6 +397,13 @@ public class AudioBrowserFragment extends SherlockFragment implements ISortable
         };
     };
 
+    private final Comparator<Media> byMRL = new Comparator<Media>() {
+        @Override
+        public int compare(Media m1, Media m2) {
+            return String.CASE_INSENSITIVE_ORDER.compare(m1.getLocation(), m2.getLocation());
+        };
+    };
+
     private final Comparator<Media> byLength = new Comparator<Media>() {
         @Override
         public int compare(Media m1, Media m2) {
@@ -411,7 +418,7 @@ public class AudioBrowserFragment extends SherlockFragment implements ISortable
         public int compare(Media m1, Media m2) {
             int res = String.CASE_INSENSITIVE_ORDER.compare(m1.getAlbum(), m2.getAlbum());
             if (res == 0)
-                res = byName.compare(m1, m2);
+                res = byMRL.compare(m1, m2);
             return res;
         };
     };



More information about the Android mailing list