Twelve: NowPlayingFragment: Check all player commands
It disables the buttons but won't change color, it will be done in a
follow-up commit
Change-Id: I53cf00fd5e3869dff2c9acc41ed5e05f35fc067d
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 28c3ed4..f6d08e0 100644
--- a/app/src/main/java/org/lineageos/twelve/fragments/NowPlayingFragment.kt
+++ b/app/src/main/java/org/lineageos/twelve/fragments/NowPlayingFragment.kt
@@ -400,8 +400,29 @@
launch {
viewModel.availableCommands.collectLatest {
it?.let {
- playbackSpeedMaterialButton.isVisible =
- it.contains(Player.COMMAND_SET_SPEED_AND_PITCH)
+ shuffleMaterialButton.isEnabled = it.contains(
+ Player.COMMAND_SET_SHUFFLE_MODE
+ )
+
+ previousTrackMaterialButton.isEnabled = it.contains(
+ Player.COMMAND_SEEK_TO_PREVIOUS
+ )
+
+ playPauseMaterialButton.isEnabled = it.contains(
+ Player.COMMAND_PLAY_PAUSE
+ )
+
+ nextTrackMaterialButton.isEnabled = it.contains(
+ Player.COMMAND_SEEK_TO_NEXT
+ )
+
+ repeatMaterialButton.isEnabled = it.contains(
+ Player.COMMAND_SET_REPEAT_MODE
+ )
+
+ playbackSpeedMaterialButton.isEnabled = it.contains(
+ Player.COMMAND_SET_SPEED_AND_PITCH
+ )
}
}
}