commit | b801ae691cea4d861753eb0845d9452a489ca5f3 | [log] [tgz] |
---|---|---|
author | Sebastiano Barezzi <seba@sebaubuntu.dev> | Wed Oct 09 10:58:11 2024 +0200 |
committer | Sebastiano Barezzi <seba@sebaubuntu.dev> | Wed Oct 09 10:59:58 2024 +0200 |
tree | 4461a6391629d06d661d893fde6dec33bcb60098 | |
parent | 8b8ff9c3560ecb98d2710f731762e1d65040ff72 [diff] |
Twelve: Make availableCommands a variable Change-Id: Id6674574174b4adef28ca5950f783af74a010845
diff --git a/app/src/main/java/org/lineageos/twelve/fragments/NowPlayingFragment.kt b/app/src/main/java/org/lineageos/twelve/fragments/NowPlayingFragment.kt index efc4d3f..58962a1 100644 --- a/app/src/main/java/org/lineageos/twelve/fragments/NowPlayingFragment.kt +++ b/app/src/main/java/org/lineageos/twelve/fragments/NowPlayingFragment.kt
@@ -387,7 +387,7 @@ } launch { - viewModel.availableCommands().collectLatest { + viewModel.availableCommands.collectLatest { it?.let { playbackSpeedMaterialButton.isVisible = it.contains(Player.COMMAND_SET_SPEED_AND_PITCH)
diff --git a/app/src/main/java/org/lineageos/twelve/viewmodels/TwelveViewModel.kt b/app/src/main/java/org/lineageos/twelve/viewmodels/TwelveViewModel.kt index 198d742..1020766 100644 --- a/app/src/main/java/org/lineageos/twelve/viewmodels/TwelveViewModel.kt +++ b/app/src/main/java/org/lineageos/twelve/viewmodels/TwelveViewModel.kt
@@ -208,7 +208,7 @@ ) @OptIn(ExperimentalCoroutinesApi::class) - fun availableCommands() = mediaController + val availableCommands = mediaController .filterNotNull() .flatMapLatest { it.availableCommandsFlow() } .flowOn(Dispatchers.Main)