Replaced popBackStack() with navigateUp() on about screen and call screens
This commit is contained in:
@ -36,7 +36,7 @@ import androidx.navigation.compose.composable
|
||||
|
||||
fun NavGraphBuilder.aboutScreenRoute(navController: NavController) {
|
||||
composable("about") {
|
||||
AboutScreen(onBack = { navController.popBackStack() })
|
||||
AboutScreen(onBack = { navController.navigateUp() })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -92,9 +92,7 @@ fun NavGraphBuilder.callDetailsScreenRoute(navController: NavController, viewMod
|
||||
private fun CallDetailsScreen(navController: NavController, callRow: CallRow) {
|
||||
val detailsState = remember { callRow.details.toMutableStateList() }
|
||||
Scaffold(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.imePadding(),
|
||||
modifier = Modifier.fillMaxSize().imePadding(),
|
||||
containerColor = MaterialTheme.colorScheme.background,
|
||||
topBar = {
|
||||
Column(
|
||||
@ -117,7 +115,7 @@ private fun CallDetailsScreen(navController: NavController, callRow: CallRow) {
|
||||
),
|
||||
windowInsets = WindowInsets(0, 0, 0, 0),
|
||||
navigationIcon = {
|
||||
IconButton(onClick = navController::popBackStack) {
|
||||
IconButton(onClick = navController::navigateUp) {
|
||||
Icon(
|
||||
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
|
||||
contentDescription = "Back",
|
||||
@ -136,7 +134,7 @@ private fun CallDetailsScreen(navController: NavController, callRow: CallRow) {
|
||||
onDelete = { detail ->
|
||||
detailsState.remove(detail)
|
||||
if (detailsState.isEmpty())
|
||||
navController.popBackStack()
|
||||
navController.navigateUp()
|
||||
}
|
||||
)
|
||||
},
|
||||
|
||||
@ -114,13 +114,11 @@ private fun CallsScreen(navController: NavController, viewModel: ViewModel, aor:
|
||||
|
||||
BackHandler(enabled = true) {
|
||||
account.missedCalls = false
|
||||
navController.popBackStack()
|
||||
navController.navigateUp()
|
||||
}
|
||||
|
||||
Scaffold(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.imePadding(),
|
||||
modifier = Modifier.fillMaxSize().imePadding(),
|
||||
containerColor = MaterialTheme.colorScheme.background,
|
||||
topBar = {
|
||||
Column(
|
||||
@ -187,7 +185,7 @@ private fun TopAppBar(navController: NavController, account: Account, callHistor
|
||||
IconButton(
|
||||
onClick = {
|
||||
account.missedCalls = false
|
||||
navController.popBackStack()
|
||||
navController.navigateUp()
|
||||
}
|
||||
) {
|
||||
Icon(
|
||||
@ -259,9 +257,7 @@ private fun CallsContent(
|
||||
private fun Account(account: Account) {
|
||||
Text(
|
||||
text = stringResource(R.string.account) + " " + account.text(),
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(top = 8.dp),
|
||||
modifier = Modifier.fillMaxWidth().padding(top = 8.dp),
|
||||
fontSize = 18.sp,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
textAlign = TextAlign.Center
|
||||
@ -347,7 +343,7 @@ private fun Calls(
|
||||
neutralAction.value = {
|
||||
if (ua != null) {
|
||||
handleIntent(ctx, viewModel, intent, "message")
|
||||
navController.popBackStack()
|
||||
navController.navigateUp()
|
||||
}
|
||||
}
|
||||
showDialog.value = true
|
||||
|
||||
Reference in New Issue
Block a user