@RequiresApi(value = 26)
class SelectionParams


Represents selection constraints for the photo picker.

This class allows specifying constraints that the selected media items must satisfy. By providing this information to androidx.photopicker.activity.PickVisualMediaRequest, the photo picker will disable selection of items in the picker grid that violate these constraints.

Callers should use Builder to construct an instance of this class.

Summary

Nested types

A builder for constructing SelectionParams instances.

Public properties

Long

The maximum allowed resolution in total pixels, or -1 if unrestricted (default).

Long

The maximum allowed size, in bytes, for an individual media item, or -1 if unrestricted (default).

Long

The maximum allowed cumulative size, in bytes, for the entire batch of selected media items, or -1 if unrestricted (default).

Duration?

The maximum allowed duration for a video media item, or null if unrestricted (default).

List<String>

The list of allowed mime types that items must match to be selectable.

Long

The minimum required resolution in total pixels, or -1 if unrestricted (default).

Duration?

The minimum required duration for a video media item, or null if unrestricted (default).

Public properties

maxMediaItemResolutionInPixels

Added in 1.0.0-alpha03
val maxMediaItemResolutionInPixels: Long

The maximum allowed resolution in total pixels, or -1 if unrestricted (default).

maxMediaItemSizeInBytes

Added in 1.0.0-alpha03
val maxMediaItemSizeInBytes: Long

The maximum allowed size, in bytes, for an individual media item, or -1 if unrestricted (default).

maxSelectionBatchSizeInBytes

Added in 1.0.0-alpha03
val maxSelectionBatchSizeInBytes: Long

The maximum allowed cumulative size, in bytes, for the entire batch of selected media items, or -1 if unrestricted (default).

maxVideoDuration

Added in 1.0.0-alpha03
val maxVideoDuration: Duration?

The maximum allowed duration for a video media item, or null if unrestricted (default).

mimeTypes

Added in 1.0.0-alpha03
val mimeTypes: List<String>

The list of allowed mime types that items must match to be selectable. If empty, all mime types are allowed (default).

minMediaItemResolutionInPixels

Added in 1.0.0-alpha03
val minMediaItemResolutionInPixels: Long

The minimum required resolution in total pixels, or -1 if unrestricted (default).

minVideoDuration

Added in 1.0.0-alpha03
val minVideoDuration: Duration?

The minimum required duration for a video media item, or null if unrestricted (default).