Pay Kit Android: UI Components
Pay Kit provides an unmanaged CashAppPayButton and a CashAppPaymentMethod view, in both Jetpack Compose and View-based versions. They are an optional dependency, and must be included separately.
Buttons
The button is unmanaged. It is a stylized button that isn’t aware of SDK events out-of-the-box. It is the developer’s responsibility to call authorizeCustomerRequest() when the button is clicked and to manage any disabled and loading states.
Labels
By default, the button shows the Cash App icon and “Cash App Pay”. Set label to show a call to action instead:
Styles
The button comes in these styles:
Default(default): White label and green Cash App icon on a black backgroundLight: Black label and green Cash App icon on a white background with a thin black outlineMonochromeDark: White label and icon on a black backgroundMonochromeLight: Black label and icon on a white background with a thin black outlineAlt: Black label and icon on a Cash App green backgroundAuto: Follows the system’s light or dark mode, showingDefaultin light mode andLightin dark modeMonochrome: Follows the system’s light or dark mode, showingMonochromeDarkin light mode andMonochromeLightin dark mode
Only Auto and Monochrome change when your app switches between light and dark mode. The examples below show every label in Default and Light, the disabled variants, and the default label in the monochrome and Alt styles.
You can change the size of the buttons within certain limits:
- at least
34dptall - at least
122dpwide - at most
54dptall
Jetpack Compose
To add the Jetpack Compose version of the button, use the following implementation:
Or via Gradle version catalogs (libs.toml):
For example:
With a call to action:
View-based
To add the Views version of the button, use the following:
Or via Gradle version catalogs (libs.toml):
Use one of the @style/CAPButtonStyle styles (Default, Light, MonochromeDark, MonochromeLight, Alt, Auto, or Monochrome), and optionally set the label with app:cap_label (cash_app_pay, the default, cash_app, pay, buy, cash_out, checkout, continue_with, or connect):
Or set it in code:
CashAppPaymentMethod
CashAppPaymentMethod shows the Cash App Pay logo and the customer’s Cashtag, for example after the customer approves a request. It comes in a Large layout (Cashtag to the right of the logo) and a Small layout (Cashtag under the logo).
The monochrome logo follows the system’s light or dark theme. Set usePolychromeAsset to show the green Cash App icon: on a black background in light mode, and on a green background in dark mode.
To show the “Cash App” logo instead of “Cash App Pay”, set label = CashAppPaymentMethodLabel.CashApp in Jetpack Compose, or app:cap_label="cash_app" in a View-based layout.
In Jetpack Compose:
In a View-based layout: