SliceMetadata

public class SliceMetadata
extends Object

java.lang.Object
   ↳ androidx.slice.SliceMetadata


Utility class to parse a Slice and provide access to information around its contents.

Summary

Constants

int LOADED_ALL

Indicates this slice has fully loaded and is not waiting for other content.

int LOADED_NONE

Indicates this slice is empty and waiting for content to be loaded.

int LOADED_PARTIAL

Indicates this slice has some content but is waiting for other content to be loaded.

Public methods

static SliceMetadata from(Context context, Slice slice)

Create a SliceMetadata object to provide access to some information around the slice and its contents.

long getExpiry()

A slice contains an expiry to indicate when the content in the slice might no longer be valid.

int getHeaderType()
Bundle getHostExtras()
PendingIntent getInputRangeAction()

Gets the input range action associated with the header of this slice, if it exists.

long getLastUpdatedTime()
int getLoadingState()
SliceAction getPrimaryAction()
Pair<Integer, Integer> getRange()

Gets the range information associated with a progress bar or input range associated with this slice, if it exists.

int getRangeValue()

Gets the current value for a progress bar or input range associated with this slice, if it exists, -1 if unknown.

List<SliceAction> getSliceActions()
List<String> getSliceKeywords()
CharSequence getSubtitle()
CharSequence getSummary()
CharSequence getTitle()
List<SliceAction> getToggles()
boolean