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_SELECTION
Indicates the event was a selection from a selection row. |
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_SELECTION
Indicates the row represents a selection (drop-down list). |
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 |
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
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
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
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_SELECTION
public static final int ACTION_TYPE_SELECTION
Indicates the event was a selection from a selection row.
Constant Value: 5 (0x00000005)
ACTION_TYPE_SLIDER
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
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
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
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
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
public static final int ROW_TYPE_GRID
Indicates the row is represented in a grid template.
Constant Value: 1 (0x00000001)
ROW_TYPE_LIST
public static final int ROW_TYPE_LIST
Indicates the row is represented in a list template.
Constant Value: 0 (0x00000000)
ROW_TYPE_MESSAGING
public static final int ROW_TYPE_MESSAGING
Indicates the row is represented as a messaging template.
Constant Value: 2 (0x00000002)
ROW_TYPE_PROGRESS
public static final int ROW_TYPE_PROGRESS
Indicates the row represents a progress indicator.
Constant Value: 5 (0x00000005)
ROW_TYPE_SELECTION
public static final int ROW_TYPE_SELECTION
Indicates the row represents a selection (drop-down list).
Constant Value: 6 (0x00000006)
ROW_TYPE_SHORTCUT
public static final int ROW_TYPE_SHORTCUT
Indicates the slice is represented as a shortcut.
Constant Value: -1 (0xffffffff)
ROW_TYPE_SLIDER
public static final int ROW_TYPE_SLIDER
Indicates the row represents an range input slider.
Constant Value: 4 (0x00000004)
ROW_TYPE_TOGGLE
public static final int ROW_TYPE_TOGGLE
Indicates the row represents a toggleable item.
Constant Value: 3 (0x00000003)
STATE_OFF
public static final int STATE_OFF
Indicates the state of a toggle is off.
Constant Value: 0 (0x00000000)
STATE_ON
public static final int STATE_ON
Indicates the state of a toggle is on.
Constant Value: 1 (0x00000001)
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_START
POSITION_END
POSITION_CELL
actionType
public int actionType
The type of action that occurred.
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 | |
---|---|
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
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 |