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

# Builder

*** ** * ** ***

```
class Builder
```

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

Builder for `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest`.

## Summary

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#Builder(kotlin.Int,%20kotlin.Int,%20android.content.res.Configuration)(width: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html, height: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html, configuration: https://developer.android.com/reference/kotlin/android/content/res/Configuration.html#)` Creates a new Builder with the required initial properties. |

| Public methods ||
|---|---|
| [LocationButtonRequest](https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest) | `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#build()()` Builds a `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest` instance. |
| [LocationButtonRequest.Builder](https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#) | `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#setBackgroundColor(kotlin.Int)(backgroundColor: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Sets the background color of the button. |
| [LocationButtonRequest.Builder](https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#) | `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#setCornerRadius(kotlin.Float)(cornerRadius: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)` Sets the corner radius of the button. |
| [LocationButtonRequest.Builder](https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#) | `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#setIconTint(kotlin.Int)(iconTint: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Sets the icon tint color. |
| [LocationButtonRequest.Builder](https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#) | `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#setPaddingBottom(kotlin.Int)(paddingBottom: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Sets the bottom padding of the button. |
| [LocationButtonRequest.Builder](https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#) | `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#setPaddingLeft(kotlin.Int)(paddingLeft: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Sets the left padding of the button. |
| [LocationButtonRequest.Builder](https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#) | `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#setPaddingRight(kotlin.Int)(paddingRight: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Sets the right padding of the button. |
| [LocationButtonRequest.Builder](https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#) | `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#setPaddingTop(kotlin.Int)(paddingTop: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Sets the top padding of the button. |
| [LocationButtonRequest.Builder](https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#) | `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#setPressedCornerRadius(kotlin.Float)(cornerRadius: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)` Sets the corner radius of the button when pressed. |
| [LocationButtonRequest.Builder](https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#) | `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#setStrokeColor(kotlin.Int)(strokeColor: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Sets the stroke color of the button. |
| [LocationButtonRequest.Builder](https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#) | `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#setStrokeWidth(kotlin.Int)(strokeWidth: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Sets the stroke width of the button. |
| [LocationButtonRequest.Builder](https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#) | `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#setTextColor(kotlin.Int)(textColor: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Sets the text color of the button. |
| [LocationButtonRequest.Builder](https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#) | `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#setTextType(kotlin.Int)(textType: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Sets the text type of the button. |

## Public constructors

### Builder

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

```
Builder(
    width: Int, 
    height: Int, 
    configuration: Configuration)
```

Creates a new Builder with the required initial properties.

The provided `width` must be at least 48dp. The provided `height` must be between 48dp and 136dp (inclusive). Values outside these ranges will be clamped by the system during session creation and resizing.

| Parameters ||
|---|---|
| `width` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The total width of the button in pixels. |
| `height` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The total height of the button in pixels. |
| `configuration` | [Configuration](https://developer.android.com/reference/kotlin/android/content/res/Configuration.html#): The `https://developer.android.com/reference/kotlin/android/content/res/Configuration.html#` of the context hosting the button. This value cannot be `null`. |

## Public methods

### build

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

```
fun build(): LocationButtonRequest
```

Builds a `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest` instance.

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest` | This value cannot be `null`. |

### setBackgroundColor

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

```
fun setBackgroundColor(backgroundColor: Int): LocationButtonRequest.Builder
```

Sets the background color of the button.

The system will ensure the background color is fully opaque by overriding its alpha channel to 255. If not explicitly set, it defaults to a system default color.

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#` | This value cannot be `null`. |

### setCornerRadius

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

```
fun setCornerRadius(cornerRadius: Float): LocationButtonRequest.Builder
```

Sets the corner radius of the button.

The corner radius must be non-negative. Negative values will be clamped to 0.

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#` | This value cannot be `null`. |

### setIconTint

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

```
fun setIconTint(iconTint: Int): LocationButtonRequest.Builder
```

Sets the icon tint color.

The system will automatically adjust the provided color if necessary to ensure it meets a minimum contrast ratio of 4.5:1 against the button's background color. If not explicitly set, it defaults to a system default color.

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#` | This value cannot be `null`. |

### setPaddingBottom

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

```
fun setPaddingBottom(paddingBottom: Int): LocationButtonRequest.Builder
```

Sets the bottom padding of the button.

The padding must be between 4dp and 8dp (inclusive). This restricted range ensures a safe and standardized button appearance and touch target.

Values outside this range will be clamped. If not explicitly set, it defaults to 4dp.

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#` | This value cannot be `null`. |

### setPaddingLeft

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

```
fun setPaddingLeft(paddingLeft: Int): LocationButtonRequest.Builder
```

Sets the left padding of the button.

The padding must be between 4dp and 8dp (inclusive). This restricted range ensures a safe and standardized button appearance and touch target.

Values outside this range will be clamped. If not explicitly set, it defaults to 4dp.

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#` | This value cannot be `null`. |

### setPaddingRight

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

```
fun setPaddingRight(paddingRight: Int): LocationButtonRequest.Builder
```

Sets the right padding of the button.

The padding must be between 4dp and 8dp (inclusive). This restricted range ensures a safe and standardized button appearance and touch target.

Values outside this range will be clamped. If not explicitly set, it defaults to 4dp.

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#` | This value cannot be `null`. |

### setPaddingTop

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

```
fun setPaddingTop(paddingTop: Int): LocationButtonRequest.Builder
```

Sets the top padding of the button.

The padding must be between 4dp and 8dp (inclusive). This restricted range ensures a safe and standardized button appearance and touch target.

Values outside this range will be clamped. If not explicitly set, it defaults to 4dp.

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#` | This value cannot be `null`. |

### setPressedCornerRadius

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

```
fun setPressedCornerRadius(cornerRadius: Float): LocationButtonRequest.Builder
```

Sets the corner radius of the button when pressed.

The corner radius must be non-negative. Negative values will be clamped to 0.

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#` | This value cannot be `null`. |

### setStrokeColor

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

```
fun setStrokeColor(strokeColor: Int): LocationButtonRequest.Builder
```

Sets the stroke color of the button.

If not explicitly set, the stroke color will default to the button's background color.

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#` | This value cannot be `null`. |

### setStrokeWidth

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

```
fun setStrokeWidth(strokeWidth: Int): LocationButtonRequest.Builder
```

Sets the stroke width of the button.

The stroke width must be between 0 and 3dp (inclusive). Values outside this range will be clamped. If not explicitly set, it defaults to 0.

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#` | This value cannot be `null`. |

### setTextColor

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

```
fun setTextColor(textColor: Int): LocationButtonRequest.Builder
```

Sets the text color of the button.

The system will automatically adjust the provided color if necessary to ensure it meets a minimum contrast ratio of 4.5:1 against the button's background color. If not explicitly set, it defaults to a system default color.

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#` | This value cannot be `null`. |

### setTextType

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

```
fun setTextType(textType: Int): LocationButtonRequest.Builder
```

Sets the text type of the button.

Unsupported text types will be treated as `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonSession#TEXT_TYPE_NONE:kotlin.Int`. If not explicitly set, it defaults to `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonSession#TEXT_TYPE_NONE:kotlin.Int`.

| Parameters ||
|---|---|
| `textType` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Value is one of the following: - `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonSession#TEXT_TYPE_NONE:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonSession#TEXT_TYPE_PRECISE_LOCATION:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonSession#TEXT_TYPE_USE_PRECISE_LOCATION:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonSession#TEXT_TYPE_SHARE_PRECISE_LOCATION:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonSession#TEXT_TYPE_NEAR_MY_PRECISE_LOCATION:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonSession#TEXT_TYPE_NEAR_YOUR_PRECISE_LOCATION:kotlin.Int` |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/permissionui/LocationButtonRequest.Builder#` | This value cannot be `null`. |