Skip to content

Feature Request: Add Navigation Component to Sample App #67

@tokelo-12

Description

@tokelo-12

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:

  1. Add the Navigation Component dependencies.

  2. Create a NavHost to define the navigation graph.

  3. Separate the UI into different composable screens (e.g., ProductScreen, PaymentSuccessScreen).

  4. Use navigation calls (e.g., navController.navigate()) to move between screens based on the payment state.

  5. Pass data between screens using navigation arguments where necessary (e.g., the payer's name to the success screen)."

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions