public class RemoteControlClient.MetadataEditor extends Object
RemoteControlClient
object.
Use RemoteControlClient.editMetadata(boolean)
to create an instance of an editor,
on which you set the metadata for the RemoteControlClient instance. Once all the information
has been set, use apply()
to make it the new metadata that should be displayed
for the associated client. Once the metadata has been "applied", you cannot reuse this
instance of the MetadataEditor.Modifier and Type | Field and Description |
---|---|
static int |
BITMAP_KEY_ARTWORK
The metadata key for the content artwork / album art.
|
protected boolean |
mArtworkChanged |
protected Bitmap |
mEditorArtwork |
protected Bundle |
mEditorMetadata |
static int |
METADATA_KEY_ARTWORK |
protected boolean |
mMetadataChanged |
Modifier and Type | Method and Description |
---|---|
void |
apply()
Associates all the metadata that has been set since the MetadataEditor instance was
created with
RemoteControlClient.editMetadata(boolean) , or since
clear() was called, with the RemoteControlClient. |
void |
clear()
Clears all the metadata that has been set since the MetadataEditor instance was
created with
RemoteControlClient.editMetadata(boolean) . |
Object |
clone()
Creates and returns a copy of this
Object . |
RemoteControlClient.MetadataEditor |
putBitmap(int key,
Bitmap bitmap)
Sets the album / artwork picture to be displayed on the remote control.
|
RemoteControlClient.MetadataEditor |
putLong(int key,
long value)
Adds numerical information to be displayed.
|
RemoteControlClient.MetadataEditor |
putString(int key,
String value)
Adds textual information to be displayed.
|
protected boolean mMetadataChanged
protected boolean mArtworkChanged
protected Bitmap mEditorArtwork
protected Bundle mEditorMetadata
public static final int BITMAP_KEY_ARTWORK
public static final int METADATA_KEY_ARTWORK
public Object clone() throws CloneNotSupportedException
Object
Object
. The default
implementation returns a so-called "shallow" copy: It creates a new
instance of the same class and then copies the field values (including
object references) from this instance to the new instance. A "deep" copy,
in contrast, would also recursively clone nested objects. A subclass that
needs to implement this kind of cloning should call super.clone()
to create the new instance and then create deep copies of the nested,
mutable objects.clone
in class Object
CloneNotSupportedException
- if this object's class does not implement the Cloneable
interface.public RemoteControlClient.MetadataEditor putString(int key, String value) throws IllegalArgumentException
apply()
has been called,
will be displayed.key
- The identifier of a the metadata field to set. Valid values are
MediaMetadataRetriever.METADATA_KEY_ALBUM
,
MediaMetadataRetriever.METADATA_KEY_ALBUMARTIST
,
MediaMetadataRetriever.METADATA_KEY_TITLE
,
MediaMetadataRetriever.METADATA_KEY_ARTIST
,
MediaMetadataRetriever.METADATA_KEY_AUTHOR
,
MediaMetadataRetriever.METADATA_KEY_COMPILATION
,
MediaMetadataRetriever.METADATA_KEY_COMPOSER
,
MediaMetadataRetriever.METADATA_KEY_DATE
,
MediaMetadataRetriever.METADATA_KEY_GENRE
,
MediaMetadataRetriever.METADATA_KEY_TITLE
,
MediaMetadataRetriever.METADATA_KEY_WRITER
.value
- The text for the given key, or null
to signify there is no valid
information for the field.IllegalArgumentException
public RemoteControlClient.MetadataEditor putLong(int key, long value) throws IllegalArgumentException
apply()
has been called,
will be displayed.key
- the identifier of a the metadata field to set. Valid values are
MediaMetadataRetriever.METADATA_KEY_CD_TRACK_NUMBER
,
MediaMetadataRetriever.METADATA_KEY_DISC_NUMBER
,
MediaMetadataRetriever.METADATA_KEY_DURATION
(with a value
expressed in milliseconds),
MediaMetadataRetriever.METADATA_KEY_YEAR
.value
- The long value for the given keyIllegalArgumentException
public RemoteControlClient.MetadataEditor putBitmap(int key, Bitmap bitmap) throws IllegalArgumentException
key
- the identifier of the bitmap to set. The only valid value is
BITMAP_KEY_ARTWORK
bitmap
- The bitmap for the artwork, or null if there isn't any.IllegalArgumentException
Bitmap
public void clear()
RemoteControlClient.editMetadata(boolean)
.public void apply()
RemoteControlClient.editMetadata(boolean)
, or since
clear()
was called, with the RemoteControlClient. Once "applied",
this MetadataEditor cannot be reused to edit the RemoteControlClient's metadata.