Fix Preference list selection and Favourite Song
This commit is contained in:
parent
263620310f
commit
9156ec2390
33 changed files with 192 additions and 237 deletions
|
@ -29,21 +29,21 @@ import java.util.*
|
|||
*/
|
||||
|
||||
object PlaylistLoader {
|
||||
fun makePlaylistCursor(context: Context, selection: String?, values: Array<String>?): Cursor? {
|
||||
try {
|
||||
return context.contentResolver.query(MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI,
|
||||
private fun makePlaylistCursor(context: Context, selection: String?, values: Array<String>?): Cursor? {
|
||||
return try {
|
||||
context.contentResolver.query(MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI,
|
||||
arrayOf(
|
||||
/* 0 */
|
||||
BaseColumns._ID,
|
||||
/* 1 */
|
||||
PlaylistsColumns.NAME), selection, values, MediaStore.Audio.Playlists.DEFAULT_SORT_ORDER)
|
||||
} catch (e: SecurityException) {
|
||||
return null
|
||||
}
|
||||
|
||||
} catch (e: SecurityException) {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
fun getPlaylist(cursor: Cursor?): Observable<Playlist> {
|
||||
private fun getPlaylist(cursor: Cursor?): Observable<Playlist> {
|
||||
return Observable.create { e ->
|
||||
var playlist = Playlist()
|
||||
|
||||
|
@ -83,7 +83,7 @@ object PlaylistLoader {
|
|||
}
|
||||
|
||||
|
||||
fun getAllPlaylists(cursor: Cursor?): Observable<ArrayList<Playlist>> {
|
||||
private fun getAllPlaylists(cursor: Cursor?): Observable<ArrayList<Playlist>> {
|
||||
return Observable.create { e ->
|
||||
val playlists = ArrayList<Playlist>()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue