Код: Выделить всё
@Composable
fun MenuSample(onSearch: () -> Unit) {
var expanded by remember { mutableStateOf(false) }
DropdownMenu(
expanded = expanded,
onDismissRequest = { expanded = false },
properties = PopupProperties(dismissOnBackPress = false)
) {
DropdownMenuItem(
text = { Text("Search") },
onClick = onSearch,
leadingIcon = {
Icon(
Icons.Outlined.Search,
contentDescription = null
)
})
}
}
Код: Выделить всё
class MyActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
WindowInsetsControllerCompat(window, window.decorView).let { controller ->
controller.hide(WindowInsetsCompat.Type.navigationBars())
controller.systemBarsBehavior = WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
}
setContent {
MyJetpackContent()
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/783 ... l3-appears