PlaceAction

public abstract class PlaceAction


A place action that defines a button on the place details widget.

Summary

Nested types

public abstract class PlaceAction.Builder

Builder for PlaceAction.

Callback for when the action button is clicked.

public enum PlaceAction.Style

Which style tokens to use for the button background.

Constants

static final PlaceAction

An action button that calls the place.

static final PlaceAction

An action button that opens directions to the place in Google Maps.

static final PlaceAction

An action button that opens the place in a map application.

static final PlaceAction

An action button that opens the website of the place.

Public constructors

Public methods

static PlaceAction.Builder
builder(
    @StringRes int labelTextResId,
    PlaceAction.OnClickListener onClickListener
)

Builder for PlaceAction.

abstract PlaceAction.Style

The style of the button.

abstract @StringRes int

The content description of the button.

abstract @DrawableRes int

The icon to be displayed on the button.

abstract @StringRes int

The text to be displayed on the button.

abstract PlaceAction.OnClickListener

The callback to be invoked when the button is clicked.

abstract PlaceAction.Builder

Returns a builder initialized with the current values of this PlaceAction.

Constants

CALL

public static final PlaceAction CALL

An action button that calls the place.

This action comes with a pre-configured default click behavior.

OPEN_DIRECTIONS

public static final PlaceAction OPEN_DIRECTIONS

An action button that opens directions to the place in Google Maps.

This action comes with a pre-configured default click behavior.

OPEN_IN_MAPS

public static final PlaceAction OPEN_IN_MAPS

An action button that opens the place in a map application.

This action comes with a pre-configured default click behavior.

OPEN_WEBSITE

public static final PlaceAction OPEN_WEBSITE

An action button that opens the website of the place.

This action comes with a pre-configured default click behavior.

Public constructors

PlaceAction

public PlaceAction()

Public methods

builder

public static PlaceAction.Builder builder(
    @StringRes int labelTextResId,
    PlaceAction.OnClickListener onClickListener
)

Builder for PlaceAction.

Parameters
@StringRes int labelTextResId

The text to be displayed on the button.

PlaceAction.OnClickListener onClickListener

The callback to be invoked when the button is clicked.

getButtonStyle

public abstract PlaceAction.Style getButtonStyle()

The style of the button. The default is SECONDARY.

getContentDescriptionResId

public abstract @StringRes int getContentDescriptionResId()

The content description of the button. The default is 0, which is no content description.

getIconResId

public abstract @DrawableRes int getIconResId()

The icon to be displayed on the button. The default is 0, which is no icon.

getLabelTextResId

public abstract @StringRes int getLabelTextResId()

The text to be displayed on the button.

getOnClickListener

public abstract PlaceAction.OnClickListener getOnClickListener()

The callback to be invoked when the button is clicked.

toBuilder

public abstract PlaceAction.Builder toBuilder()

Returns a builder initialized with the current values of this PlaceAction.