PhotoPickerUiCustomizationParams.Builder


public static final class PhotoPickerUiCustomizationParams.Builder
extends Object

java.lang.Object
   ↳ android.widget.photopicker.PhotoPickerUiCustomizationParams.Builder


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

Summary

Public constructors

Builder()

Public methods

PhotoPickerUiCustomizationParams build()

Builds a new immutable PhotoPickerUiCustomizationParams object.

PhotoPickerUiCustomizationParams.Builder setAspectRatio(int aspectRatio)

Sets the desired aspect ratio for the media grid thumbnails within the Photo Picker UI.

Inherited methods

Public constructors

Builder

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

Public methods

build

Added in API level 37
Also in U Extensions 22
public PhotoPickerUiCustomizationParams build ()

Builds a new immutable PhotoPickerUiCustomizationParams object.

Returns
PhotoPickerUiCustomizationParams A new PhotoPickerUiCustomizationParams object with the configured UI properties.
This value cannot be null.

setAspectRatio

Added in API level 37
Also in U Extensions 22
public PhotoPickerUiCustomizationParams.Builder setAspectRatio (int aspectRatio)

Sets the desired aspect ratio for the media grid thumbnails within the Photo Picker UI.

The value must be one of the following constants:

Any other value will result in throwing IllegalArgumentException.

If not set, the PhotoPickerUiCustomizationParams.ASPECT_RATIO_UNDEFINED will be used.

Parameters
aspectRatio int: The aspect ratio constant.
Value is one of the following:
Returns
PhotoPickerUiCustomizationParams.Builder This value cannot be null.

Throws
IllegalArgumentException if the provided aspectRatio is not one of the supported constants (ERROR(/#VALID_ASPECT_RATIOS)).