public final class

Status.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.wear.ongoing.Status.Builder

Overview

Helper to Build OngoingActivityStatus instances. Templates can be specified, to specify how to render the parts and any surrounding text/format. If no template is specified, a default template that concatenates all parts separated by space is used.

Summary

Constructors
publicBuilder()

Methods
public Status.BuilderaddPart(java.lang.String name, Status.Part part)

Add a part to be inserted in the placeholders.

public Status.BuilderaddTemplate(java.lang.CharSequence template)

Add a template to use for this status.

public Statusbuild()

Build an OngoingActivityStatus with the given parameters.

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

Constructors

public Builder()

Methods

public Status.Builder addTemplate(java.lang.CharSequence template)

Add a template to use for this status. Placeholders can be defined with #name# To produce a '#', use '##' in the template. If multiple templates are specified, the first one (in the order they where added by calling this method) that has all required fields is used. If no template is specified, a default template that concatenates all parts separated by space is used.

Parameters:

template: the template to be added

Returns:

this builder, to chain calls.

public Status.Builder addPart(java.lang.String name, Status.Part part)

Add a part to be inserted in the placeholders.

Parameters:

name: the name of this part. In the template, use this name surrounded by '#' to reference it, e.g. here "track" and in the template "#track#"
part: The part that will be rendered in the specified position/s in the template.

Returns:

this builder, to chain calls.

public Status build()

Build an OngoingActivityStatus with the given parameters.

Returns:

the built OngoingActivityStatus