Add new sorting option

This commit is contained in:
Adrian Ulrich 2013-06-13 10:29:48 +02:00
parent 141aef2e27
commit fb98966b9f
2 changed files with 8 additions and 6 deletions

View File

@ -23,8 +23,8 @@ THE SOFTWARE.
--> -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ch.blinkenlights.android.vanilla" package="ch.blinkenlights.android.vanilla"
android:versionName="0.9.20" android:versionName="0.9.21"
android:versionCode="0920" android:versionCode="0921"
android:installLocation="auto"> android:installLocation="auto">
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="16" /> <uses-sdk android:minSdkVersion="15" android:targetSdkVersion="16" />
<uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="android.permission.WAKE_LOCK" />

View File

@ -174,15 +174,17 @@ public class MediaAdapter
// Why is there no artist_key column constant in the album MediaStore? The column does seem to exist. // Why is there no artist_key column constant in the album MediaStore? The column does seem to exist.
mFieldKeys = new String[] { "artist_key", MediaStore.Audio.Albums.ALBUM_KEY }; mFieldKeys = new String[] { "artist_key", MediaStore.Audio.Albums.ALBUM_KEY };
mSongSort = "album_key,track"; mSongSort = "album_key,track";
mSortEntries = new int[] { R.string.name, R.string.artist_album, R.string.year, R.string.number_of_tracks }; mSortEntries = new int[] { R.string.name, R.string.artist_album, R.string.year, R.string.number_of_tracks, R.string.date_added };
mSortValues = new String[] { "album_key %1$s", "artist_key %1$s,album_key %1$s", "minyear %1$s,album_key %1$s", "numsongs %1$s,album_key %1$s" }; mSortValues = new String[] { "album_key %1$s", "artist_key %1$s,album_key %1$s", "minyear %1$s,album_key %1$s", "numsongs %1$s,album_key %1$s", "_id %1$s" };
break; break;
case MediaUtils.TYPE_SONG: case MediaUtils.TYPE_SONG:
mStore = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI; mStore = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
mFields = new String[] { MediaStore.Audio.Media.ARTIST, MediaStore.Audio.Media.ALBUM, MediaStore.Audio.Media.TITLE }; mFields = new String[] { MediaStore.Audio.Media.ARTIST, MediaStore.Audio.Media.ALBUM, MediaStore.Audio.Media.TITLE };
mFieldKeys = new String[] { MediaStore.Audio.Media.ARTIST_KEY, MediaStore.Audio.Media.ALBUM_KEY, MediaStore.Audio.Media.TITLE_KEY }; mFieldKeys = new String[] { MediaStore.Audio.Media.ARTIST_KEY, MediaStore.Audio.Media.ALBUM_KEY, MediaStore.Audio.Media.TITLE_KEY };
mSortEntries = new int[] { R.string.name, R.string.artist_album_track, R.string.artist_album_title, R.string.artist_year, R.string.year }; mSortEntries = new int[] { R.string.name, R.string.artist_album_track, R.string.artist_album_title,
mSortValues = new String[] { "title_key %1$s", "artist_key %1$s,album_key %1$s,track %1$s", "artist_key %1$s,album_key %1$s,title_key %1$s", "artist_key %1$s,year %1$s,track %1$s", "year %1$s,title_key %1$s" }; R.string.artist_year, R.string.year, R.string.date_added };
mSortValues = new String[] { "title_key %1$s", "artist_key %1$s,album_key %1$s,track %1$s", "artist_key %1$s,album_key %1$s,title_key %1$s",
"artist_key %1$s,year %1$s,track %1$s", "year %1$s,title_key %1$s", "_id %1$s" };
break; break;
case MediaUtils.TYPE_PLAYLIST: case MediaUtils.TYPE_PLAYLIST:
mStore = MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI; mStore = MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI;