Rick Regan
07/25/2023, 2:42 PMDropdownMenu
stays open after a trip through the background. It does, but I can only get it into the background with the open menu intact by using the home button of 2 or 3-button navigation, not by using swipe up to home with gesture navigation. For the latter, the menu appears to close before going into the background, due to the gesture itself. I’m wondering if this can be fixed. (Video, more details, and code in thread.)Rick Regan
07/25/2023, 2:42 PMRick Regan
07/25/2023, 2:44 PMRick Regan
07/25/2023, 2:45 PM@Composable
fun MenuBackgroundTest() {
Column(modifier = Modifier.padding(20.dp)) {
var openMenu by rememberSaveable { mutableStateOf(false) }
IconButton(
onClick = {
openMenu = true
}
) {
Icon(<http://Icons.Default.Menu|Icons.Default.Menu>, contentDescription = "")
}
DropdownMenu(
expanded = openMenu,
onDismissRequest = {
openMenu = false
}
) {
for (i in 1..4) {
DropdownMenuItem(
text = {
Text("Item $i")
},
onClick = {
openMenu = false
}
)
}
}
}
}
Rick Regan
07/25/2023, 3:14 PMproperties = PopupProperties(
dismissOnClickOutside = false
)
to DropdownMenu
.