Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [U Extensions 22](https://developer.android.com/sdkExtensions)

# Builder

*** ** * ** ***

```
class Builder
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.widget.photopicker.PhotoPickerUiCustomizationParams.Builder](https://developer.android.com/reference/kotlin/android/widget/photopicker/PhotoPickerUiCustomizationParams.Builder#) |

A builder class used to construct and validate an immutable `https://developer.android.com/reference/kotlin/android/widget/photopicker/PhotoPickerUiCustomizationParams` object.

## Summary

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/widget/photopicker/PhotoPickerUiCustomizationParams.Builder#Builder()()` <br /> |

| Public methods ||
|---|---|
| [PhotoPickerUiCustomizationParams](https://developer.android.com/reference/kotlin/android/widget/photopicker/PhotoPickerUiCustomizationParams) | `https://developer.android.com/reference/kotlin/android/widget/photopicker/PhotoPickerUiCustomizationParams.Builder#build()()` Builds a new immutable `https://developer.android.com/reference/kotlin/android/widget/photopicker/PhotoPickerUiCustomizationParams` object. |
| [PhotoPickerUiCustomizationParams.Builder](https://developer.android.com/reference/kotlin/android/widget/photopicker/PhotoPickerUiCustomizationParams.Builder#) | `https://developer.android.com/reference/kotlin/android/widget/photopicker/PhotoPickerUiCustomizationParams.Builder#setAspectRatio(kotlin.Int)(aspectRatio: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Sets the desired aspect ratio for the media grid thumbnails within the Photo Picker UI. |

## Public constructors

### Builder

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [U Extensions 22](https://developer.android.com/sdkExtensions)

```
Builder()
```

## Public methods

### build

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [U Extensions 22](https://developer.android.com/sdkExtensions)

```
fun build(): PhotoPickerUiCustomizationParams
```

Builds a new immutable `https://developer.android.com/reference/kotlin/android/widget/photopicker/PhotoPickerUiCustomizationParams` object.

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/widget/photopicker/PhotoPickerUiCustomizationParams` | A new `https://developer.android.com/reference/kotlin/android/widget/photopicker/PhotoPickerUiCustomizationParams` object with the configured UI properties. This value cannot be `null`. |

### setAspectRatio

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [U Extensions 22](https://developer.android.com/sdkExtensions)

```
fun setAspectRatio(aspectRatio: Int): PhotoPickerUiCustomizationParams.Builder
```

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

The value must be one of the following constants:

- `https://developer.android.com/reference/kotlin/android/widget/photopicker/PhotoPickerUiCustomizationParams#ASPECT_RATIO_UNDEFINED:kotlin.Int`
- `https://developer.android.com/reference/kotlin/android/widget/photopicker/PhotoPickerUiCustomizationParams#ASPECT_RATIO_SQUARE_1_1:kotlin.Int`
- `https://developer.android.com/reference/kotlin/android/widget/photopicker/PhotoPickerUiCustomizationParams#ASPECT_RATIO_PORTRAIT_9_16:kotlin.Int`

Any other value will result in throwing `IllegalArgumentException`.

If not set, the `https://developer.android.com/reference/kotlin/android/widget/photopicker/PhotoPickerUiCustomizationParams#ASPECT_RATIO_UNDEFINED:kotlin.Int` will be used.

| Parameters ||
|---|---|
| `aspectRatio` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The aspect ratio constant. Value is one of the following: - `https://developer.android.com/reference/kotlin/android/widget/photopicker/PhotoPickerUiCustomizationParams#ASPECT_RATIO_UNDEFINED:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/widget/photopicker/PhotoPickerUiCustomizationParams#ASPECT_RATIO_SQUARE_1_1:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/widget/photopicker/PhotoPickerUiCustomizationParams#ASPECT_RATIO_PORTRAIT_9_16:kotlin.Int` |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/widget/photopicker/PhotoPickerUiCustomizationParams.Builder#` | This value cannot be `null`. |

| Exceptions ||
|---|---|
| `java.lang.IllegalArgumentException` | if the provided `aspectRatio` is not one of the supported constants (#VALID_ASPECT_RATIOS). |