Lots of progress with dynamic theming, the nav drawer now uses a RecyclerView, AboutDeveloperDialogHelper is now a DialogFragment, RTL support (to suppress Lint warnings), other various small fixes, cleaned up and formatted lot of code (and removed un-used resources), R.string.ok > android.R.string.ok, R.string.cancel > android.R.string.cancel, switched dialog helpers to DialogFragments.
This commit is contained in:
parent
c1b258dadd
commit
7ce86afd74
265 changed files with 2853 additions and 2292 deletions
|
|
@ -12,7 +12,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by karim on 29.12.14.
|
||||
* @author Karim Abou Zeid (kabouzeid)
|
||||
*/
|
||||
public class AlbumLoader {
|
||||
|
||||
|
|
@ -39,11 +39,11 @@ public class AlbumLoader {
|
|||
return albums;
|
||||
}
|
||||
|
||||
public static final Cursor makeAlbumCursor(final Context context) {
|
||||
public static Cursor makeAlbumCursor(final Context context) {
|
||||
return makeAlbumCursor(context, null, null);
|
||||
}
|
||||
|
||||
public static final Cursor makeAlbumCursor(final Context context, final String selection, final String[] values) {
|
||||
public static Cursor makeAlbumCursor(final Context context, final String selection, final String[] values) {
|
||||
return context.getContentResolver().query(MediaStore.Audio.Albums.EXTERNAL_CONTENT_URI,
|
||||
new String[]{
|
||||
/* 0 */
|
||||
|
|
|
|||
|
|
@ -11,22 +11,21 @@ import com.kabouzeid.gramophone.util.PreferenceUtils;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by karim on 29.12.14.
|
||||
* @author Karim Abou Zeid (kabouzeid)
|
||||
*/
|
||||
public class AlbumSongLoader {
|
||||
|
||||
public static List<Song> getAlbumSongList(final Context context, final int albumId, Comparator<Song> comparator) {
|
||||
List<Song> songs = getAlbumSongList(context, albumId);
|
||||
public static ArrayList<Song> getAlbumSongList(final Context context, final int albumId, Comparator<Song> comparator) {
|
||||
ArrayList<Song> songs = getAlbumSongList(context, albumId);
|
||||
Collections.sort(songs, comparator);
|
||||
return songs;
|
||||
}
|
||||
|
||||
public static List<Song> getAlbumSongList(final Context context, final int albumId) {
|
||||
public static ArrayList<Song> getAlbumSongList(final Context context, final int albumId) {
|
||||
Cursor cursor = makeAlbumSongCursor(context, albumId);
|
||||
List<Song> songs = new ArrayList<>();
|
||||
ArrayList<Song> songs = new ArrayList<>();
|
||||
if (cursor != null && cursor.moveToFirst()) {
|
||||
do {
|
||||
final int id = cursor.getInt(0);
|
||||
|
|
@ -48,11 +47,7 @@ public class AlbumSongLoader {
|
|||
return songs;
|
||||
}
|
||||
|
||||
public static final Cursor makeAlbumSongCursor(final Context context, final int albumId) {
|
||||
final StringBuilder selection = new StringBuilder();
|
||||
selection.append(MediaStore.Audio.AudioColumns.IS_MUSIC + "=1");
|
||||
selection.append(" AND " + MediaStore.Audio.AudioColumns.TITLE + " != ''");
|
||||
selection.append(" AND " + MediaStore.Audio.AudioColumns.ALBUM_ID + "=" + albumId);
|
||||
public static Cursor makeAlbumSongCursor(final Context context, final int albumId) {
|
||||
return context.getContentResolver().query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
|
||||
new String[]{
|
||||
/* 0 */
|
||||
|
|
@ -69,6 +64,9 @@ public class AlbumSongLoader {
|
|||
MediaStore.Audio.AudioColumns.TRACK,
|
||||
/* 6 */
|
||||
MediaStore.Audio.AudioColumns.ARTIST_ID
|
||||
}, selection.toString(), null, PreferenceUtils.getInstance(context).getAlbumSongSortOrder());
|
||||
}, (MediaStore.Audio.AudioColumns.IS_MUSIC + "=1") + " AND " +
|
||||
MediaStore.Audio.AudioColumns.TITLE + " != ''" + " AND " +
|
||||
MediaStore.Audio.AudioColumns.ALBUM_ID + "=" + albumId, null,
|
||||
PreferenceUtils.getInstance(context).getAlbumSongSortOrder());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by karim on 04.01.15.
|
||||
* @author Karim Abou Zeid (kabouzeid)
|
||||
*/
|
||||
public class ArtistAlbumLoader {
|
||||
public static List<Album> getArtistAlbumList(final Context context, final int artistId) {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by karim on 29.12.14.
|
||||
* @author Karim Abou Zeid (kabouzeid)
|
||||
*/
|
||||
public class ArtistLoader {
|
||||
|
||||
|
|
@ -37,11 +37,11 @@ public class ArtistLoader {
|
|||
return artists;
|
||||
}
|
||||
|
||||
public static final Cursor makeArtistCursor(final Context context) {
|
||||
public static Cursor makeArtistCursor(final Context context) {
|
||||
return makeArtistCursor(context, null, null);
|
||||
}
|
||||
|
||||
public static final Cursor makeArtistCursor(final Context context, final String selection, final String[] values) {
|
||||
public static Cursor makeArtistCursor(final Context context, final String selection, final String[] values) {
|
||||
return context.getContentResolver().query(MediaStore.Audio.Artists.EXTERNAL_CONTENT_URI,
|
||||
new String[]{
|
||||
/* 0 */
|
||||
|
|
|
|||
|
|
@ -9,15 +9,15 @@ import com.kabouzeid.gramophone.model.Song;
|
|||
import com.kabouzeid.gramophone.util.PreferenceUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by karim on 01.01.15.
|
||||
* @author Karim Abou Zeid (kabouzeid)
|
||||
*/
|
||||
public class ArtistSongLoader {
|
||||
public static List<Song> getArtistSongList(final Context context, final int artistId) {
|
||||
|
||||
public static ArrayList<Song> getArtistSongList(final Context context, final int artistId) {
|
||||
Cursor cursor = makeArtistSongCursor(context, artistId);
|
||||
List<Song> songs = new ArrayList<>();
|
||||
ArrayList<Song> songs = new ArrayList<>();
|
||||
if (cursor != null && cursor.moveToFirst()) {
|
||||
do {
|
||||
final int id = cursor.getInt(0);
|
||||
|
|
@ -40,10 +40,6 @@ public class ArtistSongLoader {
|
|||
}
|
||||
|
||||
public static Cursor makeArtistSongCursor(final Context context, final int artistId) {
|
||||
final StringBuilder selection = new StringBuilder();
|
||||
selection.append(MediaStore.Audio.AudioColumns.IS_MUSIC + "=1");
|
||||
selection.append(" AND " + MediaStore.Audio.AudioColumns.TITLE + " != ''");
|
||||
selection.append(" AND " + MediaStore.Audio.AudioColumns.ARTIST_ID + "=" + artistId);
|
||||
return context.getContentResolver().query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
|
||||
new String[]{
|
||||
/* 0 */
|
||||
|
|
@ -60,6 +56,9 @@ public class ArtistSongLoader {
|
|||
MediaStore.Audio.AudioColumns.TRACK,
|
||||
/* 6 */
|
||||
MediaStore.Audio.AudioColumns.ALBUM_ID
|
||||
}, selection.toString(), null, PreferenceUtils.getInstance(context).getArtistSongSortOrder());
|
||||
}, (MediaStore.Audio.AudioColumns.IS_MUSIC + "=1") + " AND " +
|
||||
MediaStore.Audio.AudioColumns.TITLE + " != ''" + " AND " +
|
||||
MediaStore.Audio.AudioColumns.ARTIST_ID + "=" + artistId, null,
|
||||
PreferenceUtils.getInstance(context).getArtistSongSortOrder());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,12 +8,11 @@ import android.provider.MediaStore.Audio.AudioColumns;
|
|||
import com.kabouzeid.gramophone.model.PlaylistSong;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class PlaylistSongLoader {
|
||||
|
||||
public static List<PlaylistSong> getPlaylistSongList(final Context context, final int playlistID) {
|
||||
List<PlaylistSong> songs = new ArrayList<>();
|
||||
public static ArrayList<PlaylistSong> getPlaylistSongList(final Context context, final int playlistID) {
|
||||
ArrayList<PlaylistSong> songs = new ArrayList<>();
|
||||
Cursor cursor = makePlaylistSongCursor(context, playlistID);
|
||||
|
||||
if (cursor != null && cursor.moveToFirst()) {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by karim on 11.01.15.
|
||||
* @author Karim Abou Zeid (kabouzeid)
|
||||
*/
|
||||
public class SongFilePathLoader {
|
||||
public static final String TAG = SongFilePathLoader.class.getSimpleName();
|
||||
|
|
@ -46,11 +46,11 @@ public class SongFilePathLoader {
|
|||
}
|
||||
}
|
||||
|
||||
public static final Cursor makeSongFilePathCursor(final Context context) {
|
||||
public static Cursor makeSongFilePathCursor(final Context context) {
|
||||
return makeSongFilePathCursor(context, null);
|
||||
}
|
||||
|
||||
public static final Cursor makeSongFilePathCursor(final Context context, String selection) {
|
||||
public static Cursor makeSongFilePathCursor(final Context context, String selection) {
|
||||
return context.getContentResolver().query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
|
||||
new String[]{
|
||||
/* 0 */
|
||||
|
|
|
|||
|
|
@ -12,14 +12,14 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by karim on 29.12.14.
|
||||
* @author Karim Abou Zeid (kabouzeid)
|
||||
*/
|
||||
public class SongLoader {
|
||||
private static final String BASE_SELECTION = MediaStore.Audio.AudioColumns.IS_MUSIC + "=1" + " AND " + MediaStore.Audio.AudioColumns.TITLE + " != ''";
|
||||
|
||||
public static List<Song> getAllSongs(Context context) {
|
||||
public static ArrayList<Song> getAllSongs(Context context) {
|
||||
Cursor cursor = makeSongCursor(context);
|
||||
List<Song> songs = new ArrayList<>();
|
||||
ArrayList<Song> songs = new ArrayList<>();
|
||||
if (cursor != null && cursor.moveToFirst()) {
|
||||
do {
|
||||
final int id = cursor.getInt(0);
|
||||
|
|
@ -48,7 +48,7 @@ public class SongLoader {
|
|||
|
||||
public static Cursor makeSongCursor(final Context context, final String selection, final String[] values) {
|
||||
String finalSelection = BASE_SELECTION;
|
||||
if(selection != null){
|
||||
if (selection != null) {
|
||||
finalSelection += " AND " + selection;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue