Register now for Android Dev Summit 2019!

Builder

class Builder
kotlin.Any
   ↳ androidx.media2.session.MediaLibraryService.LibraryParams.Builder

Builds LibraryParams.

Summary

Public constructors

Builds LibraryParams.

Public methods

MediaLibraryService.LibraryParams

Builds LibraryParams.

MediaLibraryService.LibraryParams.Builder
setExtras(@Nullable extras: Bundle?)

Set a bundle of extras, that browser and library session can understand each other.

MediaLibraryService.LibraryParams.Builder
setOffline(offline: Boolean)

Sets whether offline media items, which can be played without an internet connection.

MediaLibraryService.LibraryParams.Builder
setRecent(recent: Boolean)

Sets whether recently played media item.

MediaLibraryService.LibraryParams.Builder
setSuggested(suggested: Boolean)

Sets whether suggested media items.

Public constructors

<init>

Builder()

Builds LibraryParams.

Public methods

build

@NonNull fun build(): MediaLibraryService.LibraryParams

Builds LibraryParams.

Return
MediaLibraryService.LibraryParams: new LibraryParams

setExtras

@NonNull fun setExtras(@Nullable extras: Bundle?): MediaLibraryService.LibraryParams.Builder

Set a bundle of extras, that browser and library session can understand each other.

Parameters
extras Bundle?: The extras or null.
Return
MediaLibraryService.LibraryParams.Builder: this builder

setOffline

@NonNull fun setOffline(offline: Boolean): MediaLibraryService.LibraryParams.Builder

Sets whether offline media items, which can be played without an internet connection.

When the browser supplies LibraryParams with the true, library session is recommended to provide such media items. If so, the library session implementation must return the params with the true as well.

Parameters
offline Boolean: true for offline items. false otherwise.
Return
MediaLibraryService.LibraryParams.Builder: this builder

setRecent

@NonNull fun setRecent(recent: Boolean): MediaLibraryService.LibraryParams.Builder

Sets whether recently played media item.

When the browser supplies the LibraryParams with the true, library session is recommended to provide such media items. If so, the library session implementation must return the params with the true as well.

Parameters
recent Boolean: true for recent items. false otherwise.
Return
MediaLibraryService.LibraryParams.Builder: this builder

setSuggested

@NonNull fun setSuggested(suggested: Boolean): MediaLibraryService.LibraryParams.Builder

Sets whether suggested media items.

When the browser supplies LibraryParams with the true, library session is recommended to provide such media items. If so, the library session implementation must return the params with the true as well. The list of media items is considered ordered by relevance, first being the top suggestion.

Parameters
suggested Boolean: true for suggested items. false otherwise
Return
MediaLibraryService.LibraryParams.Builder: this builder