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!

Put a Bitmap into the metadata.

MediaMetadataCompat.Builder!

Put a long value into the metadata.

MediaMetadataCompat.Builder!

Put a RatingCompat into the metadata.

MediaMetadataCompat.Builder!

Put a String value into the metadata.

MediaMetadataCompat.Builder!

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(@MediaMetadataCompat.BitmapKey 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
@MediaMetadataCompat.BitmapKey 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(@MediaMetadataCompat.LongKey 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
@MediaMetadataCompat.LongKey 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(@MediaMetadataCompat.RatingKey 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
@MediaMetadataCompat.RatingKey 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(@MediaMetadataCompat.TextKey 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
@MediaMetadataCompat.TextKey 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(@MediaMetadataCompat.TextKey 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
@MediaMetadataCompat.TextKey key: String!

The key for referencing this value

value: CharSequence!

The CharSequence value to store

Returns
MediaMetadataCompat.Builder!

The Builder to allow chaining