java.lang.Object | |
↳ | com.google.android.gms.cast.framework.media.ImagePicker |
An image picker to pick an appropriate image from the list of images in a MediaMetadata
based on the use of the image, for example, notification thumbnail or full screen background. The
default implementation always chooses the first image, or returns null
if no image is
available in the MediaMetadata
. A subclass can override this by overriding
onPickImage(MediaMetadata, ImageHints)
.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | IMAGE_TYPE_EXPANDED_CONTROLLER_BACKGROUND | Type of the image to be displayed as background image of the expanded controller. | |||||||||
int | IMAGE_TYPE_LOCK_SCREEN_BACKGROUND | Type of the image to be displayed as background image on the lock screen. | |||||||||
int | IMAGE_TYPE_MEDIA_ROUTE_CONTROLLER_DIALOG_BACKGROUND | Type of the image to be displayed in the MediaRouter controller dialog. | |||||||||
int | IMAGE_TYPE_MINI_CONTROLLER_THUMBNAIL | Type of the image to be displayed as thumbnail image in the mini controller. | |||||||||
int | IMAGE_TYPE_NOTIFICATION_THUMBNAIL | Type of the image to be displayed as thumbnail image in the notification. | |||||||||
int | IMAGE_TYPE_UNKNOWN | Indicates that the type of the image is unknown. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method is deprecated.
Prefer to override
onPickImage(MediaMetadata, ImageHints) instead.
| |||||||||||
Returns the
WebImage to be used based on the given ImageHints . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Type of the image to be displayed as background image of the expanded controller.
Type of the image to be displayed as background image on the lock screen.
Type of the image to be displayed in the MediaRouter controller dialog. This image is also displayed on the lock screen.
Type of the image to be displayed as thumbnail image in the mini controller.
Type of the image to be displayed as thumbnail image in the notification.
Indicates that the type of the image is unknown.
This method is deprecated.
Prefer to override onPickImage(MediaMetadata, ImageHints)
instead.
Returns the WebImage
to be used for the requested image type
. The framework
will call this method when trying to choose an image in a MediaMetadata
.
Subclass can override this method to pick an image based on the type
. This method
can return an image even if no image is available in the MediaMetadata
.
Parameters | |
---|---|
mediaMetadata |
MediaMetadata :
The MediaMetadata of a media. |
type |
int :
The type of the wanted image. One of the types defined in this class. |
Returns | |
---|---|
WebImage |
Returns the WebImage
to be used based on the given ImageHints
. The framework
will call this method when trying to choose an image in a MediaMetadata
.
Subclass can override this method to pick an image based on the type
. This method
can return an image even if no image is available in the MediaMetadata
.
Parameters | |
---|---|
mediaMetadata |
MediaMetadata :
The MediaMetadata of a media. |
hints |
ImageHints :
Contains the expected width and height, and the type of the wanted image.
|
Returns | |
---|---|
WebImage |