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
|
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
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
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
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
public static final Creator<PhotoPickerUiCustomizationParams> CREATOR
Public methods
describeContents
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
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
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:
|
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-03-26 UTC.