Merge branch 'master' into dev
This commit is contained in:
@@ -51,8 +51,8 @@ class AuxioService :
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
playbackFragment = playbackFragmentFactory.create(this, this)
|
||||
sessionToken = playbackFragment.attach()
|
||||
musicFragment = musicFragmentFactory.create(this, this, this)
|
||||
sessionToken = playbackFragment.attach()
|
||||
musicFragment.attach()
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ import org.oxycblt.auxio.detail.list.EditHeader
|
||||
import org.oxycblt.auxio.detail.list.SortHeader
|
||||
import org.oxycblt.auxio.list.BasicHeader
|
||||
import org.oxycblt.auxio.list.Divider
|
||||
import org.oxycblt.auxio.list.Header
|
||||
import org.oxycblt.auxio.list.Item
|
||||
import org.oxycblt.auxio.list.ListSettings
|
||||
import org.oxycblt.auxio.list.adapter.UpdateInstructions
|
||||
@@ -431,6 +432,7 @@ constructor(
|
||||
// TODO: The user could probably press some kind of button if they were fast enough.
|
||||
// Think of a better way to handle this state.
|
||||
_editedPlaylist.value = null
|
||||
refreshPlaylist(playlist.uid)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -523,12 +525,13 @@ constructor(
|
||||
}
|
||||
}
|
||||
|
||||
private fun <T : MusicParent> refreshDetail(
|
||||
private inline fun <T : MusicParent> refreshDetail(
|
||||
detail: Detail<T>?,
|
||||
parent: MutableStateFlow<T?>,
|
||||
list: MutableStateFlow<List<Item>>,
|
||||
instructions: MutableEvent<UpdateInstructions>,
|
||||
replace: Int?
|
||||
replace: Int?,
|
||||
songHeader: (Int) -> Header = { SortHeader(it) }
|
||||
) {
|
||||
if (detail == null) {
|
||||
parent.value = null
|
||||
@@ -541,7 +544,7 @@ constructor(
|
||||
when (section) {
|
||||
is DetailSection.PlainSection<*> -> {
|
||||
val header =
|
||||
if (section is DetailSection.Songs) SortHeader(section.stringRes)
|
||||
if (section is DetailSection.Songs) songHeader(section.stringRes)
|
||||
else BasicHeader(section.stringRes)
|
||||
if (newList.isNotEmpty()) {
|
||||
newList.add(Divider(header))
|
||||
@@ -589,7 +592,9 @@ constructor(
|
||||
if (edited == null) {
|
||||
val playlist = detailGenerator.playlist(uid)
|
||||
refreshDetail(
|
||||
playlist, _currentPlaylist, _playlistSongList, _playlistSongInstructions, null)
|
||||
playlist, _currentPlaylist, _playlistSongList, _playlistSongInstructions, null) {
|
||||
EditHeader(it)
|
||||
}
|
||||
return
|
||||
}
|
||||
val list = mutableListOf<Item>()
|
||||
|
||||
@@ -113,9 +113,9 @@ private constructor(
|
||||
*/
|
||||
fun release() {
|
||||
bitmapProvider.release()
|
||||
playbackManager.removeListener(this)
|
||||
playbackSettings.unregisterListener(this)
|
||||
imageSettings.unregisterListener(this)
|
||||
playbackManager.removeListener(this)
|
||||
mediaSession.apply {
|
||||
isActive = false
|
||||
release()
|
||||
|
||||
@@ -107,11 +107,11 @@ private constructor(
|
||||
|
||||
fun release() {
|
||||
waitJob.cancel()
|
||||
playbackManager.removeListener(this)
|
||||
systemReceiver.release()
|
||||
widgetComponent.release()
|
||||
context.unregisterReceiver(systemReceiver)
|
||||
sessionHolder.release()
|
||||
exoHolder.release()
|
||||
playbackManager.removeListener(this)
|
||||
}
|
||||
|
||||
override fun onSessionEnded() {
|
||||
|
||||
Reference in New Issue
Block a user