Связанные ресурсы:


Код:
class MainActivity : ComponentActivity() {
@OptIn(ExperimentalMaterial3Api::class)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge(
navigationBarStyle = SystemBarStyle.dark(
scrim = TRANSPARENT,
)
)
setContent {
IntentTestTheme {
val showSheet = remember {
mutableStateOf(false)
}
if(showSheet.value){
ModalBottomSheet(
onDismissRequest = {
showSheet.value = false
},
containerColor = Color.Transparent,
contentWindowInsets = {
WindowInsets(0,0,0,0)
},
dragHandle = {
}
) {
Box(Modifier.fillMaxWidth().height(300.dp).background(Color.Red)){
}
}
}
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center){
Button(
onClick = {
showSheet.value = true
}
) {
Text("Click")
}
}
}
}
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/798 ... ttom-sheet
Мобильная версия