MediaPlaybackStyle.Builder


public final class MediaPlaybackStyle.Builder


A builder of MediaPlaybackStyle.

Summary

Public constructors

Returns an empty Builder instance.

Creates a new Builder, populated from the input MediaPlaybackStyle.

Public methods

@NonNull MediaPlaybackStyle

Constructs the MediaPlaybackStyle defined by this builder.

@NonNull MediaPlaybackStyle.Builder

Sets the custom accent CarColor for media interactive controls (such as the play/pause button container and seekbar track) or null to use default host styling.

@NonNull MediaPlaybackStyle.Builder
setProgressBarStrokeCap(int progressBarStrokeCap)

Sets the StrokeCap shape for the playback progress bar displayed in the media template.

Public constructors

Builder

Added in 1.9.0-alpha02
public Builder()

Returns an empty Builder instance.

Builder

Added in 1.9.0-alpha02
public Builder(@NonNull MediaPlaybackStyle style)

Creates a new Builder, populated from the input MediaPlaybackStyle.

Public methods

build

Added in 1.9.0-alpha02
public @NonNull MediaPlaybackStyle build()

Constructs the MediaPlaybackStyle defined by this builder.

setMediaAccentColor

Added in 1.9.0-alpha02
public @NonNull MediaPlaybackStyle.Builder setMediaAccentColor(@Nullable CarColor mediaAccentColor)

Sets the custom accent CarColor for media interactive controls (such as the play/pause button container and seekbar track) or null to use default host styling.

Defaults to null, which means default host styling or album art palette color extraction is used.

setProgressBarStrokeCap

Added in 1.9.0-alpha02
public @NonNull MediaPlaybackStyle.Builder setProgressBarStrokeCap(int progressBarStrokeCap)

Sets the StrokeCap shape for the playback progress bar displayed in the media template.

The playback progress bar reflects the playback state and progress of the active android.media.session.MediaSession / android.support.v4.media.session.MediaSessionCompat.

Defaults to DEFAULT, which means the host will use default system shape styling.