MediaMetadataCompat.Builder


class MediaMetadataCompat.Builder


Use to build MediaMetadata objects. The system defined metadata keys must use the appropriate data type.

Summary

Public constructors

Create an empty Builder.

Create a Builder using a MediaMetadataCompat instance to set the initial values.

Public functions

MediaMetadataCompat!

Creates a MediaMetadataCompat instance with the specified fields.

MediaMetadataCompat.Builder!
putBitmap(key: String!, value: Bitmap!)

Put a Bitmap into the metadata.

MediaMetadataCompat.Builder!
putLong(key: String!, value: Long)

Put a long value into the metadata.

MediaMetadataCompat.Builder!
putRating(key: String!, value: RatingCompat!)

Put a RatingCompat into the metadata.

MediaMetadataCompat.Builder!
putString(key: String!, value: String!)

Put a String value into the metadata.

MediaMetadataCompat.Builder!
putText(key: String!, value: CharSequence!)

Put a CharSequence value into the metadata.

Public constructors

Builder

Added in 1.1.0
Builder()

Create an empty Builder. Any field that should be included in the MediaMetadataCompat must be added.

Builder

Added in 1.1.0
Builder(source: MediaMetadataCompat!)

Create a Builder using a MediaMetadataCompat instance to set the initial values. All fields in the source metadata will be included in the new metadata. Fields can be overwritten by adding the same key.

Parameters
source: MediaMetadataCompat!

Public functions

build

Added in 1.1.0
fun build(): MediaMetadataCompat!

Creates a MediaMetadataCompat instance with the specified fields.

Returns
MediaMetadataCompat!

The new MediaMetadata instance

putBitmap

Added in 1.1.0
fun putBitmap(key: String!, value: Bitmap!): MediaMetadataCompat.Builder!

Put a Bitmap into the metadata. Custom keys may be used, but if the METADATA_KEYs defined in this class are used they may only be one of the following:

Large bitmaps may be scaled down when setMetadata is called. To pass full resolution images Uris should be used with putString.
Parameters
key: String!

The key for referencing this value

value: Bitmap!

The Bitmap to store

Returns
MediaMetadataCompat.Builder!

The Builder to allow chaining

putLong

Added in 1.1.0
fun putLong(key: String!, value: Long): MediaMetadataCompat.Builder!

Put a long value into the metadata. Custom keys may be used, but if the METADATA_KEYs defined in this class are used they may only be one of the following:

Parameters
key: String!

The key for referencing this value

value: Long

The String value to store

Returns
MediaMetadataCompat.Builder!

The Builder to allow chaining

putRating

Added in 1.1.0
fun putRating(key: String!, value: RatingCompat!): MediaMetadataCompat.Builder!

Put a RatingCompat into the metadata. Custom keys may be used, but if the METADATA_KEYs defined in this class are used they may only be one of the following:

Parameters
key: String!

The key for referencing this value

value: RatingCompat!

The String value to store

Returns
MediaMetadataCompat.Builder!

The Builder to allow chaining

putString

Added in 1.1.0
fun putString(key: String!, value: String!): MediaMetadataCompat.Builder!

Put a String value into the metadata. Custom keys may be used, but if the METADATA_KEYs defined in this class are used they may only be one of the following:

Parameters
key: String!

The key for referencing this value

value: String!

The String value to store

Returns
MediaMetadataCompat.Builder!

The Builder to allow chaining

putText

Added in 1.1.0
fun putText(key: String!, value: CharSequence!): MediaMetadataCompat.Builder!

Put a CharSequence value into the metadata. Custom keys may be used, but if the METADATA_KEYs defined in this class are used they may only be one of the following:

Parameters
key: String!

The key for referencing this value

value: CharSequence!

The CharSequence value to store

Returns
MediaMetadataCompat.Builder!

The Builder to allow chaining