PhotoPickerUiCustomizationParams


public final class PhotoPickerUiCustomizationParams
extends Object implements Parcelable

java.lang.Object
   ↳ 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

class PhotoPickerUiCustomizationParams.Builder

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

Constants

int ASPECT_RATIO_PORTRAIT_9_16

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

int ASPECT_RATIO_SQUARE_1_1

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

int ASPECT_RATIO_UNDEFINED

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

Inherited constants

Fields

public static final Creator<PhotoPickerUiCustomizationParams> CREATOR

Public methods

int describeContents()

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

int getAspectRatio()

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

void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Inherited methods

Constants

ASPECT_RATIO_PORTRAIT_9_16

Added in API level 37
Also in U Extensions 22
public static final int ASPECT_RATIO_PORTRAIT_9_16

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

Constant Value: 1 (0x00000001)

ASPECT_RATIO_SQUARE_1_1

Added in API level 37
Also in U Extensions 22
public static final int ASPECT_RATIO_SQUARE_1_1

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

Constant Value: 0 (0x00000000)

ASPECT_RATIO_UNDEFINED

Added in API level 37
Also in U Extensions 22
public static final int ASPECT_RATIO_UNDEFINED

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

Constant Value: -1 (0xffffffff)

Fields

CREATOR

Added in API level 37
Also in U Extensions 22
public static final Creator<PhotoPickerUiCustomizationParams> CREATOR

Public methods

describeContents

Added in API level 37
public int describeContents ()

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.

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

getAspectRatio

Added in API level 37
Also in U Extensions 22
public int getAspectRatio ()

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.

Returns
int Value is one of the following:

writeToParcel

Added in API level 37
public void writeToParcel (Parcel dest, 
                int flags)

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.PARCELABLE_WRITE_RETURN_VALUE.
Value is either 0 or a combination of the following: