SliceItem
class SliceItem : Parcelable
kotlin.Any | |
↳ | android.app.slice.SliceItem |
A SliceItem is a single unit in the tree structure of a Slice
. A SliceItem a piece of content and some hints about what that content means or how it should be displayed. The types of content can be:
FORMAT_SLICE
FORMAT_TEXT
FORMAT_IMAGE
FORMAT_ACTION
FORMAT_INT
FORMAT_LONG
FORMAT_REMOTE_INPUT
FORMAT_BUNDLE
SliceItem
are a set of strings which annotate the content. The hints that are guaranteed to be understood by the system are defined on Slice
.
Summary
Constants | |
---|---|
static String |
A |
static String | |
static String | |
static String |
A |
static String |
A |
static String |
A |
static String | |
static String |
A |
Inherited constants | |
---|---|
Public methods | |
---|---|
Int | |
PendingIntent! | |
Bundle! | |
String! |
Get the format of this SliceItem. |
MutableList<String!> |
getHints() Gets all hints associated with this SliceItem. |
Icon! |
getIcon() |
Int |
getInt() |
Long |
getLong() |
RemoteInput! | |
Slice! |
getSlice() |
String! |
Get the sub-type of this SliceItem. |
CharSequence! |
getText() |
Boolean | |
Unit |
writeToParcel(dest: Parcel, flags: Int) |
Properties | |
---|---|
static Parcelable.Creator<SliceItem!> |
Constants
FORMAT_ACTION
static val FORMAT_ACTION: String
A SliceItem
that contains a PendingIntent
Note: Actions contain 2 pieces of data, In addition to the pending intent, the item contains a Slice
that the action applies to.
Value: "action"
FORMAT_BUNDLE
static val FORMAT_BUNDLE: String
A SliceItem
that contains a Bundle
.
Value: "bundle"
FORMAT_IMAGE
static val FORMAT_IMAGE: String
A SliceItem
that contains an Icon
Value: "image"
FORMAT_INT
static val FORMAT_INT: String
A SliceItem
that contains an int.
Value: "int"
FORMAT_LONG
static val FORMAT_LONG: String
A SliceItem
that contains a long.
Value: "long"
FORMAT_REMOTE_INPUT
static val FORMAT_REMOTE_INPUT: String
A SliceItem
that contains a RemoteInput
.
Value: "input"
FORMAT_SLICE
static val FORMAT_SLICE: String
A SliceItem
that contains a Slice
Value: "slice"
FORMAT_TEXT
static val FORMAT_TEXT: String
A SliceItem
that contains a CharSequence
Value: "text"
Public methods
describeContents
fun describeContents(): Int
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 |
getAction
fun getAction(): PendingIntent!
Return | |
---|---|
PendingIntent! |
The pending intent held by this FORMAT_ACTION SliceItem |
getBundle
fun getBundle(): Bundle!
Return | |
---|---|
Bundle! |
The parcelable held by this FORMAT_BUNDLE SliceItem |
getFormat
fun getFormat(): String!
Get the format of this SliceItem.
The format will be one of the following types supported by the platform:
FORMAT_SLICE
FORMAT_TEXT
FORMAT_IMAGE
FORMAT_ACTION
FORMAT_INT
FORMAT_LONG
FORMAT_REMOTE_INPUT
FORMAT_BUNDLE
See Also
getHints
fun getHints(): MutableList<String!>
Gets all hints associated with this SliceItem.
getIcon
fun getIcon(): Icon!
Return | |
---|---|
Icon! |
The icon held by this FORMAT_IMAGE SliceItem |
getInt
fun getInt(): Int
Return | |
---|---|
Int |
The color held by this FORMAT_INT SliceItem |
getLong
fun getLong(): Long
Return | |
---|---|
Long |
The long held by this FORMAT_LONG SliceItem |
getRemoteInput
fun getRemoteInput(): RemoteInput!
Return | |
---|---|
RemoteInput! |
The remote input held by this FORMAT_REMOTE_INPUT SliceItem |
getSlice
fun getSlice(): Slice!
Return | |
---|---|
Slice! |
The slice held by this FORMAT_ACTION or FORMAT_SLICE SliceItem |
getSubType
fun getSubType(): String!
Get the sub-type of this SliceItem.
Subtypes provide additional information about the type of this information beyond basic interpretations inferred by getFormat()
. For example a slice may contain many FORMAT_TEXT
items, but only some of them may be Slice#SUBTYPE_MESSAGE
.
See Also
getText
fun getText(): CharSequence!
Return | |
---|---|
CharSequence! |
The text held by this FORMAT_TEXT SliceItem |
hasHint
fun hasHint(hint: String!): Boolean
Return | |
---|---|
Boolean |
true if this item contains the given hint |
writeToParcel
fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
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 |