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 |
POSITION_CELL = 2Indicates the event was an interaction with a button positioned in a grid cell. |
const Int |
POSITION_END = 1Indicates the event was an interaction with a button positioned at the end of the row, potentially grouped with other buttons. |
const Int |
POSITION_START = 0Indicates the event was an interaction with a button positioned at the start of the row. |
const Int |
ROW_TYPE_GRID = 1Indicates the row is represented in a grid template. |
const Int |
ROW_TYPE_LIST = 0Indicates 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 |
ROW_TYPE_SHORTCUT = -1Indicates the slice is represented as a shortcut. |
const Int |
ROW_TYPE_SLIDER = 4Indicates the row represents an range input slider. |
const Int |
ROW_TYPE_TOGGLE = 3Indicates the row represents a toggleable item. |
const Int |
STATE_OFF = 0Indicates the state of a toggle is off. |
const Int |
STATE_ON = 1Indicates the state of a toggle is on. |
Public constructors |
|---|
|
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! |
toString() |
Public properties |
|
|---|---|
Int |
Total number of actions available in this row of the slice. |
Int |
If multiple buttons are presented in this |
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
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
const val ACTION_TYPE_CONTENT = 3: Int
Indicates the event was a tap on the entire row.
ACTION_TYPE_SEE_MORE
const val ACTION_TYPE_SEE_MORE = 4: Int
Indicates the event was a tap on a see more button.
ACTION_TYPE_SELECTION
const val ACTION_TYPE_SELECTION = 5: Int
Indicates the event was a selection from a selection row.
ACTION_TYPE_SLIDER
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
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
const val POSITION_CELL = 2: Int
Indicates the event was an interaction with a button positioned in a grid cell.
POSITION_END
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
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
const val ROW_TYPE_GRID = 1: Int
Indicates the row is represented in a grid template.
ROW_TYPE_LIST
const val ROW_TYPE_LIST = 0: Int
Indicates the row is represented in a list template.
ROW_TYPE_MESSAGING
const val ROW_TYPE_MESSAGING = 2: Int
Indicates the row is represented as a messaging template.
ROW_TYPE_PROGRESS
const val ROW_TYPE_PROGRESS = 5: Int
Indicates the row represents a progress indicator.
ROW_TYPE_SELECTION
const val ROW_TYPE_SELECTION = 6: Int
Indicates the row represents a selection (drop-down list).
ROW_TYPE_SHORTCUT
const val ROW_TYPE_SHORTCUT = -1: Int
Indicates the slice is represented as a shortcut.
ROW_TYPE_SLIDER
const val ROW_TYPE_SLIDER = 4: Int
Indicates the row represents an range input slider.
ROW_TYPE_TOGGLE
const val ROW_TYPE_TOGGLE = 3: Int
Indicates the row represents a toggleable item.
STATE_OFF
const val STATE_OFF = 0: Int
Indicates the state of a toggle is off.
Public constructors
Public functions
setPosition
fun setPosition(actionPosition: Int, actionIndex: Int, actionCount: Int): Unit
Sets positional information for the event.
Public properties
actionCount
val 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
val 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
val actionPosition: Int
Position of the button on the template. POSITION_STARTPOSITION_ENDPOSITION_CELL
rowIndex
val rowIndex: Int
Index of the row that was interacted with in the slice.
rowTemplateType
val rowTemplateType: Int
The template type of the row that was interacted with in the slice.
sliceMode
val sliceMode: Int
The display mode of the slice being interacted with.
state
val 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.