public interface

BrowserInterface

com.usebutton.sdk.purchasepath.BrowserInterface

Class Overview

Interface containing methods that a publisher can use to customize the embedded browser experience.

Summary

Nested Classes
interface BrowserInterface.Footer Footer chrome for the embedded browser. 
interface BrowserInterface.Header Header chrome and title bar for the embedded browser. 
Constants
int INVALID_COLOR If the browser is not currently available INVALID_COLOR will be returned to indicate absence of a color.
Public Methods
abstract boolean canShowCards()
Indicates whether or not the top card can be animated.
abstract CardList getCardList()
An object belonging to the browser interface that maintains the list of cards currently in the card system.
abstract BrowserInterface.Footer getFooter()
Returns a reference to the browser footer.
abstract BrowserInterface.Header getHeader()
Returns a reference to the browser header.
abstract RelativeLayout getViewContainer()
A transparent view on top of the embedded browser content for displaying arbitrary views.
abstract void hideTopCard()
Hides the top card in the card list CardList.
abstract void navigateToUrl(String url)
Navigates the browser to a new URL.
abstract void reloadCards()
Reloads all cards in the CardList and re-renders any visible cards.
abstract void setBrowserChromeClient(BrowserChromeClient client)
abstract void showTopCard()
Shows the top card in the CardList over the browser content.

Constants

public static final int INVALID_COLOR

If the browser is not currently available INVALID_COLOR will be returned to indicate absence of a color.

Constant Value: -1 (0xffffffff)

Public Methods

public abstract boolean canShowCards ()

Indicates whether or not the top card can be animated. Call this method before attempting a call to showTopCard() or hideTopCard().

Returns
  • true if cards can be animated, false otherwise.

public abstract CardList getCardList ()

An object belonging to the browser interface that maintains the list of cards currently in the card system.

Returns
  • CardList The current list of cards in the system, or null if the browser is not currently available.

public abstract BrowserInterface.Footer getFooter ()

Returns a reference to the browser footer.

Returns
  • The browser footer.

public abstract BrowserInterface.Header getHeader ()

Returns a reference to the browser header.

Returns
  • The browser header.

public abstract RelativeLayout getViewContainer ()

A transparent view on top of the embedded browser content for displaying arbitrary views.

 ViewGroup viewContainer = getViewContainer();
 Context context = viewContainer.getContext();
 LayoutInflater.from(context).inflate(R.layout.my_custom_view, viewContainer);
 

The custom view must be inflated with the view container's context to avoid any memory leaks.

Returns
  • The browser view container overlay.

public abstract void hideTopCard ()

Hides the top card in the card list CardList. Call the method canShowCards() before attempting to call this method.

public abstract void navigateToUrl (String url)

Navigates the browser to a new URL. Use this api to navigate the browser to a new URL of the same domain. A url with a different domain should be opened by fetching and starting a new Purchase Path.

Parameters
url The url to be loaded in the browser.

public abstract void reloadCards ()

Reloads all cards in the CardList and re-renders any visible cards.

Call this method after modifying cards in the CardList to update the view.

public abstract void setBrowserChromeClient (BrowserChromeClient client)

public abstract void showTopCard ()

Shows the top card in the CardList over the browser content. Call the method canShowCards() before attempting to call this method.