Closed GCZeng closed 1 year ago
I have a full screen application for a kiosk and when the dialogs show up the system navigation appears as well.
Open a dialog and the system navigations pop up. code:
class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { FullScreenDialogDemoTheme { // A surface container using the 'background' color from the theme Surface(modifier = Modifier.fillMaxSize(), color = MaterialTheme.colors.background) { var showDialog by remember { mutableStateOf(false) } val parentSystemUiController = rememberSystemUiController() parentSystemUiController.isSystemBarsVisible = false parentSystemUiController.systemBarsBehavior = WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE Box { Button(onClick = { showDialog = true }) { Text(text = "Open Dialog") } } if (showDialog) { AboutDialog(onDismiss = { showDialog = !showDialog }) } } } } } } @Composable fun AboutDialog( confirmText: String = "OK", onDismiss: () -> Unit = {}, ) { AlertDialog( onDismissRequest = { onDismiss() }, confirmButton = { val dialogSystemUiController = rememberSystemUiController() dialogSystemUiController.isStatusBarVisible = false // Status bar dialogSystemUiController.isNavigationBarVisible = false // Navigation bar dialogSystemUiController.isSystemBarsVisible = false // Status & Navigation bars dialogSystemUiController.systemBarsBehavior = WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE TextButton(onClick = onDismiss) { Text(text = confirmText) } }, title = { Text( text = "title", fontWeight = FontWeight.Bold, style = MaterialTheme.typography.h5 ) }, text = { Column() { Text( text = "about", color = Color.Black, style = MaterialTheme.typography.h6 ) } }, modifier = Modifier .width(600.dp) .clip(RoundedCornerShape(12.dp)), ) }
For the system navigations to stay hidden
Unfortunately Accompanist SystemUIController has been deprecated and won't be supported going forwards. I am closing this issue. For more information please see our update blog
Describe the bug
I have a full screen application for a kiosk and when the dialogs show up the system navigation appears as well.
To Reproduce
Open a dialog and the system navigations pop up. code:
Expected behavior
For the system navigations to stay hidden
Screenshots?
Environment: