public class

Slice.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.slice.Slice.Builder

Overview

A Builder used to construct Slices

Summary

Constructors
publicBuilder(Uri uri)

Create a builder which will construct a Slice for the Given Uri.

Methods
public Slice.BuilderaddAction(PendingIntent action, Slice s, java.lang.String subType)

Add an action to the slice being constructed

public Slice.BuilderaddHints(java.util.List<java.lang.String> hints)

Add hints to the Slice being constructed

public Slice.BuilderaddHints(java.lang.String hints[])

Add hints to the Slice being constructed

public Slice.BuilderaddIcon(IconCompat icon, java.lang.String subType, java.util.List<java.lang.String> hints)

Add an image to the slice being constructed

public Slice.BuilderaddIcon(IconCompat icon, java.lang.String subType, java.lang.String hints[])

Add an image to the slice being constructed

public Slice.BuilderaddInt(int value, java.lang.String subType, java.util.List<java.lang.String> hints)

Add a int to the slice being constructed

public Slice.BuilderaddInt(int value, java.lang.String subType, java.lang.String hints[])

Add a int to the slice being constructed

public Slice.BuilderaddItem(SliceItem item)

Add a SliceItem to the slice being constructed.

public Slice.BuilderaddLong(long time, java.lang.String subType, java.util.List<java.lang.String> hints)

Add a long to the slice being constructed

public Slice.BuilderaddLong(long time, java.lang.String subType, java.lang.String hints[])

Add a long to the slice being constructed

public Slice.BuilderaddRemoteInput(RemoteInput remoteInput, java.lang.String subType, java.util.List<java.lang.String> hints)

Add remote input to the slice being constructed

public Slice.BuilderaddRemoteInput(RemoteInput remoteInput, java.lang.String subType, java.lang.String hints[])

Add remote input to the slice being constructed

public Slice.BuilderaddSubSlice(Slice slice)

Add a sub-slice to the slice being constructed

public Slice.BuilderaddSubSlice(Slice slice, java.lang.String subType)

Add a sub-slice to the slice being constructed

public Slice.BuilderaddText(java.lang.CharSequence text, java.lang.String subType, java.util.List<java.lang.String> hints)

Add text to the slice being constructed

public Slice.BuilderaddText(java.lang.CharSequence text, java.lang.String subType, java.lang.String hints[])

Add text to the slice being constructed

public Slice.BuilderaddTimestamp(long time, java.lang.String subType, java.util.List<java.lang.String> hints)

Add a timestamp to the slice being constructed

public Slice.BuilderaddTimestamp(long time, java.lang.String subType, java.lang.String hints[])

Add a timestamp to the slice being constructed

public Slicebuild()

Construct the slice.

public Slice.BuildersetSpec(SliceSpec spec)

Add the spec for this slice.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder(Uri uri)

Create a builder which will construct a Slice for the Given Uri.

Parameters:

uri: Uri to tag for this slice.

Methods

public Slice.Builder setSpec(SliceSpec spec)

Add the spec for this slice.

public Slice.Builder addHints(java.lang.String hints[])

Add hints to the Slice being constructed

public Slice.Builder addHints(java.util.List<java.lang.String> hints)

Add hints to the Slice being constructed

public Slice.Builder addSubSlice(Slice slice)

Add a sub-slice to the slice being constructed

public Slice.Builder addSubSlice(Slice slice, java.lang.String subType)

Add a sub-slice to the slice being constructed

Parameters:

subType: Optional template-specific type information

See also: SliceItem.getSubType()

public Slice.Builder addAction(PendingIntent action, Slice s, java.lang.String subType)

Add an action to the slice being constructed

Parameters:

subType: Optional template-specific type information

See also: SliceItem.getSubType()

public Slice.Builder addText(java.lang.CharSequence text, java.lang.String subType, java.lang.String hints[])

Add text to the slice being constructed

Parameters:

subType: Optional template-specific type information

See also: SliceItem.getSubType()

public Slice.Builder addText(java.lang.CharSequence text, java.lang.String subType, java.util.List<java.lang.String> hints)

Add text to the slice being constructed

Parameters:

subType: Optional template-specific type information

See also: SliceItem.getSubType()

public Slice.Builder addIcon(IconCompat icon, java.lang.String subType, java.lang.String hints[])

Add an image to the slice being constructed

Parameters:

subType: Optional template-specific type information

See also: SliceItem.getSubType()

public Slice.Builder addIcon(IconCompat icon, java.lang.String subType, java.util.List<java.lang.String> hints)

Add an image to the slice being constructed

Parameters:

subType: Optional template-specific type information

See also: SliceItem.getSubType()

public Slice.Builder addRemoteInput(RemoteInput remoteInput, java.lang.String subType, java.util.List<java.lang.String> hints)

Add remote input to the slice being constructed

Parameters:

subType: Optional template-specific type information

See also: SliceItem.getSubType()

public Slice.Builder addRemoteInput(RemoteInput remoteInput, java.lang.String subType, java.lang.String hints[])

Add remote input to the slice being constructed

Parameters:

subType: Optional template-specific type information

See also: SliceItem.getSubType()

public Slice.Builder addInt(int value, java.lang.String subType, java.lang.String hints[])

Add a int to the slice being constructed

Parameters:

subType: Optional template-specific type information

See also: SliceItem.getSubType()

public Slice.Builder addInt(int value, java.lang.String subType, java.util.List<java.lang.String> hints)

Add a int to the slice being constructed

Parameters:

subType: Optional template-specific type information

See also: SliceItem.getSubType()

public Slice.Builder addLong(long time, java.lang.String subType, java.lang.String hints[])

Add a long to the slice being constructed

Parameters:

subType: Optional template-specific type information

See also: SliceItem.getSubType()

public Slice.Builder addLong(long time, java.lang.String subType, java.util.List<java.lang.String> hints)

Add a long to the slice being constructed

Parameters:

subType: Optional template-specific type information

See also: SliceItem.getSubType()

public Slice.Builder addTimestamp(long time, java.lang.String subType, java.lang.String hints[])

Deprecated: TO BE REMOVED

Add a timestamp to the slice being constructed

Parameters:

subType: Optional template-specific type information

See also: SliceItem.getSubType()

public Slice.Builder addTimestamp(long time, java.lang.String subType, java.util.List<java.lang.String> hints)

Add a timestamp to the slice being constructed

Parameters:

subType: Optional template-specific type information

See also: SliceItem.getSubType()

public Slice.Builder addItem(SliceItem item)

Add a SliceItem to the slice being constructed.

public Slice build()

Construct the slice.