password screen added
This commit is contained in:
parent
af9a5487b1
commit
4c23e53983
@ -25,6 +25,8 @@ import com.mob.utsmyanmar.ui.device_info.DeviceInfoViewModel
|
||||
import com.mob.utsmyanmar.ui.functions.FunctionsScreen
|
||||
import com.mob.utsmyanmar.ui.history_functions.HistoryRoute
|
||||
import com.mob.utsmyanmar.ui.input_amount.AmountRoute
|
||||
import com.mob.utsmyanmar.ui.password_input.InputPassword
|
||||
import com.mob.utsmyanmar.ui.password_input.PasswordType
|
||||
import com.mob.utsmyanmar.ui.pinpad.PinPadRoute
|
||||
import com.mob.utsmyanmar.ui.pinpad.PinPadViewModel
|
||||
import com.mob.utsmyanmar.ui.print_receipt.PrintReceiptScreen
|
||||
@ -118,7 +120,12 @@ fun AppNavGraph(
|
||||
}
|
||||
|
||||
else -> {
|
||||
navController.navigate(Routes.Amount.createRoute(action)) {
|
||||
navController.navigate(
|
||||
Routes.Password.createRoute(
|
||||
destination = Routes.Amount.createRoute(action),
|
||||
passwordType = PasswordType.SYSTEM
|
||||
)
|
||||
) {
|
||||
launchSingleTop = true
|
||||
}
|
||||
}
|
||||
@ -128,20 +135,35 @@ fun AppNavGraph(
|
||||
when (action) {
|
||||
"Void" -> {
|
||||
sharedViewModel.transactionsType.value = TransactionsType.VOID
|
||||
navController.navigate(Routes.VoidTrace.route) {
|
||||
navController.navigate(
|
||||
Routes.Password.createRoute(
|
||||
destination = Routes.VoidTrace.route,
|
||||
passwordType = PasswordType.SYSTEM
|
||||
)
|
||||
) {
|
||||
launchSingleTop = true
|
||||
}
|
||||
}
|
||||
|
||||
"Pre-Auth Complete Void" -> {
|
||||
sharedViewModel.transactionsType.value = TransactionsType.PRE_AUTH_COMPLETE_VOID
|
||||
navController.navigate(Routes.VoidTrace.route) {
|
||||
navController.navigate(
|
||||
Routes.Password.createRoute(
|
||||
destination = Routes.VoidTrace.route,
|
||||
passwordType = PasswordType.SYSTEM
|
||||
)
|
||||
) {
|
||||
launchSingleTop = true
|
||||
}
|
||||
}
|
||||
|
||||
else -> {
|
||||
navController.navigate(Routes.Amount.createRoute(action)) {
|
||||
navController.navigate(
|
||||
Routes.Password.createRoute(
|
||||
destination = Routes.Amount.createRoute(action),
|
||||
passwordType = PasswordType.SYSTEM
|
||||
)
|
||||
) {
|
||||
launchSingleTop = true
|
||||
}
|
||||
}
|
||||
@ -154,15 +176,32 @@ fun AppNavGraph(
|
||||
},
|
||||
|
||||
onNavigateSettlement = {
|
||||
navController.navigate(Routes.Settlement.route) {
|
||||
navController.navigate(
|
||||
Routes.Password.createRoute(
|
||||
destination = Routes.Settlement.route,
|
||||
passwordType = PasswordType.SYSTEM
|
||||
)
|
||||
) {
|
||||
launchSingleTop = true
|
||||
}
|
||||
},
|
||||
onNavigateVersion = {
|
||||
navController.navigate(Routes.Version.route)
|
||||
navController.navigate(
|
||||
Routes.Password.createRoute(
|
||||
destination = Routes.Version.route,
|
||||
passwordType = PasswordType.SYSTEM
|
||||
)
|
||||
) {
|
||||
launchSingleTop = true
|
||||
}
|
||||
},
|
||||
onNavigateFunctions = {
|
||||
navController.navigate(Routes.Functions.route) {
|
||||
navController.navigate(
|
||||
Routes.Password.createRoute(
|
||||
destination = Routes.Functions.route,
|
||||
passwordType = PasswordType.SYSTEM
|
||||
)
|
||||
) {
|
||||
launchSingleTop = true
|
||||
}
|
||||
},
|
||||
@ -180,18 +219,33 @@ fun AppNavGraph(
|
||||
when (action) {
|
||||
"Void" -> {
|
||||
sharedViewModel.transactionsType.value = TransactionsType.VOID
|
||||
navController.navigate(Routes.VoidTrace.route) {
|
||||
navController.navigate(
|
||||
Routes.Password.createRoute(
|
||||
destination = Routes.VoidTrace.route,
|
||||
passwordType = PasswordType.SYSTEM
|
||||
)
|
||||
) {
|
||||
launchSingleTop = true
|
||||
}
|
||||
}
|
||||
"Pre-Auth Complete Void" -> {
|
||||
sharedViewModel.transactionsType.value = TransactionsType.PRE_AUTH_COMPLETE_VOID
|
||||
navController.navigate(Routes.VoidTrace.route) {
|
||||
navController.navigate(
|
||||
Routes.Password.createRoute(
|
||||
destination = Routes.VoidTrace.route,
|
||||
passwordType = PasswordType.SYSTEM
|
||||
)
|
||||
) {
|
||||
launchSingleTop = true
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
navController.navigate(Routes.Amount.createRoute(action)) {
|
||||
navController.navigate(
|
||||
Routes.Password.createRoute(
|
||||
destination = Routes.Amount.createRoute(action),
|
||||
passwordType = PasswordType.SYSTEM
|
||||
)
|
||||
) {
|
||||
launchSingleTop = true
|
||||
}
|
||||
}
|
||||
@ -208,6 +262,34 @@ fun AppNavGraph(
|
||||
)
|
||||
}
|
||||
|
||||
composable(
|
||||
route = Routes.Password.route,
|
||||
arguments = listOf(
|
||||
navArgument("destination") {
|
||||
type = NavType.StringType
|
||||
},
|
||||
navArgument("passwordType") {
|
||||
type = NavType.StringType
|
||||
}
|
||||
)
|
||||
) { backStackEntry ->
|
||||
val destination = backStackEntry.arguments?.getString("destination").orEmpty()
|
||||
val passwordType = backStackEntry.arguments?.getString("passwordType").orEmpty()
|
||||
|
||||
InputPassword(
|
||||
passwordType = passwordType,
|
||||
onBack = { navController.popBackStack() },
|
||||
onPasswordCorrect = {
|
||||
navController.navigate(destination) {
|
||||
popUpTo(Routes.Password.route) {
|
||||
inclusive = true
|
||||
}
|
||||
launchSingleTop = true
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
composable(Routes.Functions.route) {
|
||||
FunctionsScreen(
|
||||
onBack = { navController.popBackStack() }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user