added shortcuts and widgets
This commit is contained in:
parent
d47aeccd87
commit
03aeb88964
54 changed files with 2646 additions and 935 deletions
|
@ -2,18 +2,17 @@ package code.name.monkey.retromusic.loaders
|
|||
|
||||
import android.content.Context
|
||||
import android.text.TextUtils
|
||||
import java.util.ArrayList
|
||||
|
||||
import code.name.monkey.retromusic.R
|
||||
import io.reactivex.Observable
|
||||
import java.util.*
|
||||
|
||||
object SearchLoader {
|
||||
|
||||
fun searchAll(context: Context, query: String): Observable<ArrayList<Any>> {
|
||||
fun searchAll(context: Context, query: String?): Observable<ArrayList<Any>> {
|
||||
val results = ArrayList<Any>()
|
||||
return Observable.create { e ->
|
||||
if (!TextUtils.isEmpty(query)) {
|
||||
SongLoader.getSongs(context, query)
|
||||
SongLoader.getSongs(context, query!!)
|
||||
.subscribe { songs ->
|
||||
if (!songs.isEmpty()) {
|
||||
results.add(context.resources.getString(R.string.songs))
|
||||
|
|
|
@ -114,7 +114,7 @@ object SongLoader {
|
|||
return newSelectionValues
|
||||
}
|
||||
|
||||
fun getSong(cursor: Cursor?): Observable<Song> {
|
||||
private fun getSong(cursor: Cursor?): Observable<Song> {
|
||||
return Observable.create { e ->
|
||||
val song: Song = if (cursor != null && cursor.moveToFirst()) {
|
||||
getSongFromCursorImpl(cursor)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue