Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.
added in version 1.0.0
belongs to Maven artifact androidx.slice:slice-view:1.0.0-rc01

EventInfo

public class EventInfo
extends Object

java.lang.Object
   ↳ androidx.slice.widget.EventInfo


Represents information associated with a logged event on SliceView.

Summary

Constants

int ACTION_TYPE_BUTTON

Indicates the event was an interaction with a button.

int ACTION_TYPE_CONTENT

Indicates the event was a tap on the entire row.

int ACTION_TYPE_SEE_MORE

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

int ACTION_TYPE_SLIDER

Indicates the event was an interaction with a slider.

int ACTION_TYPE_TOGGLE

Indicates the event was an interaction with a toggle.

int POSITION_CELL

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

int POSITION_END

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

int POSITION_START

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

int ROW_TYPE_GRID

Indicates the row is represented in a grid template.

int ROW_TYPE_LIST

Indicates the row is represented in a list template.

int ROW_TYPE_MESSAGING

Indicates the row is represented as a messaging template.

int ROW_TYPE_PROGRESS

Indicates the row represents a progress indicator.

int ROW_TYPE_SHORTCUT

Indicates the slice is represented as a shortcut.

int ROW_TYPE_SLIDER

Indicates the row represents an range input slider.

int ROW_TYPE_TOGGLE

Indicates the row represents a toggleable item.

int STATE_OFF

Indicates the state of a toggle is off.

int STATE_ON

Indicates the state of a toggle is on.

Fields

public int actionCount

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

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.

public int actionPosition

Position of the button on the template.

public int actionType

The type of action that occurred.

public int rowIndex

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

public int rowTemplateType

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

public int sliceMode

The display mode of the slice being interacted with.

public int state

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 toString()

Inherited methods

Constants

ACTION_TYPE_BUTTON

added in version 1.0.0
public static final int ACTION_TYPE_BUTTON

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

Constant Value: 1 (0x00000001)

ACTION_TYPE_CONTENT

added in version 1.0.0
public static final int ACTION_TYPE_CONTENT

Indicates the event was a tap on the entire row.

Constant Value: 3 (0x00000003)

ACTION_TYPE_SEE_MORE

added in version 1.0.0
public static final int ACTION_TYPE_SEE_MORE

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

Constant Value: 4 (0x00000004)

ACTION_TYPE_SLIDER

added in version 1.0.0
public static final int ACTION_TYPE_SLIDER

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

Constant Value: 2 (0x00000002)

ACTION_TYPE_TOGGLE

added in version 1.0.0
public static final int ACTION_TYPE_TOGGLE

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

Constant Value: 0 (0x00000000)

POSITION_CELL

added in version 1.0.0
public static final int POSITION_CELL

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

Constant Value: 2 (0x00000002)

POSITION_END

added in version 1.0.0
public static final int POSITION_END

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

Constant Value: 1 (0x00000001)

POSITION_START

added in version 1.0.0
public static final int POSITION_START

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

Constant Value: 0 (0x00000000)

ROW_TYPE_GRID

added in version 1.0.0
public static final int ROW_TYPE_GRID

Indicates the row is represented in a grid template.

Constant Value: 1 (0x00000001)

ROW_TYPE_LIST

added in version 1.0.0
public static final int ROW_TYPE_LIST

Indicates the row is represented in a list template.

Constant Value: 0 (0x00000000)

ROW_TYPE_MESSAGING

added in version 1.0.0
public static final int ROW_TYPE_MESSAGING

Indicates the row is represented as a messaging template.

Constant Value: 2 (0x00000002)

ROW_TYPE_PROGRESS

added in version 1.0.0
public static final int ROW_TYPE_PROGRESS

Indicates the row represents a progress indicator.

Constant Value: 5 (0x00000005)

ROW_TYPE_SHORTCUT

added in version 1.0.0
public static final int ROW_TYPE_SHORTCUT

Indicates the slice is represented as a shortcut.

Constant Value: -1 (0xffffffff)

ROW_TYPE_SLIDER

added in version 1.0.0
public static final int ROW_TYPE_SLIDER

Indicates the row represents an range input slider.

Constant Value: 4 (0x00000004)

ROW_TYPE_TOGGLE

added in version 1.0.0
public static final int ROW_TYPE_TOGGLE

Indicates the row represents a toggleable item.

Constant Value: 3 (0x00000003)

STATE_OFF

added in version 1.0.0
public static final int STATE_OFF

Indicates the state of a toggle is off.

Constant Value: 0 (0x00000000)

STATE_ON

added in version 1.0.0
public static final int STATE_ON

Indicates the state of a toggle is on.

Constant Value: 1 (0x00000001)

Fields

actionCount

added in version 1.0.0
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 version 1.0.0
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 version 1.0.0
public int actionPosition

Position of the button on the template. POSITION_START POSITION_END POSITION_CELL

actionType

added in version 1.0.0
public int actionType

The type of action that occurred.

rowIndex

added in version 1.0.0
public int rowIndex

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

rowTemplateType

added in version 1.0.0
public int rowTemplateType

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

sliceMode

added in version 1.0.0
public int sliceMode

The display mode of the slice being interacted with.

state

added in version 1.0.0
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 version 1.0.0
public EventInfo (int sliceMode, 
                int actionType, 
                int rowTemplateType, 
                int rowIndex)

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

Parameters
sliceMode int: The display mode of the slice interacted with.

actionType int: The type of action this event represents.

rowTemplateType int: The template type of the row interacted with.

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

Public methods

setPosition

added in version 1.0.0
public void setPosition (int actionPosition, 
                int actionIndex, 
                int actionCount)

Sets positional information for the event.

Parameters
actionPosition int: The position of the button on the template.

actionIndex int: The index of that button that was interacted with.

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

toString

public String toString ()

Returns
String