# HighlightSearchResultsParams.Builder

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/HighlightSearchResultsParams.kt+class:androidx.photopicker.activity.params.HighlightSearchResultsParams.Builder) Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/photopicker#1.0.0-alpha03)

*** ** * ** ***


```
public final class HighlightSearchResultsParams.Builder
```

<br />

*** ** * ** ***

A builder for constructing `https://developer.android.com/reference/androidx/photopicker/activity/params/HighlightSearchResultsParams` instances.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/photopicker/activity/params/HighlightSearchResultsParams.Builder#Builder()()` |

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/photopicker/activity/params/HighlightSearchResultsParams` | `https://developer.android.com/reference/androidx/photopicker/activity/params/HighlightSearchResultsParams.Builder#build()()` Builds the `https://developer.android.com/reference/androidx/photopicker/activity/params/HighlightSearchResultsParams` object specified by this builder. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/photopicker/activity/params/HighlightSearchResultsParams.Builder` | `https://developer.android.com/reference/androidx/photopicker/activity/params/HighlightSearchResultsParams.Builder#setHighlightSearchTextQuery(kotlin.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html highlightSearchTextQuery)` Sets the text query string used for highlighting media search results. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/photopicker/activity/params/HighlightSearchResultsParams.Builder` | `https://developer.android.com/reference/androidx/photopicker/activity/params/HighlightSearchResultsParams.Builder#setHighlightType(kotlin.Int)(int highlightType)` Sets the requested highlight type specifying how the highlighted search results will be displayed. |

## Public constructors

### Builder

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

```
public Builder()
```

## Public methods

### build

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

```
public final @NonNull HighlightSearchResultsParams build()
```

Builds the `https://developer.android.com/reference/androidx/photopicker/activity/params/HighlightSearchResultsParams` object specified by this builder.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/photopicker/activity/params/HighlightSearchResultsParams` | The newly constructed `https://developer.android.com/reference/androidx/photopicker/activity/params/HighlightSearchResultsParams` instance. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if `https://developer.android.com/reference/androidx/photopicker/activity/params/HighlightSearchResultsParams.Builder#highlightType()` is not set, or if `https://developer.android.com/reference/androidx/photopicker/activity/params/HighlightSearchResultsParams.Builder#highlightSearchTextQuery()` is not set or blank. |

### setHighlightSearchTextQuery

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

```
public final @NonNull HighlightSearchResultsParams.Builder setHighlightSearchTextQuery(@NonNull String highlightSearchTextQuery)
```

Sets the text query string used for highlighting media search results. It should not be empty or null.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html highlightSearchTextQuery` | Input string query for highlighting media results. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/photopicker/activity/params/HighlightSearchResultsParams.Builder` | This Builder. |

### setHighlightType

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

```
public final @NonNull HighlightSearchResultsParams.Builder setHighlightType(int highlightType)
```

Sets the requested highlight type specifying how the highlighted search results will be displayed.

| Parameters |
|---|---|
| `int highlightType` | A supported highlight type from `https://developer.android.com/reference/androidx/photopicker/activity/params/HighlightType.Companion.HighlightType`. Value is one of the following: - `0` - `1` <br /> |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/photopicker/activity/params/HighlightSearchResultsParams.Builder` | This Builder. |