I want to achieve an edge-to-edge screen (only for a specific screen in the app) and I am using ComponentActivity enableEdgeToEdge() method. I want to restore the previous setting when navigating out of this screen. There doesn't seem to be an opposite method to call.
@Composable
fun FullScreen() {
val context = LocalContext.current as ComponentActivity
DisposableEffect(Unit) {
context.enableEdgeToEdge()
onDispose {
// context.disableEdgeToEdge() <-- HOW TO ACHIEVE THIS?
}
}
Column(
modifier = Modifier
.padding(vertical = 200.dp)
.fillMaxSize(),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(20.dp),
) {
Text(text = "This is full screen!", style = MaterialTheme.typography.headlineMedium)
}
}
When I press the back button, the previous screen is now edge-to-edge as well, which I do not want.