-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathBottomSheetComposable.kt
36 lines (33 loc) · 1.15 KB
/
BottomSheetComposable.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package dev.enro.example.destinations.compose
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.defaultMinSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material.*
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import dev.enro.annotations.NavigationDestination
import dev.enro.core.*
import dev.enro.core.compose.dialog.BottomSheetDestination
import dev.enro.example.core.ui.ExampleScreenTemplate
import kotlinx.parcelize.Parcelize
@Parcelize
class BottomSheetComposable : NavigationKey.SupportsPresent
@OptIn(ExperimentalMaterialApi::class)
@Composable
@NavigationDestination(BottomSheetComposable::class)
fun BottomSheetScreen() = BottomSheetDestination { bottomSheetState ->
ModalBottomSheetLayout(
sheetState = bottomSheetState,
sheetContent = {
Box(
modifier = Modifier
.fillMaxWidth()
.defaultMinSize(minHeight = .5.dp)
) {
ExampleScreenTemplate(title = "Bottom Sheet")
}
},
content = {}
)
}