PhotoPickerSelectionParams


class PhotoPickerSelectionParams : Parcelable
kotlin.Any
   ↳ android.widget.photopicker.PhotoPickerSelectionParams

An immutable parcel that carries constraints to be applied to media items displayed in the Photo Picker.

Media items that fail to satisfy these constraints will be disabled for selection.

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

Summary

Nested classes

A builder class used to construct and validate an immutable PhotoPickerSelectionParams object.

Inherited constants
Public methods
Int

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

Long

Returns the maximum allowed resolution, in pixels, for a media item to be selectable.

Long

Returns the maximum allowed size, in bytes, for a media item to be selectable.

Long

Returns the maximum allowed cumulative size, in bytes, for the entire batch of selected media items.

Duration?

Returns the maximum allowed duration for a video to be selectable.

MutableList<String!>

Returns the list of allowed MIME types that media items must match to be selectable.

Long

Returns the minimum required resolution, in pixels, for a media item to be selectable.

Duration?

Returns the minimum required duration for a video to be selectable.

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<PhotoPickerSelectionParams!>

Public methods

describeContents

Added in API level 37
fun describeContents(): Int

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
Value is either 0 or

getMaxMediaItemResolutionInPixels

fun getMaxMediaItemResolutionInPixels(): Long

Returns the maximum allowed resolution, in pixels, for a media item to be selectable.

If the maximum resolution is not set by the caller app using Builder.setMaxMediaItemResolutionInPixels(long), this method returns -1, indicating that the photo picker will not restrict selection based on the maximum media item resolution.

getMaxMediaItemSizeInBytes

fun getMaxMediaItemSizeInBytes(): Long

Returns the maximum allowed size, in bytes, for a media item to be selectable.

If the maximum media item size is not set by the caller app using Builder.setMaxMediaItemSizeInBytes(long), this method returns -1, indicating that the photo picker will not restrict selection based on the maximum media item size.

getMaxSelectionBatchSizeInBytes

fun getMaxSelectionBatchSizeInBytes(): Long

Returns the maximum allowed cumulative size, in bytes, for the entire batch of selected media items.

If the maximum selection batch size is not set by the caller app using Builder.setMaxSelectionBatchSizeInBytes(long), this method returns -1, indicating that the photo picker will not restrict selection based on the total batch size.

getMaxVideoDuration

fun getMaxVideoDuration(): Duration?

Returns the maximum allowed duration for a video to be selectable.

If the maximum video duration is not set by the caller app using Builder.setMaxVideoDuration(Duration), this method returns null, indicating that the photo picker will not restrict selection based on the maximum video duration.

getMimeTypes

fun getMimeTypes(): MutableList<String!>

Returns the list of allowed MIME types that media items must match to be selectable.

If the allowed MIME types are not set by the caller app using Builder.setMimeTypes(List), this method returns an empty list, indicating that the photo picker will not restrict selection based on the MIME type.

Return
MutableList<String!> This value cannot be null.

getMinMediaItemResolutionInPixels

fun getMinMediaItemResolutionInPixels(): Long

Returns the minimum required resolution, in pixels, for a media item to be selectable.

If the minimum resolution is not set by the caller app using Builder.setMinMediaItemResolutionInPixels(long), this method returns -1, indicating that the photo picker will not restrict selection based on the minimum media item resolution.

getMinVideoDuration

fun getMinVideoDuration(): Duration?

Returns the minimum required duration for a video to be selectable.

If the minimum video duration is not set by the caller app using Builder.setMinVideoDuration(Duration), this method returns null, indicating that the photo picker will not restrict selection based on the minimum video duration.

writeToParcel

Added in API level 37
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.
Value is either 0 or a combination of the following:

Properties

CREATOR

static val CREATOR: Parcelable.Creator<PhotoPickerSelectionParams!>