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