MediaPlaybackStyle.Builder


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 functions

MediaPlaybackStyle

Constructs the MediaPlaybackStyle defined by this builder.

MediaPlaybackStyle.Builder
setMediaAccentColor(mediaAccentColor: CarColor?)

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.

MediaPlaybackStyle.Builder
setProgressBarStrokeCap(progressBarStrokeCap: Int)

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

Public constructors

Builder

Added in 1.9.0-alpha02
Builder()

Returns an empty Builder instance.

Builder

Added in 1.9.0-alpha02
Builder(style: MediaPlaybackStyle)

Creates a new Builder, populated from the input MediaPlaybackStyle.

Public functions

build

Added in 1.9.0-alpha02
fun build(): MediaPlaybackStyle

Constructs the MediaPlaybackStyle defined by this builder.

setMediaAccentColor

Added in 1.9.0-alpha02
fun setMediaAccentColor(mediaAccentColor: CarColor?): 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.

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

setProgressBarStrokeCap

Added in 1.9.0-alpha02
fun setProgressBarStrokeCap(progressBarStrokeCap: Int): MediaPlaybackStyle.Builder

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.