限定符和类型 | 方法和说明 |
---|---|
MusicItem |
build() |
MusicItem.Builder |
setAlbum(java.lang.String album)
设置歌曲的专辑(NonNull)。
|
MusicItem.Builder |
setArtist(java.lang.String artist)
设置歌曲的艺术家(NonNull)。
|
MusicItem.Builder |
setDuration(int duration)
设置歌曲的持续时间(播放时长)。
|
MusicItem.Builder |
setExtra(android.os.Bundle extra)
设置 MusicItem 携带的额外数据。
|
MusicItem.Builder |
setForbidSeek(boolean forbidSeek)
设置是否禁用 seekTo 操作。
|
MusicItem.Builder |
setIconUri(java.lang.String iconUri)
设置歌曲图标的 Uri(NonNull)。
|
MusicItem.Builder |
setMusicId(java.lang.String musicId)
设置歌曲的 music id(NonNull)。
|
MusicItem.Builder |
setTitle(java.lang.String title)
设置歌曲的标题。
|
MusicItem.Builder |
setUri(java.lang.String uri)
设置歌曲的 Uri(NonNull)。
|
public MusicItem.Builder setMusicId(@NonNull java.lang.String musicId)
musicId
- 要设置的值(NonNull)public MusicItem.Builder setTitle(@NonNull java.lang.String title)
title
- 要设置的标题(NonNull)public MusicItem.Builder setArtist(@NonNull java.lang.String artist)
artist
- 要设置的艺术家(NonNull)public MusicItem.Builder setAlbum(@NonNull java.lang.String album)
album
- 要设置的专辑(NonNull)public MusicItem.Builder setUri(@NonNull java.lang.String uri)
uri
- 要设置的 Uri(NonNull)public MusicItem.Builder setIconUri(@NonNull java.lang.String iconUri)
iconUri
- 要设置的图标 Uri(NonNull)public MusicItem.Builder setDuration(int duration) throws java.lang.IllegalArgumentException
duration
- 歌曲的持续时间,小于 0 时,duration 的值将被设置为 0java.lang.IllegalArgumentException
public MusicItem.Builder setForbidSeek(boolean forbidSeek)
forbidSeek
- 如果为 true,则会同时禁用 seekTo、fastForward、rewind 操作。public MusicItem.Builder setExtra(@Nullable android.os.Bundle extra)
public MusicItem build()