-
Notifications
You must be signed in to change notification settings - Fork 198
Description
The current sample app is a single-screen application that demonstrates a one-off payment flow. While this is effective for showing the core API functionality, it doesn't showcase how the Google Pay button would integrate into a more complex, multi-screen application.
-
Proposed Solution
I propose adding the Jetpack Navigation Component to introduce a more realistic navigation flow. This would involve creating separate composables for different screens like the ProductScreen and the PaymentSuccessScreen. The app would then navigate between these screens based on user actions and payment status. This approach aligns with modern Android development best practices and the growing adoption of Jetpack Compose Navigation.
-
Implementation Details
I plan to:
-
Add the Navigation Component dependencies.
-
Create a NavHost to define the navigation graph.
-
Separate the UI into different composable screens (e.g., ProductScreen, PaymentSuccessScreen).
-
Use navigation calls (e.g., navController.navigate()) to move between screens based on the payment state.
-
Pass data between screens using navigation arguments where necessary (e.g., the payer's name to the success screen)."