make dialogs prvent hiding the controller ui

This commit is contained in:
Christian Schabesberger 2024-09-04 15:18:02 +02:00
parent 3eabb537f7
commit e9bf17e542
1 changed files with 7 additions and 2 deletions

View File

@ -68,7 +68,10 @@ fun DropDownMenu(viewModel: VideoPlayerViewModel, uiState: VideoPlayerUIState) {
}
Box {
IconButton(onClick = { showMainMenu = true }, modifier = Modifier.onPlaced {
IconButton(onClick = {
showMainMenu = true
viewModel.dialogVisible(true)
}, modifier = Modifier.onPlaced {
offsetY = with(pixel_density) {
it.size.height.toDp()
}
@ -82,7 +85,9 @@ fun DropDownMenu(viewModel: VideoPlayerViewModel, uiState: VideoPlayerUIState) {
DropdownMenu(modifier = Modifier.align(Alignment.TopStart),
offset = DpOffset(x = 0.dp, y = -offsetY),
expanded = showMainMenu,
onDismissRequest = { showMainMenu = false }) {
onDismissRequest = { showMainMenu = false
viewModel.dialogVisible(false)
}) {
DropdownMenuItem(text = { Text(stringResource(R.string.menu_item_open_in_browser)) },
leadingIcon = {
Icon(