MediaLibraryService.LibraryParams.Builder

Added in 1.0.0
Deprecated in 1.3.0

public final class MediaLibraryService.LibraryParams.Builder


Builds a LibraryParams.

Summary

Public constructors

Public methods

@NonNull MediaLibraryService.LibraryParams

Builds a LibraryParams.

@NonNull MediaLibraryService.LibraryParams.Builder

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

@NonNull MediaLibraryService.LibraryParams.Builder
setOffline(boolean offline)

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

@NonNull MediaLibraryService.LibraryParams.Builder
setRecent(boolean recent)

Sets whether recently played media item.

@NonNull MediaLibraryService.LibraryParams.Builder
setSuggested(boolean suggested)

Sets whether suggested media items.

Public constructors

Builder

Added in 1.0.0
Deprecated in 1.3.0
public Builder()

Public methods

build

Added in 1.0.0
Deprecated in 1.3.0
public @NonNull MediaLibraryService.LibraryParams build()

Builds a LibraryParams.

Returns
@NonNull MediaLibraryService.LibraryParams

new LibraryParams

setExtras

Added in 1.0.0
Deprecated in 1.3.0
public @NonNull MediaLibraryService.LibraryParams.Builder setExtras(@Nullable Bundle extras)

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

Parameters
@Nullable Bundle extras

The extras or null.

setOffline

Added in 1.0.0
Deprecated in 1.3.0
public @NonNull MediaLibraryService.LibraryParams.Builder setOffline(boolean offline)

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
boolean offline

true for offline items. false otherwise.

setRecent

Added in 1.0.0
Deprecated in 1.3.0
public @NonNull MediaLibraryService.LibraryParams.Builder setRecent(boolean recent)

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
boolean recent

true for recent items. false otherwise.

setSuggested

Added in 1.0.0
Deprecated in 1.3.0
public @NonNull MediaLibraryService.LibraryParams.Builder setSuggested(boolean suggested)

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
boolean suggested

true for suggested items. false otherwise