2 * Copyright (C) 2012 Andrew Neal
3 * Copyright (C) 2014 The CyanogenMod Project
4 * Licensed under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with the
6 * License. You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
8 * or agreed to in writing, software distributed under the License is
9 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
10 * KIND, either express or implied. See the License for the specific language
11 * governing permissions and limitations under the License.
14 package com.cyanogenmod.eleven.utils;
16 import android.provider.MediaStore;
19 * Holds all of the sort orders for each list type.
21 * @author Andrew Neal (andrewdneal@gmail.com)
23 public final class SortOrder {
25 /** This class is never instantiated */
30 * Artist sort order entries.
32 public static interface ArtistSortOrder {
33 /* Artist sort order A-Z */
34 public final static String ARTIST_A_Z = MediaStore.Audio.Artists.DEFAULT_SORT_ORDER;
36 /* Artist sort order Z-A */
37 public final static String ARTIST_Z_A = ARTIST_A_Z + " DESC";
39 /* Artist sort order number of songs */
40 public final static String ARTIST_NUMBER_OF_SONGS = MediaStore.Audio.Artists.NUMBER_OF_TRACKS
43 /* Artist sort order number of albums */
44 public final static String ARTIST_NUMBER_OF_ALBUMS = MediaStore.Audio.Artists.NUMBER_OF_ALBUMS
49 * Album sort order entries.
51 public static interface AlbumSortOrder {
52 /* Album sort order A-Z */
53 public final static String ALBUM_A_Z = MediaStore.Audio.Albums.DEFAULT_SORT_ORDER;
55 /* Album sort order Z-A */
56 public final static String ALBUM_Z_A = ALBUM_A_Z + " DESC";
58 /* Album sort order songs */
59 public final static String ALBUM_NUMBER_OF_SONGS = MediaStore.Audio.Albums.NUMBER_OF_SONGS
62 /* Album sort order artist */
63 public final static String ALBUM_ARTIST = MediaStore.Audio.Albums.ARTIST;
65 /* Album sort order year */
66 public final static String ALBUM_YEAR = MediaStore.Audio.Albums.FIRST_YEAR + " DESC";
71 * Song sort order entries.
73 public static interface SongSortOrder {
74 /* Song sort order A-Z */
75 public final static String SONG_A_Z = MediaStore.Audio.Media.DEFAULT_SORT_ORDER;
77 /* Song sort order Z-A */
78 public final static String SONG_Z_A = SONG_A_Z + " DESC";
80 /* Song sort order artist */
81 public final static String SONG_ARTIST = MediaStore.Audio.Media.ARTIST;
83 /* Song sort order album */
84 public final static String SONG_ALBUM = MediaStore.Audio.Media.ALBUM;
86 /* Song sort order year */
87 public final static String SONG_YEAR = MediaStore.Audio.Media.YEAR + " DESC";
89 /* Song sort order duration */
90 public final static String SONG_DURATION = MediaStore.Audio.Media.DURATION + " DESC";
92 /* Song sort order date */
93 public final static String SONG_DATE = MediaStore.Audio.Media.DATE_ADDED + " DESC";
95 /* Song sort order filename */
96 public final static String SONG_FILENAME = MediaStore.Audio.Media.DATA;
100 * Album song sort order entries.
102 public static interface AlbumSongSortOrder {
103 /* Album song sort order A-Z */
104 public final static String SONG_A_Z = MediaStore.Audio.Media.DEFAULT_SORT_ORDER;
106 /* Album song sort order Z-A */
107 public final static String SONG_Z_A = SONG_A_Z + " DESC";
109 /* Album song sort order track list */
110 public final static String SONG_TRACK_LIST = MediaStore.Audio.Media.TRACK + ", "
111 + MediaStore.Audio.Media.DEFAULT_SORT_ORDER;
113 /* Album song sort order duration */
114 public final static String SONG_DURATION = SongSortOrder.SONG_DURATION;
116 /* Album song sort order filename */
117 public final static String SONG_FILENAME = SongSortOrder.SONG_FILENAME;
121 * Artist song sort order entries.
123 public static interface ArtistSongSortOrder {
124 /* Artist song sort order A-Z */
125 public final static String SONG_A_Z = MediaStore.Audio.Media.DEFAULT_SORT_ORDER;
127 /* Artist song sort order Z-A */
128 public final static String SONG_Z_A = SONG_A_Z + " DESC";
130 /* Artist song sort order album */
131 public final static String SONG_ALBUM = MediaStore.Audio.Media.ALBUM;
133 /* Artist song sort order year */
134 public final static String SONG_YEAR = MediaStore.Audio.Media.YEAR + " DESC";
136 /* Artist song sort order duration */
137 public final static String SONG_DURATION = MediaStore.Audio.Media.DURATION + " DESC";
139 /* Artist song sort order date */
140 public final static String SONG_DATE = MediaStore.Audio.Media.DATE_ADDED + " DESC";
142 /* Artist song sort order filename */
143 public final static String SONG_FILENAME = SongSortOrder.SONG_FILENAME;
147 * Artist album sort order entries.
149 public static interface ArtistAlbumSortOrder {
150 /* Artist album sort order A-Z */
151 public final static String ALBUM_A_Z = MediaStore.Audio.Albums.DEFAULT_SORT_ORDER;
153 /* Artist album sort order Z-A */
154 public final static String ALBUM_Z_A = ALBUM_A_Z + " DESC";
156 /* Artist album sort order songs */
157 public final static String ALBUM_NUMBER_OF_SONGS = MediaStore.Audio.Artists.Albums.NUMBER_OF_SONGS
160 /* Artist album sort order year */
161 public final static String ALBUM_YEAR = MediaStore.Audio.Artists.Albums.FIRST_YEAR