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 |
POSITION_CELL = 2Indicates the event was an interaction with a button positioned in a grid cell. |
static final int |
POSITION_END = 1Indicates the event was an interaction with a button positioned at the end of the row, potentially grouped with other buttons. |
static final int |
POSITION_START = 0Indicates the event was an interaction with a button positioned at the start of the row. |
static final int |
ROW_TYPE_GRID = 1Indicates the row is represented in a grid template. |
static final int |
ROW_TYPE_LIST = 0Indicates 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 |
ROW_TYPE_SHORTCUT = -1Indicates the slice is represented as a shortcut. |
static final int |
ROW_TYPE_SLIDER = 4Indicates the row represents an range input slider. |
static final int |
ROW_TYPE_TOGGLE = 3Indicates the row represents a toggleable item. |
static final int |
STATE_OFF = 0Indicates the state of a toggle is off. |
static final int |
STATE_ON = 1Indicates 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 |
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(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() |
Constants
ACTION_TYPE_BUTTON
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
public static final int ACTION_TYPE_CONTENT = 3
Indicates the event was a tap on the entire row.
ACTION_TYPE_SEE_MORE
public static final int ACTION_TYPE_SEE_MORE = 4
Indicates the event was a tap on a see more button.
ACTION_TYPE_SELECTION
public static final int ACTION_TYPE_SELECTION = 5
Indicates the event was a selection from a selection row.
ACTION_TYPE_SLIDER
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
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
public static final int POSITION_CELL = 2
Indicates the event was an interaction with a button positioned in a grid cell.
POSITION_END
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
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
public static final int ROW_TYPE_GRID = 1
Indicates the row is represented in a grid template.
ROW_TYPE_LIST
public static final int ROW_TYPE_LIST = 0
Indicates the row is represented in a list template.
ROW_TYPE_MESSAGING
public static final int ROW_TYPE_MESSAGING = 2
Indicates the row is represented as a messaging template.
ROW_TYPE_PROGRESS
public static final int ROW_TYPE_PROGRESS = 5
Indicates the row represents a progress indicator.
ROW_TYPE_SELECTION
public static final int ROW_TYPE_SELECTION = 6
Indicates the row represents a selection (drop-down list).
ROW_TYPE_SHORTCUT
public static final int ROW_TYPE_SHORTCUT = -1
Indicates the slice is represented as a shortcut.
ROW_TYPE_SLIDER
public static final int ROW_TYPE_SLIDER = 4
Indicates the row represents an range input slider.
ROW_TYPE_TOGGLE
public static final int ROW_TYPE_TOGGLE = 3
Indicates the row represents a toggleable item.
STATE_OFF
public static final int STATE_OFF = 0
Indicates the state of a toggle is off.
STATE_ON
public static final int STATE_ON = 1
Indicates the state of a toggle is on.
Public fields
actionCount
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
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
public int actionPosition
Position of the button on the template. POSITION_STARTPOSITION_ENDPOSITION_CELL
rowIndex
public int rowIndex
Index of the row that was interacted with in the slice.
rowTemplateType
public int rowTemplateType
The template type of the row that was interacted with in the slice.
sliceMode
public int sliceMode
The display mode of the slice being interacted with.
state
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
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
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. |