EventInfo


@RequiresApi(value = 19)
class EventInfo


Represents information associated with a logged event on SliceView.

Summary

Constants

const Int

Indicates the event was an interaction with a button.

const Int

Indicates the event was a tap on the entire row.

const Int

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

const Int

Indicates the event was a selection from a selection row.

const Int

Indicates the event was an interaction with a slider.

const Int

Indicates the event was an interaction with a toggle.

const Int

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

const Int

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

const Int

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

const Int

Indicates the row is represented in a grid template.

const Int

Indicates the row is represented in a list template.

const Int

Indicates the row is represented as a messaging template.

const Int

Indicates the row represents a progress indicator.

const Int

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

const Int

Indicates the slice is represented as a shortcut.

const Int

Indicates the row represents an range input slider.

const Int

Indicates the row represents a toggleable item.

const Int

Indicates the state of a toggle is off.

const Int

Indicates the state of a toggle is on.

Public constructors

EventInfo(
    sliceMode: Int,
    actionType: Int,
    rowTemplateType: Int,
    rowIndex: Int
)

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

Public functions

Unit
setPosition(actionPosition: Int, actionIndex: Int, actionCount: Int)

Sets positional information for the event.

String!

Public properties

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.

Constants

ACTION_TYPE_BUTTON

Added in 1.1.0-alpha02
const val ACTION_TYPE_BUTTON = 1: Int

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
const val ACTION_TYPE_CONTENT = 3: Int

Indicates the event was a tap on the entire row.

ACTION_TYPE_SEE_MORE

Added in 1.1.0-alpha02
const val ACTION_TYPE_SEE_MORE = 4: Int

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

ACTION_TYPE_SELECTION

Added in 1.1.0-alpha02
const val ACTION_TYPE_SELECTION = 5: Int

Indicates the event was a selection from a selection row.

ACTION_TYPE_SLIDER

Added in 1.1.0-alpha02
const val ACTION_TYPE_SLIDER = 2: Int

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
const val ACTION_TYPE_TOGGLE = 0: Int

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
const val POSITION_CELL = 2: Int

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

POSITION_END

Added in 1.1.0-alpha02
const val POSITION_END = 1: Int

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
const val POSITION_START = 0: Int

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
const val ROW_TYPE_GRID = 1: Int

Indicates the row is represented in a grid template.

ROW_TYPE_LIST

Added in 1.1.0-alpha02
const val ROW_TYPE_LIST = 0: Int

Indicates the row is represented in a list template.

ROW_TYPE_MESSAGING

Added in 1.1.0-alpha02
const val ROW_TYPE_MESSAGING = 2: Int

Indicates the row is represented as a messaging template.

ROW_TYPE_PROGRESS

Added in 1.1.0-alpha02
const val ROW_TYPE_PROGRESS = 5: Int

Indicates the row represents a progress indicator.

ROW_TYPE_SELECTION

Added in 1.1.0-alpha02
const val ROW_TYPE_SELECTION = 6: Int

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

ROW_TYPE_SHORTCUT

Added in 1.1.0-alpha02
const val ROW_TYPE_SHORTCUT = -1: Int

Indicates the slice is represented as a shortcut.

ROW_TYPE_SLIDER

Added in 1.1.0-alpha02
const val ROW_TYPE_SLIDER = 4: Int

Indicates the row represents an range input slider.

ROW_TYPE_TOGGLE

Added in 1.1.0-alpha02
const val ROW_TYPE_TOGGLE = 3: Int

Indicates the row represents a toggleable item.

STATE_OFF

Added in 1.1.0-alpha02
const val STATE_OFF = 0: Int

Indicates the state of a toggle is off.

STATE_ON

Added in 1.1.0-alpha02
const val STATE_ON = 1: Int

Indicates the state of a toggle is on.

Public constructors

EventInfo

Added in 1.1.0-alpha02
EventInfo(
    sliceMode: Int,
    actionType: Int,
    rowTemplateType: Int,
    rowIndex: Int
)

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 functions

setPosition

Added in 1.1.0-alpha02
fun setPosition(actionPosition: Int, actionIndex: Int, actionCount: Int): Unit

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

fun toString(): String!

Public properties

actionCount

Added in 1.1.0-alpha02
val actionCountInt

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
val actionIndexInt

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
val actionPositionInt

Position of the button on the template. POSITION_STARTPOSITION_ENDPOSITION_CELL

actionType

Added in 1.1.0-alpha02
val actionTypeInt

The type of action that occurred.

rowIndex

Added in 1.1.0-alpha02
val rowIndexInt

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

rowTemplateType

Added in 1.1.0-alpha02
val rowTemplateTypeInt

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

sliceMode

Added in 1.1.0-alpha02
val sliceModeInt

The display mode of the slice being interacted with.

state

Added in 1.1.0-alpha02
val stateInt

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.