InteractiveButton | Button SDK for Android v7.0.0

InteractiveButton

This class is deprecated.

Button Actions has been deprecated. Please contact Button to update your integration.

Class Overview

The InteractiveButton is an alternative to DropinButton and will give the user a swipable list of top-level options to choose from for a direct link into the commerce application.

This class has a minimum height requirements and should get as close to full screen width as your design and layout accommodates.

You can control several aspects of the layout of this class using XML attributes:

 button:btn_drawablePaddingLeft
 button:btn_drawablePaddingRight
 button:btn_iconSize
 button:btn_backgroundColor
 button:btn_backgroundDrawable
 button:btn_textSize

Code Example:

final Location venue = new Location("Madison Square Garden");
venue.putIdentifier(Identifiers.IDENTIFIER_TICKETMASTER, "483329");
final ActionQuery context = ActionQuery.withSubjectLocation(venue);
final InteractiveButton button = (InteractiveButton) findViewById(R.id.my_activity_button_interactive);
Button.getButton(this).getAction("btn-your-id", context, new AppActionCallbacks() {
    @Override
    public void onAction(final AppAction action) {
        // Let's setup our Button
        button.prepareWithAction(action);
    }

@Override
    public void onNoAction() {
        button.setVisibility(View.GONE);
    }
});

Summary

Public Constructors
InteractiveButton(Context context)
InteractiveButton(Context context, AttributeSet attrs)
InteractiveButton(Context context, AttributeSet attrs, int defStyleAttr)
InteractiveButton(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Public Methods
void prepareWithAction( ButtonAction action) - This method is deprecated.
Button Actions has been deprecated. Please contact Button to update your integration.
void setInventoryLeftPadding_Button(int leftPadding) - Set the padding between the left edge of the view and the first inventory item.

Public Methods Details

public void prepareWithAction( ButtonAction action)

This method is deprecated.

Call this to prepare the InteractiveButton with an AppAction and show its inventory. Before calling this, or if passing null the button will render a loading state. See actions() on how to fetch a valid ButtonAction object.

Parameters

| action | or null to show a loading state. An action that does not contain any groups will also be treated as null and show a loading state. |

public void setInventoryLeftPadding_Button(int leftPadding)

Set the padding between the left edge of the view and the first inventory item. Equivalent to using the button:btn_inventoryLeftPadding attribute in a layout XML.

Parameters

| leftPadding | pixels of left padding |