# SelectionParams

Artifact: [androidx.photopicker:photopicker-activity](https://developer.android.com/jetpack/androidx/releases/photopicker) [View Source](https://cs.android.com/search?q=file:androidx/photopicker/activity/params/SelectionParams.kt+class:androidx.photopicker.activity.params.SelectionParams) Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/photopicker#1.0.0-alpha03)

*** ** * ** ***


```
@RequiresApi(value = 26)
public final class SelectionParams
```

<br />

*** ** * ** ***

Represents selection constraints for the photo picker.

This class allows specifying constraints that the selected media items must satisfy. By providing this information to `https://developer.android.com/reference/androidx/photopicker/activity/PickVisualMediaRequest`, the photo picker will disable selection of items in the picker grid that violate these constraints.

Callers should use `https://developer.android.com/reference/androidx/photopicker/activity/params/SelectionParams.Builder` to construct an instance of this class.

| See also |
|---|---|
| `https://developer.android.com/reference/android/provider/MediaStore.html#EXTRA_PICK_IMAGES_SELECTION_PARAMS` |   |
| `https://developer.android.com/reference/android/widget/photopicker/PhotoPickerSelectionParams.html` |   |

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/androidx/annotation/RequiresApi(value = 26) public final class https://developer.android.com/reference/androidx/photopicker/activity/params/SelectionParams.Builder` A builder for constructing `https://developer.android.com/reference/androidx/photopicker/activity/params/SelectionParams` instances. |

| ### Public methods |
|---|---|
| `final long` | `https://developer.android.com/reference/androidx/photopicker/activity/params/SelectionParams#getMaxMediaItemResolutionInPixels()()` The maximum allowed resolution in total pixels, or `-1` if unrestricted (default). |
| `final long` | `https://developer.android.com/reference/androidx/photopicker/activity/params/SelectionParams#getMaxMediaItemSizeInBytes()()` The maximum allowed size, in bytes, for an individual media item, or `-1` if unrestricted (default). |
| `final long` | `https://developer.android.com/reference/androidx/photopicker/activity/params/SelectionParams#getMaxSelectionBatchSizeInBytes()()` The maximum allowed cumulative size, in bytes, for the entire batch of selected media items, or `-1` if unrestricted (default). |
| `final https://developer.android.com/reference/java/time/Duration.html` | `https://developer.android.com/reference/androidx/photopicker/activity/params/SelectionParams#getMaxVideoDuration()()` The maximum allowed duration for a video media item, or `null` if unrestricted (default). |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html>` | `https://developer.android.com/reference/androidx/photopicker/activity/params/SelectionParams#getMimeTypes()()` The list of allowed mime types that items must match to be selectable. |
| `final long` | `https://developer.android.com/reference/androidx/photopicker/activity/params/SelectionParams#getMinMediaItemResolutionInPixels()()` The minimum required resolution in total pixels, or `-1` if unrestricted (default). |
| `final https://developer.android.com/reference/java/time/Duration.html` | `https://developer.android.com/reference/androidx/photopicker/activity/params/SelectionParams#getMinVideoDuration()()` The minimum required duration for a video media item, or `null` if unrestricted (default). |

## Public methods

### getMaxMediaItemResolutionInPixels

Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/photopicker#1.0.0-alpha03)

```
public final long getMaxMediaItemResolutionInPixels()
```

The maximum allowed resolution in total pixels, or `-1` if unrestricted (default).

### getMaxMediaItemSizeInBytes

Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/photopicker#1.0.0-alpha03)

```
public final long getMaxMediaItemSizeInBytes()
```

The maximum allowed size, in bytes, for an individual media item, or `-1` if unrestricted (default).

### getMaxSelectionBatchSizeInBytes

Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/photopicker#1.0.0-alpha03)

```
public final long getMaxSelectionBatchSizeInBytes()
```

The maximum allowed cumulative size, in bytes, for the entire batch of selected media items, or `-1` if unrestricted (default).

### getMaxVideoDuration

Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/photopicker#1.0.0-alpha03)

```
public final Duration getMaxVideoDuration()
```

The maximum allowed duration for a video media item, or `null` if unrestricted (default).

### getMimeTypes

Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/photopicker#1.0.0-alpha03)

```
public final @NonNull List<@NonNull String> getMimeTypes()
```

The list of allowed mime types that items must match to be selectable. If empty, all mime types are allowed (default).

### getMinMediaItemResolutionInPixels

Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/photopicker#1.0.0-alpha03)

```
public final long getMinMediaItemResolutionInPixels()
```

The minimum required resolution in total pixels, or `-1` if unrestricted (default).

### getMinVideoDuration

Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/photopicker#1.0.0-alpha03)

```
public final Duration getMinVideoDuration()
```

The minimum required duration for a video media item, or `null` if unrestricted (default).