EventInfo

@RequiresApi(value = 19)
public class EventInfo


Represents information associated with a logged event on SliceView.

Summary

Constants

static final int

Indicates the event was an interaction with a button.

static final int

Indicates the event was a tap on the entire row.

static final int

Indicates the event was a tap on a see more button.

static final int

Indicates the event was a selection from a selection row.

static final int

Indicates the event was an interaction with a slider.

static final int

Indicates the event was an interaction with a toggle.

static final int

Indicates the event was an interaction with a button positioned in a grid cell.

static final int

Indicates the event was an interaction with a button positioned at the end of the row, potentially grouped with other buttons.

static final int

Indicates the event was an interaction with a button positioned at the start of the row.

static final int

Indicates the row is represented in a grid template.

static final int

Indicates the row is represented in a list template.

static final int

Indicates the row is represented as a messaging template.

static final int

Indicates the row represents a progress indicator.

static final int

Indicates the row represents a selection (drop-down list).

static final int

Indicates the slice is represented as a shortcut.

static final int

Indicates the row represents an range input slider.

static final int

Indicates the row represents a toggleable item.

static final int

Indicates the state of a toggle is off.

static final int

Indicates the state of a toggle is on.

Public fields

int

Total number of actions available in this row of the slice.

int

If multiple buttons are presented in this actionPosition on the row, then this is the index of that button that was interacted with.

int

Position of the button on the template.

int

The type of action that occurred.

int

Index of the row that was interacted with in the slice.

int

The template type of the row that was interacted with in the slice.

int

The display mode of the slice being interacted with.

int

Represents the state after the event or -1 if not applicable for the event type.

Public constructors

EventInfo(
    int sliceMode,
    int actionType,
    int rowTemplateType,
    int rowIndex
)

Constructs an event info object with the required information for an event.

Public methods

void
setPosition(int actionPosition, int actionIndex, int actionCount)

Sets positional information for the event.

String

Constants

ACTION_TYPE_BUTTON

Added in 1.1.0-alpha02
public static final int ACTION_TYPE_BUTTON = 1

Indicates the event was an interaction with a button. Check actionPosition to see where on the card the button is placed.

ACTION_TYPE_CONTENT

Added in 1.1.0-alpha02
public static final int ACTION_TYPE_CONTENT = 3

Indicates the event was a tap on the entire row.

ACTION_TYPE_SEE_MORE

Added in 1.1.0-alpha02
public static final int ACTION_TYPE_SEE_MORE = 4

Indicates the event was a tap on a see more button.

ACTION_TYPE_SELECTION

Added in 1.1.0-alpha02
public static final int ACTION_TYPE_SELECTION = 5

Indicates the event was a selection from a selection row.

ACTION_TYPE_SLIDER

Added in 1.1.0-alpha02
public static final int ACTION_TYPE_SLIDER = 2

Indicates the event was an interaction with a slider. Check state to see the new state of the slider.

ACTION_TYPE_TOGGLE

Added in 1.1.0-alpha02
public static final int ACTION_TYPE_TOGGLE = 0

Indicates the event was an interaction with a toggle. Check state to see the new state of the toggle.

POSITION_CELL

Added in 1.1.0-alpha02
public static final int POSITION_CELL = 2

Indicates the event was an interaction with a button positioned in a grid cell.

POSITION_END

Added in 1.1.0-alpha02
public static final int POSITION_END = 1

Indicates the event was an interaction with a button positioned at the end of the row, potentially grouped with other buttons.

POSITION_START

Added in 1.1.0-alpha02
public static final int POSITION_START = 0

Indicates the event was an interaction with a button positioned at the start of the row.

ROW_TYPE_GRID

Added in 1.1.0-alpha02
public static final int ROW_TYPE_GRID = 1

Indicates the row is represented in a grid template.

ROW_TYPE_LIST

Added in 1.1.0-alpha02
public static final int ROW_TYPE_LIST = 0

Indicates the row is represented in a list template.

ROW_TYPE_MESSAGING

Added in 1.1.0-alpha02
public static final int ROW_TYPE_MESSAGING = 2

Indicates the row is represented as a messaging template.

ROW_TYPE_PROGRESS

Added in 1.1.0-alpha02
public static final int ROW_TYPE_PROGRESS = 5

Indicates the row represents a progress indicator.

ROW_TYPE_SELECTION

Added in 1.1.0-alpha02
public static final int ROW_TYPE_SELECTION = 6

Indicates the row represents a selection (drop-down list).

ROW_TYPE_SHORTCUT

Added in 1.1.0-alpha02
public static final int ROW_TYPE_SHORTCUT = -1

Indicates the slice is represented as a shortcut.

ROW_TYPE_SLIDER

Added in 1.1.0-alpha02
public static final int ROW_TYPE_SLIDER = 4

Indicates the row represents an range input slider.

ROW_TYPE_TOGGLE

Added in 1.1.0-alpha02
public static final int ROW_TYPE_TOGGLE = 3

Indicates the row represents a toggleable item.

STATE_OFF

Added in 1.1.0-alpha02
public static final int STATE_OFF = 0

Indicates the state of a toggle is off.

STATE_ON

Added in 1.1.0-alpha02
public static final int STATE_ON = 1

Indicates the state of a toggle is on.

Public fields

actionCount

Added in 1.1.0-alpha02
public int actionCount

Total number of actions available in this row of the slice.

If the actionPosition is POSITION_CELL the button is a cell within a grid row, and this is the number of cells in the row.

If the actionPosition is POSITION_END this is the number of buttons in the end position of this row.

actionIndex

Added in 1.1.0-alpha02
public int actionIndex

If multiple buttons are presented in this actionPosition on the row, then this is the index of that button that was interacted with. For total number of actions see actionCount.

If the actionPosition is POSITION_CELL the button is a cell within a grid, and this index would represent the cell position.

If the actionPosition is POSITION_END there might be other buttons in the end position, and this index would represent the position.

actionPosition

Added in 1.1.0-alpha02
public int actionPosition

Position of the button on the template. POSITION_STARTPOSITION_ENDPOSITION_CELL

actionType

Added in 1.1.0-alpha02
public int actionType

The type of action that occurred.

rowIndex

Added in 1.1.0-alpha02
public int rowIndex

Index of the row that was interacted with in the slice.

rowTemplateType

Added in 1.1.0-alpha02
public int rowTemplateType

The template type of the row that was interacted with in the slice.

sliceMode

Added in 1.1.0-alpha02
public int sliceMode

The display mode of the slice being interacted with.

state

Added in 1.1.0-alpha02
public int state

Represents the state after the event or -1 if not applicable for the event type.

For ACTION_TYPE_TOGGLE events, the state will be either STATE_OFF or STATE_ON.

For ACTION_TYPE_SLIDER events, the state will be a number representing the new position of the slider.

Public constructors

EventInfo

Added in 1.1.0-alpha02
public EventInfo(
    int sliceMode,
    int actionType,
    int rowTemplateType,
    int rowIndex
)

Constructs an event info object with the required information for an event.

Parameters
int sliceMode

The display mode of the slice interacted with.

int actionType

The type of action this event represents.

int rowTemplateType

The template type of the row interacted with.

int rowIndex

The index of the row that was interacted with in the slice.

Public methods

setPosition

Added in 1.1.0-alpha02
public void setPosition(int actionPosition, int actionIndex, int actionCount)

Sets positional information for the event.

Parameters
int actionPosition

The position of the button on the template.

int actionIndex

The index of that button that was interacted with.

int actionCount

The number of actions available in this group of buttons on the slice.

toString

public String toString()