Skip to content

An Android library that provides a Jetpack Compose wrapper on top of the Google Wallet button assets.

License

Notifications You must be signed in to change notification settings

google-wallet/compose-wallet-button

Repository files navigation

compose-wallet-button

Maven Central

An Android library that provides a Jetpack Compose wrapper on top of the Google Wallet button assets.

Installation

The library is hosted on Maven central and can be used by ensuring the following lines exist in each gradle file:

build.gradle:

repositories {
    mavenCentral()
}

app/build.gradle:

dependencies {
    implementation "com.google.wallet.button:compose-wallet-button:<version>"
}

Usage

// other imports omitted for brevity
// see full example in the "app" directory

import com.google.wallet.button.ButtonType
import com.google.wallet.button.WalletButton

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        val onClick = { println("Button clicked") }

        setContent {
            // Default
            WalletButton(onClick = onClick)

            // Customized look
            WalletButton(onClick = onClick, modifier = Modifier.width(350.dp))

            // Condensed version
            WalletButton(onClick = onClick, type = ButtonType.AddCondensed)
        }
    }
}

About

An Android library that provides a Jetpack Compose wrapper on top of the Google Wallet button assets.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages