2 * Copyright (C) 2012 Andrew Neal Licensed under the Apache License, Version 2.0
3 * (the "License"); you may not use this file except in compliance with the
4 * License. You may obtain a copy of the License at
5 * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
6 * or agreed to in writing, software distributed under the License is
7 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8 * KIND, either express or implied. See the License for the specific language
9 * governing permissions and limitations under the License.
12 package com.andrew.apollo.utils;
14 import android.provider.MediaStore;
17 * Holds all of the sort orders for each list type.
19 * @author Andrew Neal (andrewdneal@gmail.com)
21 public final class SortOrder {
23 /** This class is never instantiated */
28 * Artist sort order entries.
30 public static interface ArtistSortOrder {
31 /* Artist sort order A-Z */
32 public final static String ARTIST_A_Z = MediaStore.Audio.Artists.DEFAULT_SORT_ORDER;
34 /* Artist sort order Z-A */
35 public final static String ARTIST_Z_A = ARTIST_A_Z + " DESC";
37 /* Artist sort order number of songs */
38 public final static String ARTIST_NUMBER_OF_SONGS = MediaStore.Audio.Artists.NUMBER_OF_TRACKS
41 /* Artist sort order number of albums */
42 public final static String ARTIST_NUMBER_OF_ALBUMS = MediaStore.Audio.Artists.NUMBER_OF_ALBUMS
47 * Album sort order entries.
49 public static interface AlbumSortOrder {
50 /* Album sort order A-Z */
51 public final static String ALBUM_A_Z = MediaStore.Audio.Albums.DEFAULT_SORT_ORDER;
53 /* Album sort order Z-A */
54 public final static String ALBUM_Z_A = ALBUM_A_Z + " DESC";
56 /* Album sort order songs */
57 public final static String ALBUM_NUMBER_OF_SONGS = MediaStore.Audio.Albums.NUMBER_OF_SONGS
60 /* Album sort order artist */
61 public final static String ALBUM_ARTIST = MediaStore.Audio.Albums.ARTIST;
63 /* Album sort order year */
64 public final static String ALBUM_YEAR = MediaStore.Audio.Albums.FIRST_YEAR + " DESC";
69 * Song sort order entries.
71 public static interface SongSortOrder {
72 /* Song sort order A-Z */
73 public final static String SONG_A_Z = MediaStore.Audio.Media.DEFAULT_SORT_ORDER;
75 /* Song sort order Z-A */
76 public final static String SONG_Z_A = SONG_A_Z + " DESC";
78 /* Song sort order artist */
79 public final static String SONG_ARTIST = MediaStore.Audio.Media.ARTIST;
81 /* Song sort order album */
82 public final static String SONG_ALBUM = MediaStore.Audio.Media.ALBUM;
84 /* Song sort order year */
85 public final static String SONG_YEAR = MediaStore.Audio.Media.YEAR + " DESC";
87 /* Song sort order duration */
88 public final static String SONG_DURATION = MediaStore.Audio.Media.DURATION + " DESC";
90 /* Song sort order date */
91 public final static String SONG_DATE = MediaStore.Audio.Media.DATE_ADDED + " DESC";
93 /* Song sort order filename */
94 public final static String SONG_FILENAME = MediaStore.Audio.Media.DATA;
98 * Album song sort order entries.
100 public static interface AlbumSongSortOrder {
101 /* Album song sort order A-Z */
102 public final static String SONG_A_Z = MediaStore.Audio.Media.DEFAULT_SORT_ORDER;
104 /* Album song sort order Z-A */
105 public final static String SONG_Z_A = SONG_A_Z + " DESC";
107 /* Album song sort order track list */
108 public final static String SONG_TRACK_LIST = MediaStore.Audio.Media.TRACK + ", "
109 + MediaStore.Audio.Media.DEFAULT_SORT_ORDER;
111 /* Album song sort order duration */
112 public final static String SONG_DURATION = SongSortOrder.SONG_DURATION;
114 /* Album song sort order filename */
115 public final static String SONG_FILENAME = SongSortOrder.SONG_FILENAME;
119 * Artist song sort order entries.
121 public static interface ArtistSongSortOrder {
122 /* Artist song sort order A-Z */
123 public final static String SONG_A_Z = MediaStore.Audio.Media.DEFAULT_SORT_ORDER;
125 /* Artist song sort order Z-A */
126 public final static String SONG_Z_A = SONG_A_Z + " DESC";
128 /* Artist song sort order album */
129 public final static String SONG_ALBUM = MediaStore.Audio.Media.ALBUM;
131 /* Artist song sort order year */
132 public final static String SONG_YEAR = MediaStore.Audio.Media.YEAR + " DESC";
134 /* Artist song sort order duration */
135 public final static String SONG_DURATION = MediaStore.Audio.Media.DURATION + " DESC";
137 /* Artist song sort order date */
138 public final static String SONG_DATE = MediaStore.Audio.Media.DATE_ADDED + " DESC";
140 /* Artist song sort order filename */
141 public final static String SONG_FILENAME = SongSortOrder.SONG_FILENAME;
145 * Artist album sort order entries.
147 public static interface ArtistAlbumSortOrder {
148 /* Artist album sort order A-Z */
149 public final static String ALBUM_A_Z = MediaStore.Audio.Albums.DEFAULT_SORT_ORDER;
151 /* Artist album sort order Z-A */
152 public final static String ALBUM_Z_A = ALBUM_A_Z + " DESC";
154 /* Artist album sort order songs */
155 public final static String ALBUM_NUMBER_OF_SONGS = MediaStore.Audio.Artists.Albums.NUMBER_OF_SONGS
158 /* Artist album sort order year */
159 public final static String ALBUM_YEAR = MediaStore.Audio.Artists.Albums.FIRST_YEAR