PickVisualMediaRequest


class PickVisualMediaRequest


A request for a PickMultipleVisualMedia or PickVisualMedia Activity Contract.

Summary

Nested types

A builder for constructing PickVisualMediaRequest instances.

Public properties

Long

The color used to customize the main accent color of the photo picker.

PickVisualMedia.DefaultTab

The tab in which the photo picker is initially opened, e.g. DefaultTab.PhotosTab or DefaultTab.AlbumsTab.

HighlightAlbumParams?

The parameters used to highlight the media of a specific album in the photo picker, or null if no album highlight was requested.

HighlightSearchResultsParams?

The parameters used to highlight search results in the photo picker based on a text query, or null if no search results highlight was requested.

Boolean

Denotes if the calling app explicitly set an accentColor for this request via Builder.setAccentColor.

Boolean

Denotes if the calling app explicitly set a defaultTab for this request via Builder.setDefaultTab.

Boolean

Denotes if the calling app requested access to location metadata for the selected media items.

Boolean

This controls the order in which the selected media items are returned to the calling app when using PickMultipleVisualMedia.

Int

The maximum number of items that can be selected when using PickMultipleVisualMedia.

PickVisualMedia.MediaCapabilities?

The MediaCapabilities that the calling app can handle, used by the photo picker to decide whether selected videos need to be transcoded into a default supported format, or null if no media capabilities were specified.

PickVisualMedia.VisualMediaType

The type of media that can be selected in the photo picker, e.g. PickVisualMedia.ImageOnly, PickVisualMedia.VideoOnly, PickVisualMedia.ImageAndVideo or PickVisualMedia.SingleMimeType.

SelectionParams?

The selection constraints applied to media items in the photo picker, or null if no constraints were specified.

UiCustomizationParams?

The UI customization options applied to the photo picker, or null if no customizations are requested by the calling app.

Public properties

accentColor

Added in 1.0.0-beta01
val accentColor: Long

The color used to customize the main accent color of the photo picker. Defaults to 0.

This value is only passed on to the photo picker if it was explicitly set by the calling app, see isCustomAccentColorApplied. Support for this feature was added in API level 35 / R ext 12.

defaultTab

Added in 1.0.0-beta01
val defaultTab: PickVisualMedia.DefaultTab

The tab in which the photo picker is initially opened, e.g. DefaultTab.PhotosTab or DefaultTab.AlbumsTab. Defaults to DefaultTab.PhotosTab.

This value is only passed on to the photo picker if it was explicitly set by the calling app, see isCustomDefaultTabApplied. Otherwise, the photo picker applies its own default behavior, which is opening to the photos tab. Support for this feature was added in API level 35 / R ext 12.

highlightAlbumParams

Added in 1.0.0-beta01
val highlightAlbumParams: HighlightAlbumParams?

The parameters used to highlight the media of a specific album in the photo picker, or null if no album highlight was requested. Defaults to null. At most one of highlightSearchResultsParams and highlightAlbumParams can be requested.

highlightSearchResultsParams

Added in 1.0.0-beta01
val highlightSearchResultsParams: HighlightSearchResultsParams?

The parameters used to highlight search results in the photo picker based on a text query, or null if no search results highlight was requested. Defaults to null. At most one of highlightSearchResultsParams and highlightAlbumParams can be requested.

isCustomAccentColorApplied

Added in 1.0.0-beta01
val isCustomAccentColorApplied: Boolean

Denotes if the calling app explicitly set an accentColor for this request via Builder.setAccentColor.

When true, the accentColor is passed on to the photo picker. When false, no accent color is requested and the photo picker uses its default theme colors, so accentColor is ignored.

isCustomDefaultTabApplied

Added in 1.0.0-beta01
val isCustomDefaultTabApplied: Boolean

Denotes if the calling app explicitly set a defaultTab for this request via Builder.setDefaultTab.

When true, the defaultTab is passed on to the photo picker as the tab to launch in. When false, no launch tab is requested and the photo picker applies its own default behavior, so defaultTab only holds its default value of DefaultTab.PhotosTab and is ignored.

isLocationMetadataAccessRequested

Added in 1.0.0-beta01
val isLocationMetadataAccessRequested: Boolean

Denotes if the calling app requested access to location metadata for the selected media items. Defaults to false, meaning location metadata is redacted.

Requesting location metadata does not guarantee that the calling app will receive it, as the user may deny location sharing in the photo picker UI.

isOrderedSelection

Added in 1.0.0-beta01
val isOrderedSelection: Boolean

This controls the order in which the selected media items are returned to the calling app when using PickMultipleVisualMedia. When true, the user can choose the order of the selected items and they are returned in that order. Defaults to false. This value is ignored by PickVisualMedia and might not be supported by the underlying photo picker implementation.

maxItems

Added in 1.0.0-beta01
val maxItems: Int

The maximum number of items that can be selected when using PickMultipleVisualMedia. Defaults to PickMultipleVisualMedia.getMaxItems. When launching the picker, the minimum of this value and the maxItems passed to PickMultipleVisualMedia is used as the limit. This value is ignored by PickVisualMedia.

See also
setMaxItems

mediaCapabilitiesForTranscoding

Added in 1.0.0-beta01
val mediaCapabilitiesForTranscoding: PickVisualMedia.MediaCapabilities?

The MediaCapabilities that the calling app can handle, used by the photo picker to decide whether selected videos need to be transcoded into a default supported format, or null if no media capabilities were specified. Defaults to null.

selectionParams

Added in 1.0.0-beta01
val selectionParams: SelectionParams?

The selection constraints applied to media items in the photo picker, or null if no constraints were specified. Defaults to null. Items that do not satisfy these constraints are not selectable in the photo picker.

uiCustomizationParams

Added in 1.0.0-beta01
val uiCustomizationParams: UiCustomizationParams?

The UI customization options applied to the photo picker, or null if no customizations are requested by the calling app. Defaults to null.