Ver Fonte

Move BottomSheet BackHandler to the correct place

vfsfitvnm há 3 anos atrás
pai
commit
ca90213eaf

+ 1 - 2
app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/components/BottomSheet.kt

@@ -74,8 +74,6 @@ fun BottomSheet(
         mutableStateOf(state.value)
     }
 
-    BackHandler(enabled = !state.isCollapsed, onBack = state.collapse)
-
     Box {
         if (handleOutsideInteractionsWhenExpanded && !state.isCollapsed) {
             Spacer(
@@ -157,6 +155,7 @@ fun BottomSheet(
                 .fillMaxSize()
         ) {
             if (!state.isCollapsed) {
+                BackHandler(onBack = state.collapse)
                 content()
             }