Assigned
Status Update
Comments
em...@well.co <em...@well.co> #2
This actually has nothing to do with NavHostFragment, but is the behavior of NavController's setGraph().
When you call navController.setGraph(R.navigation.navigation_graph), it stores that ID and will restore that ID automatically.
If you were to instead use:
NavInflater navInflater = new NavInflater(this, navController.getNavigatorProvider());
navController.setGraph(navInflater.inflate(R.navigation.navigation_graph));
Then NavController would not restore the graph itself and the call to restoreState() you point out would only restore the back stack state, etc. but would wait for you to call setGraph again.
You're right that the inconsistency between the two setGraph methods is concerning. We'll take a look.
When you call navController.setGraph(R.navigation.navigation_graph), it stores that ID and will restore that ID automatically.
If you were to instead use:
NavInflater navInflater = new NavInflater(this, navController.getNavigatorProvider());
navController.setGraph(navInflater.inflate(R.navigation.navigation_graph));
Then NavController would not restore the graph itself and the call to restoreState() you point out would only restore the back stack state, etc. but would wait for you to call setGraph again.
You're right that the inconsistency between the two setGraph methods is concerning. We'll take a look.
Description
composeBom = "2024.04.01"
Jetpack Compose component(s) used:
Alert Dialog
Android Studio Build:
Android Studio Ladybug | 2024.2.1 Patch 2
Kotlin version:
2.0.0
Steps to Reproduce or Code Sample to Reproduce:
Set font size and display size to smaller values, rotate your device to landscape mode and open up the dialog.
The dialog's width is really small and looks weird.
AlertDialog(
title = { Text("Leave the app?", modifier = Modifier.semantics { heading() }) },
text = {
Column(modifier = Modifier.verticalScroll(rememberScrollState())) {
Text("$message $message")
}
},
onDismissRequest = { dismissAction.invoke() },
confirmButton = {
TextButton(onClick = {
confirmAction?.invoke()
dismissAction.invoke()
}) {
Text(text = positiveButtonText)
}
},
dismissButton = {
TextButton(
onClick = dismissAction
) {
Text(text = negativeButtonText)
}
}
)