PhotoPickerUiCustomizationParams


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

Defines UI customization options for the system's Photo Picker interface.

This immutable class allows an application to specify visual preferences to optimize the user experience within the picker.

Summary

Nested classes

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

Constants
static Int

Aspect ratio option requesting portrait 9:16 sizing for the thumbnails within the media grid.

static Int

Aspect ratio option requesting square 1:1 thumbnail sizing within the media grid.

static Int

Aspect ratio option sent to photo picker when no aspect ratio is set by the calling app.

Inherited constants
Public methods
Int

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

Int

Returns the constant representing the aspect ratio currently configured for thumbnail sizing within the Photo Picker's media grid.

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<PhotoPickerUiCustomizationParams!>

Constants

ASPECT_RATIO_PORTRAIT_9_16

static val ASPECT_RATIO_PORTRAIT_9_16: Int

Aspect ratio option requesting portrait 9:16 sizing for the thumbnails within the media grid.

Value: 1

ASPECT_RATIO_SQUARE_1_1

static val ASPECT_RATIO_SQUARE_1_1: Int

Aspect ratio option requesting square 1:1 thumbnail sizing within the media grid.

Value: 0

ASPECT_RATIO_UNDEFINED

static val ASPECT_RATIO_UNDEFINED: Int

Aspect ratio option sent to photo picker when no aspect ratio is set by the calling app.

Value: -1

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

getAspectRatio

fun getAspectRatio(): Int

Returns the constant representing the aspect ratio currently configured for thumbnail sizing within the Photo Picker's media grid. (e.g., ASPECT_RATIO_SQUARE_1_1).

If the aspect ratio is not set by the caller app using Builder.setAspectRatio(int), this method returns ASPECT_RATIO_SQUARE_1_1, indicating that the photo picker will use its default 1:1 media grid aspect ratio.

Return
Int Value is one of the following:

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