diff --git a/app/src/main/java/org/oxycblt/auxio/MainFragment.kt b/app/src/main/java/org/oxycblt/auxio/MainFragment.kt index a9dd01b37..78e8a7e51 100644 --- a/app/src/main/java/org/oxycblt/auxio/MainFragment.kt +++ b/app/src/main/java/org/oxycblt/auxio/MainFragment.kt @@ -512,14 +512,15 @@ class MainFragment : binding.queueSheet.coordinatorLayoutBehavior as QueueBottomSheetBehavior? val exploreNavController = binding.exploreNavHost.findNavController() - // TODO: Debug why this fails sometimes on the playback sheet - // TODO: Add playlist editing to enabled check // TODO: Chain these listeners in some way instead of keeping them all here, // assuming listeners added later have more priority isEnabled = - queueSheetBehavior?.state == BackportBottomSheetBehavior.STATE_EXPANDED || - playbackSheetBehavior.state == BackportBottomSheetBehavior.STATE_EXPANDED || + (queueSheetBehavior != null && + queueSheetBehavior.state != BackportBottomSheetBehavior.STATE_COLLAPSED && + playbackSheetBehavior.state == BackportBottomSheetBehavior.STATE_EXPANDED) || + (playbackSheetBehavior.state != BackportBottomSheetBehavior.STATE_COLLAPSED && + playbackSheetBehavior.state != BackportBottomSheetBehavior.STATE_HIDDEN) || detailModel.editedPlaylist.value != null || selectionModel.selected.value.isNotEmpty() || exploreNavController.currentDestination?.id !=