PayButton

  • The PayButton is a UI element for integrating Google Pay into Android apps, customizable via ButtonOptions.

  • It handles user interactions through the onClick method and allows custom click listeners.

  • The button inherits standard Android View methods for layout, appearance, and event handling.

  • Developers can manage accessibility, focus, touch events, and scrolling using inherited functionalities.

  • Initialization and customization occur through the initialize method with ButtonOptions.

public final class PayButton extends FrameLayout
implements View.OnClickListener

The API creates a View to render a dynamic payment button based on the provided ButtonOptions.

Inherited Constant Summary

Inherited Field Summary

Public Constructor Summary

PayButton(Context context)
Creates a new instance of PayButton for use in a non-activity Context.
PayButton(Context context, AttributeSet attrs)
Creates a new instance of PayButton for use in a non-activity Context.
PayButton(Context context, AttributeSet attrs, int defStyle)

Public Method Summary

void
initialize(ButtonOptions options)
Initialize the button view with given buttonOptions.
void
onClick(View view)
void

Inherited Method Summary

Public Constructors

public PayButton (Context context)

Creates a new instance of PayButton for use in a non-activity Context.

public PayButton (Context context, AttributeSet attrs)

Creates a new instance of PayButton for use in a non-activity Context.

public PayButton (Context context, AttributeSet attrs, int defStyle)

Public Methods

public void initialize (ButtonOptions options)

Initialize the button view with given buttonOptions.

public void onClick (View view)

public void setOnClickListener (View.OnClickListener listener)