Slice
classSlice: Parcelable
kotlin.Any | |
↳ | android.app.slice.Slice |
A slice is a piece of app content and actions that can be surfaced outside of the app.
They are constructed using Builder
in a tree structure that provides the OS some information about how the content should be displayed.
Summary
Nested classes | |
---|---|
A Builder used to construct |
Constants | |
---|---|
static String |
Key to retrieve an extra added to an intent when the value of an input range is changed. |
static String |
Key to retrieve an extra added to an intent when a control is changed. |
static String |
Hint that this slice contains a number of actions that can be grouped together in a sort of controls area of the UI. |
static String |
A hint to indicate that this slice represents an error. |
static String |
Hint that list items within this slice or subslice would appear better if organized horizontally. |
static String |
A hint to indicate that the contents of this subslice represent a list of keywords related to the parent slice. |
static String |
Hint that this content is important and should be larger when displayed if possible. |
static String |
Hint indicating an item representing when the content was created or last updated. |
static String |
Hint that all sub-items/sub-slices within this content should be considered to have |
static String |
Hint that this item is part of a list and should be formatted as if is part of a list. |
static String |
Hint to indicate that this content should not be tinted. |
static String |
Hint to indicate that this slice is incomplete and an update will be sent once loading is complete. |
static String |
A hint to indicate that this slice represents a permission request for showing slices. |
static String |
A hint representing that this item should be used to indicate that there's more content associated with this slice. |
static String |
Hint indicating that this item (and its sub-items) are the current selection. |
static String |
Hint to indicate that this content should only be displayed if the slice is presented as a shortcut. |
static String |
Hint indicating this content should be shown instead of the normal content when the slice is in small format. |
static String |
Hint that this content is a title of other content in the slice. |
static String |
Hint indicating an item representing a time-to-live for the content. |
static String |
Subtype to tag an item as representing a color. |
static String |
Subtype to tag an item to use as a content description. |
static String |
Subtype to indicate that this item indicates the layout direction for content in the slice. |
static String |
Subtype to tag an item as representing the max int value for a |
static String |
Subtype to indicate that this is a message as part of a communication sequence in this slice. |
static String |
Subtype to tag an item as representing a time in milliseconds since midnight, January 1, 1970 UTC. |
static String |
Subtype to tag an item representing priority. |
static String |
Subtype to tag an item as representing a range. |
static String |
Subtype to tag the source (i.e. sender) of a |
static String |
Subtype to indicate that this content has a toggle action associated with it. |
static String |
Subtype to tag an item as representing the current int value for a |
Inherited constants | |
---|---|
Protected constructors | |
---|---|
Public methods | |
---|---|
Int | |
MutableList<String!>! |
getHints() |
MutableList<SliceItem!>! |
getItems() |
SliceSpec? |
getSpec() |
Uri! |
getUri() |
Boolean |
Returns whether the caller for this slice matters. |
Unit |
writeToParcel(dest: Parcel, flags: Int) |
Properties | |
---|---|
static Parcelable.Creator<Slice!> |
Constants
EXTRA_RANGE_VALUE
static valEXTRA_RANGE_VALUE: String
Deprecated: Deprecated in Java.
Key to retrieve an extra added to an intent when the value of an input range is changed.
Value: "android.app.slice.extra.RANGE_VALUE"
EXTRA_TOGGLE_STATE
static valEXTRA_TOGGLE_STATE: String
Deprecated: Deprecated in Java.
Key to retrieve an extra added to an intent when a control is changed.
Value: "android.app.slice.extra.TOGGLE_STATE"
HINT_ACTIONS
static valHINT_ACTIONS: String
Deprecated: Deprecated in Java.
Hint that this slice contains a number of actions that can be grouped together in a sort of controls area of the UI.
Value: "actions"
HINT_ERROR
static valHINT_ERROR: String
Deprecated: Deprecated in Java.
A hint to indicate that this slice represents an error.
Value: "error"
HINT_HORIZONTAL
static valHINT_HORIZONTAL: String
Deprecated: Deprecated in Java.
Hint that list items within this slice or subslice would appear better if organized horizontally.
Value: "horizontal"
HINT_KEYWORDS
static valHINT_KEYWORDS: String
Deprecated: Deprecated in Java.
A hint to indicate that the contents of this subslice represent a list of keywords related to the parent slice. Expected to be on an item of format SliceItem.FORMAT_SLICE
.
Value: "keywords"
HINT_LARGE
static valHINT_LARGE: String
Deprecated: Deprecated in Java.
Hint that this content is important and should be larger when displayed if possible.
Value: "large"
HINT_LAST_UPDATED
static valHINT_LAST_UPDATED: String
Deprecated: Deprecated in Java.
Hint indicating an item representing when the content was created or last updated.
Value: "last_updated"
HINT_LIST
static valHINT_LIST: String
Deprecated: Deprecated in Java.
Hint that all sub-items/sub-slices within this content should be considered to have HINT_LIST_ITEM
.
Value: "list"
HINT_LIST_ITEM
static valHINT_LIST_ITEM: String
Deprecated: Deprecated in Java.
Hint that this item is part of a list and should be formatted as if is part of a list.
Value: "list_item"
HINT_NO_TINT
static valHINT_NO_TINT: String
Deprecated: Deprecated in Java.
Hint to indicate that this content should not be tinted.
Value: "no_tint"
HINT_PARTIAL
static valHINT_PARTIAL: String
Deprecated: Deprecated in Java.
Hint to indicate that this slice is incomplete and an update will be sent once loading is complete. Slices which contain HINT_PARTIAL will not be cached by the OS and should not be cached by apps.
Value: "partial"
HINT_PERMISSION_REQUEST
static valHINT_PERMISSION_REQUEST: String
Deprecated: Deprecated in Java.
A hint to indicate that this slice represents a permission request for showing slices.
Value: "permission_request"
HINT_SEE_MORE
static valHINT_SEE_MORE: String
Deprecated: Deprecated in Java.
A hint representing that this item should be used to indicate that there's more content associated with this slice.
Value: "see_more"
HINT_SELECTED
static valHINT_SELECTED: String
Deprecated: Deprecated in Java.
Hint indicating that this item (and its sub-items) are the current selection.
Value: "selected"
HINT_SHORTCUT
static valHINT_SHORTCUT: String
Deprecated: Deprecated in Java.
Hint to indicate that this content should only be displayed if the slice is presented as a shortcut.
Value: "shortcut"
HINT_SUMMARY
static valHINT_SUMMARY: String
Deprecated: Deprecated in Java.
Hint indicating this content should be shown instead of the normal content when the slice is in small format.
Value: "summary"
HINT_TITLE
static valHINT_TITLE: String
Deprecated: Deprecated in Java.
Hint that this content is a title of other content in the slice. This can also indicate that the content should be used in the shortcut representation of the slice (icon, label, action), normally this should be indicated by adding the hint on the action containing that content.
Value: "title"
HINT_TTL
static valHINT_TTL: String
Deprecated: Deprecated in Java.
Hint indicating an item representing a time-to-live for the content.
Value: "ttl"
SUBTYPE_COLOR
static valSUBTYPE_COLOR: String
Deprecated: Deprecated in Java.
Subtype to tag an item as representing a color. Expected to be on an item of format SliceItem.FORMAT_INT
.
Value: "color"
SUBTYPE_CONTENT_DESCRIPTION
static valSUBTYPE_CONTENT_DESCRIPTION: String
Deprecated: Deprecated in Java.
Subtype to tag an item to use as a content description. Expected to be on an item of format SliceItem.FORMAT_TEXT
.
Value: "content_description"
SUBTYPE_LAYOUT_DIRECTION
static valSUBTYPE_LAYOUT_DIRECTION: String
Deprecated: Deprecated in Java.
Subtype to indicate that this item indicates the layout direction for content in the slice. Expected to be an item of format SliceItem.FORMAT_INT
.
Value: "layout_direction"
SUBTYPE_MAX
static valSUBTYPE_MAX: String
Deprecated: Deprecated in Java.
Subtype to tag an item as representing the max int value for a SUBTYPE_RANGE
. Expected to be on an item of format SliceItem.FORMAT_INT
.
Value: "max"
SUBTYPE_MESSAGE
static valSUBTYPE_MESSAGE: String
Deprecated: Deprecated in Java.
Subtype to indicate that this is a message as part of a communication sequence in this slice. Expected to be on an item of format SliceItem.FORMAT_SLICE
.
Value: "message"
SUBTYPE_MILLIS
static valSUBTYPE_MILLIS: String
Deprecated: Deprecated in Java.
Subtype to tag an item as representing a time in milliseconds since midnight, January 1, 1970 UTC.
Value: "millis"
SUBTYPE_PRIORITY
static valSUBTYPE_PRIORITY: String
Deprecated: Deprecated in Java.
Subtype to tag an item representing priority. Expected to be on an item of format SliceItem.FORMAT_INT
.
Value: "priority"
SUBTYPE_RANGE
static valSUBTYPE_RANGE: String
Deprecated: Deprecated in Java.
Subtype to tag an item as representing a range. Expected to be on an item of format SliceItem.FORMAT_SLICE
containing a SUBTYPE_VALUE
and possibly a SUBTYPE_MAX
.
Value: "range"
SUBTYPE_SOURCE
static valSUBTYPE_SOURCE: String
Deprecated: Deprecated in Java.
Subtype to tag the source (i.e. sender) of a SUBTYPE_MESSAGE
. Expected to be on an item of format SliceItem.FORMAT_TEXT
, SliceItem.FORMAT_IMAGE
or an SliceItem.FORMAT_SLICE
containing them.
Value: "source"
SUBTYPE_TOGGLE
static valSUBTYPE_TOGGLE: String
Deprecated: Deprecated in Java.
Subtype to indicate that this content has a toggle action associated with it. To indicate that the toggle is on, use HINT_SELECTED
. When the toggle state changes, the intent associated with it will be sent along with an extra EXTRA_TOGGLE_STATE
which can be retrieved to see the new state of the toggle.
Value: "toggle"
SUBTYPE_VALUE
static valSUBTYPE_VALUE: String
Deprecated: Deprecated in Java.
Subtype to tag an item as representing the current int value for a SUBTYPE_RANGE
. Expected to be on an item of format SliceItem.FORMAT_INT
.
Value: "value"
Protected constructors
Public methods
describeContents
fundescribeContents(): Int
Deprecated: Deprecated in Java.
Return | |
---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
getHints
fungetHints(): MutableList<String!>!
Deprecated: Deprecated in Java.
getItems
fungetItems(): MutableList<SliceItem!>!
Deprecated: Deprecated in Java.
Return | |
---|---|
MutableList<SliceItem!>! |
All child SliceItem s that this Slice contains. |
getSpec
fungetSpec(): SliceSpec?
Deprecated: Deprecated in Java.
Return | |
---|---|
SliceSpec? |
The spec for this slice This value may be null . |
getUri
fungetUri(): Uri!
Deprecated: Deprecated in Java.
Return | |
---|---|
Uri! |
The Uri that this Slice represents. |
isCallerNeeded
funisCallerNeeded(): Boolean
Deprecated: Deprecated in Java.
Returns whether the caller for this slice matters.
writeToParcel
funwriteToParcel(
dest: Parcel,
flags: Int
): Unit
Deprecated: Deprecated in Java.
Parameters | |
---|---|
dest |
Parcel: The Parcel in which the object should be written. This value cannot be null . |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE . Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |
Properties
CREATOR
static valCREATOR: Parcelable.Creator<Slice!>
Deprecated: Deprecated in Java.