EventInfo

open class EventInfo
kotlin.Any
   ↳ androidx.slice.widget.EventInfo

Represents information associated with a logged event on SliceView.

Summary

Constants

static Int

Indicates the event was an interaction with a button.

static Int

Indicates the event was a tap on the entire row.

static Int

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

static Int

Indicates the event was a selection from a selection row.

static Int

Indicates the event was an interaction with a slider.

static Int

Indicates the event was an interaction with a toggle.

static Int

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

static Int

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

static Int

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

static Int

Indicates the row is represented in a grid template.

static Int

Indicates the row is represented in a list template.

static Int

Indicates the row is represented as a messaging template.

static Int

Indicates the row represents a progress indicator.

static Int

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

static Int

Indicates the slice is represented as a shortcut.

static Int

Indicates the row represents an range input slider.

static Int

Indicates the row represents a toggleable item.

static Int

Indicates the state of a toggle is off.

static Int

Indicates the state of a toggle is on.

Public constructors

<init>(sliceMode: Int, actionType: Int, rowTemplateType: Int, rowIndex: Int)

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

Public methods

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

Sets positional information for the event.

open String

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

static val ACTION_TYPE_BUTTON: Int

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

Value: 1

ACTION_TYPE_CONTENT

static val ACTION_TYPE_CONTENT: Int

Indicates the event was a tap on the entire row.

Value: 3

ACTION_TYPE_SEE_MORE

static val ACTION_TYPE_SEE_MORE: Int

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

Value: 4

ACTION_TYPE_SELECTION

static val ACTION_TYPE_SELECTION: Int

Indicates the event was a selection from a selection row.

Value: 5

ACTION_TYPE_SLIDER

static val ACTION_TYPE_SLIDER: Int

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

Value: 2

ACTION_TYPE_TOGGLE

static val ACTION_TYPE_TOGGLE: Int

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

Value: 0

POSITION_CELL

static val POSITION_CELL: Int

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

Value: 2

POSITION_END

static val POSITION_END: Int

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

Value: 1

POSITION_START

static val POSITION_START: Int

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

Value: 0

ROW_TYPE_GRID

static val ROW_TYPE_GRID: Int

Indicates the row is represented in a grid template.

Value: 1

ROW_TYPE_LIST

static val ROW_TYPE_LIST: Int

Indicates the row is represented in a list template.

Value: 0

ROW_TYPE_MESSAGING

static val ROW_TYPE_MESSAGING: Int

Indicates the row is represented as a messaging template.

Value: 2

ROW_TYPE_PROGRESS

static val ROW_TYPE_PROGRESS: Int

Indicates the row represents a progress indicator.

Value: 5

ROW_TYPE_SELECTION

static val ROW_TYPE_SELECTION: Int

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

Value: 6

ROW_TYPE_SHORTCUT

static val ROW_TYPE_SHORTCUT: Int

Indicates the slice is represented as a shortcut.

Value: -1

ROW_TYPE_SLIDER

static val ROW_TYPE_SLIDER: Int

Indicates the row represents an range input slider.

Value: 4

ROW_TYPE_TOGGLE

static val ROW_TYPE_TOGGLE: Int

Indicates the row represents a toggleable item.

Value: 3

STATE_OFF

static val STATE_OFF: Int

Indicates the state of a toggle is off.

Value: 0

STATE_ON

static val STATE_ON: Int

Indicates the state of a toggle is on.

Value: 1

Public constructors

<init>

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 methods

setPosition

open 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

open fun toString(): String

Properties

actionCount

var actionCount: Int

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

var actionIndex: Int

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

var actionPosition: Int

Position of the button on the template. POSITION_START POSITION_END POSITION_CELL

actionType

var actionType: Int

The type of action that occurred.

rowIndex

var rowIndex: Int

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

rowTemplateType

var rowTemplateType: Int

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

sliceMode

var sliceMode: Int

The display mode of the slice being interacted with.

state

var state: Int

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.