PickVisualMediaRequest


public final class PickVisualMediaRequest


A request for a PickMultipleVisualMedia or PickVisualMedia Activity Contract.

Summary

Nested types

A builder for constructing PickVisualMediaRequest instances.

Public methods

final long

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

final @NonNull PickVisualMedia.DefaultTab

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

final HighlightAlbumParams

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

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

final int

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

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

final @NonNull 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.

final SelectionParams
@RequiresExtension(extension = 34, version = 22)
getSelectionParams()

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

final UiCustomizationParams

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

final boolean

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

final boolean

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

final boolean

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

final boolean

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

Public methods

getAccentColor

Added in 1.0.0-beta01
public final long getAccentColor()

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.

getDefaultTab

Added in 1.0.0-beta01
public final @NonNull PickVisualMedia.DefaultTab getDefaultTab()

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.

getHighlightAlbumParams

Added in 1.0.0-beta01
public final HighlightAlbumParams getHighlightAlbumParams()

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.

getHighlightSearchResultsParams

Added in 1.0.0-beta01
public final HighlightSearchResultsParams getHighlightSearchResultsParams()

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.

getMaxItems

Added in 1.0.0-beta01
public final int getMaxItems()

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

getMediaCapabilitiesForTranscoding

Added in 1.0.0-beta01
public final PickVisualMedia.MediaCapabilities getMediaCapabilitiesForTranscoding()

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.

getMediaType

Added in 1.0.0-beta01
public final @NonNull PickVisualMedia.VisualMediaType getMediaType()

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

See also
setMediaType

getSelectionParams

Added in 1.0.0-beta01
@RequiresExtension(extension = 34, version = 22)
public final SelectionParams getSelectionParams()

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.

getUiCustomizationParams

Added in 1.0.0-beta01
public final UiCustomizationParams getUiCustomizationParams()

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

isCustomAccentColorApplied

Added in 1.0.0-beta01
public final boolean isCustomAccentColorApplied()

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
public final boolean isCustomDefaultTabApplied()

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
public final boolean isLocationMetadataAccessRequested()

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
public final boolean isOrderedSelection()

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.