Card | Button SDK for Android v7.0.0
Card
extends Object
| java.lang.Object | |
| ↳ | com.usebutton.sdk.purchasepath.Card |
| Known Direct Subclasses |
Class Overview
Base template class for checkout extension overlay cards.
Summary
Constants
| Constants |
|---|
| float |
| float |
Public Constructors
| Public Constructors |
|---|
Public Methods
| Public Methods |
|---|
| final void |
| final View |
| boolean |
| final BrowserInterface |
| CallToAction |
| Object |
| final View |
| int |
| final void |
| void |
Protected Methods
| Protected Methods |
|---|
| abstract void |
| abstract View |
Constants
public static final float DEFAULT_TEXT_SIZE_BODY
Constant Value:
13.0
public static final float DEFAULT_TEXT_SIZE_TITLE
Constant Value:
16.0
Public Constructors
public Card( CallToAction callToAction)
Creates a new card instance with the given call to action.
Parameters
| callToAction | call to action that will be displayed when the card is "active". |
Public Methods
public final void bindView(View view)
Invoked by the checkout system when a view should be populated with the card data. Delegates to onBindView(View) and performs other internal initialization.
Parameters
| view | a view instance inflated by onCreateView(ViewGroup) to display the card
contents. |
public final View createView(ViewGroup parent)
Invoked by the checkout system when a new view is needed to display card contents. Delegates to onCreateView(ViewGroup) and performs other internal initialization.
Parameters
| parent | ViewGroup where newly inflated view should be attached. |
Returns
- the view inflated by ``.
public boolean equals( Object obj)
public final BrowserInterfacegetBrowser()
A reference to the checkout interface.
Use this, for example, to make any changes to the top or bottom bars, add, update, or remove cards when a user interacts with a card instance.
Returns
- Nullable value of
BrowserInterface
public CallToActiongetCallToAction()
Get the public call to action for the active state.
Returns
- the call to action for this card.
public ObjectgetKey()
Gets the key of this card.
Returns
- key object.
public final View getView()
The view instance currently associated with this card. Use this to make any updates to your view, for example, when a user interacts with the view.
Returns
- Nullable value when a card instance has an associated view representing it
public int hashCode()
public final void setBrowser( BrowserInterface browser)
public void setKey( Object key)
Sets the key of the card.
Keys are meant to be unique. If multiple cards match the given key, There can be issue trying
to get the correct card from the CardList
Parameters
| key | Object. |
Protected Methods
protected abstract void onBindView(View view)
Called when an inflated card view should be populated with data for display.
Parameters
| view | instance of the view returned from onCreateView(ViewGroup) |
protected abstract View onCreateView(ViewGroup parent)
Called when a view should be inflated to display the card contents. Subclasses should override this method
Parameters
| parent | ViewGroup where newly inflated view should be attached. |
Returns
- the newly inflated view that can display the card contents.