# ImageViewStyle.Builder

Artifact: [androidx.autofill:autofill](https://developer.android.com/jetpack/androidx/releases/autofill) [View Source](https://cs.android.com/search?q=file:androidx/autofill/inline/common/ImageViewStyle.java+class:androidx.autofill.inline.common.ImageViewStyle.Builder) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/autofill#1.1.0)

*** ** * ** ***


```
public final class ImageViewStyle.Builder
```

<br />

*** ** * ** ***

Builder for the `https://developer.android.com/reference/androidx/autofill/inline/common/ImageViewStyle`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/autofill/inline/common/ImageViewStyle.Builder#Builder()()` |

| ### Public methods |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/autofill/inline/common/ImageViewStyle` | `https://developer.android.com/reference/androidx/autofill/inline/common/ImageViewStyle.Builder#build()()` Returns a subclass of `https://developer.android.com/reference/androidx/autofill/inline/common/BundledStyle` built by this builder. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/autofill/inline/common/ImageViewStyle.Builder` | `https://developer.android.com/reference/androidx/autofill/inline/common/ImageViewStyle.Builder#setMaxHeight(int)(int maxHeight)` Sets a maximum height for the image view. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/autofill/inline/common/ImageViewStyle.Builder` | `https://developer.android.com/reference/androidx/autofill/inline/common/ImageViewStyle.Builder#setMaxWidth(int)(int maxWidth)` Sets a maximum width for the image view. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/autofill/inline/common/ImageViewStyle.Builder` | `https://developer.android.com/reference/androidx/autofill/inline/common/ImageViewStyle.Builder#setScaleType(android.widget.ImageView.ScaleType)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/widget/ImageView.ScaleType.html scaleType)` Sets the scale type of the image view. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/autofill/inline/common/ImageViewStyle.Builder` | `https://developer.android.com/reference/androidx/autofill/inline/common/ImageViewStyle.Builder#setTintList(android.content.res.ColorStateList)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/res/ColorStateList.html imageTintList)` Sets a tint color to the image view. |

## Public constructors

### Builder

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/autofill#1.1.0)

```
public Builder()
```

## Public methods

### build

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/autofill#1.1.0)

```
public @NonNull ImageViewStyle build()
```

Returns a subclass of `https://developer.android.com/reference/androidx/autofill/inline/common/BundledStyle` built by this builder.

### setMaxHeight

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/autofill#1.1.0)

```
public @NonNull ImageViewStyle.Builder setMaxHeight(int maxHeight)
```

Sets a maximum height for the image view.

| Parameters |
|---|---|
| `int maxHeight` | maximum height for this view |

| See also |
|---|---|
| `https://developer.android.com/reference/android/widget/ImageView.html#setMaxHeight(int)` |   |

### setMaxWidth

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/autofill#1.1.0)

```
public @NonNull ImageViewStyle.Builder setMaxWidth(int maxWidth)
```

Sets a maximum width for the image view.

| Parameters |
|---|---|
| `int maxWidth` | maximum width for this view |

| See also |
|---|---|
| `https://developer.android.com/reference/android/widget/ImageView.html#setMaxWidth(int)` |   |

### setScaleType

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/autofill#1.1.0)

```
public @NonNull ImageViewStyle.Builder setScaleType(@NonNull ImageView.ScaleType scaleType)
```

Sets the scale type of the image view.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/widget/ImageView.ScaleType.html scaleType` | The desired scaling mode. |

| See also |
|---|---|
| `https://developer.android.com/reference/android/widget/ImageView.html#setScaleType(android.widget.ImageView.ScaleType)` |   |

### setTintList

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/autofill#1.1.0)

```
public @NonNull ImageViewStyle.Builder setTintList(@NonNull ColorStateList imageTintList)
```

Sets a tint color to the image view.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/res/ColorStateList.html imageTintList` | the tint color to apply to the image |

| See also |
|---|---|
| `https://developer.android.com/reference/android/widget/ImageView.html#setImageTintList(android.content.res.ColorStateList)` |   |