Summary: Constants | Ctors | Methods | Inherited Methods | [Expand All]
public class

# ImagePicker

extends Object

java.lang.Object
↳ | com.google.android.gms.cast.framework.media.ImagePicker

## Class Overview

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, int)`.

## Summary

Constants
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.

Public Constructors
| ImagePicker()

Public Methods
WebImage | onPickImage(MediaMetadata mediaMetadata, int type) Returns the `WebImage` to be used for the requested image `type`.

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()

## Constants

#### public static final int IMAGE_TYPE_MEDIA_ROUTE_CONTROLLER_DIALOG_BACKGROUND

Type of the image to be displayed in the MediaRouter controller dialog. This image is also displayed on the lock screen.

Constant Value: 0 (0x00000000)

#### public static final int IMAGE_TYPE_MINI_CONTROLLER_THUMBNAIL

Type of the image to be displayed as thumbnail image in the mini controller.

Constant Value: 2 (0x00000002)

#### public static final int IMAGE_TYPE_NOTIFICATION_THUMBNAIL

Type of the image to be displayed as thumbnail image in the notification.

Constant Value: 1 (0x00000001)

## Public Constructors

#### public ImagePicker ()

## Public Methods

#### public WebImage onPickImage (MediaMetadata mediaMetadata, int type)

Returns the `WebImage` to be used for the requested image `type`. The SDK 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 | The `MediaMetadata` of a media.
type | The type of the wanted image. One of `IMAGE_TYPE_MEDIA_ROUTE_CONTROLLER_DIALOG_BACKGROUND`, `IMAGE_TYPE_NOTIFICATION_THUMBNAIL` or `IMAGE_TYPE_MINI_CONTROLLER_THUMBNAIL`.