[Search] Add song to queue and start playing it when clicked in Search
This commit is contained in:
parent
337d7301e9
commit
36122e71e8
1 changed files with 4 additions and 3 deletions
|
@ -14,6 +14,7 @@
|
||||||
*/
|
*/
|
||||||
package code.name.monkey.retromusic.adapter
|
package code.name.monkey.retromusic.adapter
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
@ -45,6 +46,7 @@ class SearchAdapter(
|
||||||
private var dataSet: List<Any>
|
private var dataSet: List<Any>
|
||||||
) : RecyclerView.Adapter<SearchAdapter.ViewHolder>() {
|
) : RecyclerView.Adapter<SearchAdapter.ViewHolder>() {
|
||||||
|
|
||||||
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
fun swapDataSet(dataSet: List<Any>) {
|
fun swapDataSet(dataSet: List<Any>) {
|
||||||
this.dataSet = dataSet
|
this.dataSet = dataSet
|
||||||
notifyDataSetChanged()
|
notifyDataSetChanged()
|
||||||
|
@ -201,9 +203,8 @@ class SearchAdapter(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
SONG -> {
|
SONG -> {
|
||||||
val playList = mutableListOf<Song>()
|
MusicPlayerRemote.playNext(item as Song)
|
||||||
playList.add(item as Song)
|
MusicPlayerRemote.playNextSong()
|
||||||
MusicPlayerRemote.openQueue(playList, 0, true)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue