Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/app/permissionui/LocationButtonRequest.Builder#pubctors) \| [Methods](https://developer.android.com/reference/android/app/permissionui/LocationButtonRequest.Builder#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/app/permissionui/LocationButtonRequest.Builder#inhmethods)

# LocationButtonRequest.Builder

*** ** * ** ***

` public static final class LocationButtonRequest.Builder `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.app.permissionui.LocationButtonRequest.Builder |

<br />

*** ** * ** ***

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

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/app/permissionui/LocationButtonRequest.Builder#Builder(int,%20int,%20android.content.res.Configuration)(int width, int height, https://developer.android.com/reference/android/content/res/Configuration configuration) ` Creates a new Builder with the required initial properties. |

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

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public constructors

### Builder

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

```
public Builder (int width, 
                int height, 
                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.

<br />

| Parameters ||
|---|---|
| `width` | `int`: The total width of the button in pixels. <br /> |
| `height` | `int`: The total height of the button in pixels. <br /> |
| `configuration` | `Configuration`: The `https://developer.android.com/reference/android/content/res/Configuration` of the context hosting the button. This value cannot be `null`. <br /> |

## Public methods

### build

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

```
public LocationButtonRequest build ()
```

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

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/permissionui/LocationButtonRequest` | This value cannot be `null`. <br /> |

### setBackgroundColor

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

```
public LocationButtonRequest.Builder setBackgroundColor (int backgroundColor)
```

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.

<br />

| Parameters ||
|---|---|
| `backgroundColor` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/permissionui/LocationButtonRequest.Builder` | This value cannot be `null`. <br /> |

### setCornerRadius

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

```
public LocationButtonRequest.Builder setCornerRadius (float cornerRadius)
```

Sets the corner radius of the button.

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

<br />

| Parameters ||
|---|---|
| `cornerRadius` | `float` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/permissionui/LocationButtonRequest.Builder` | This value cannot be `null`. <br /> |

### setIconTint

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

```
public LocationButtonRequest.Builder setIconTint (int iconTint)
```

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.

<br />

| Parameters ||
|---|---|
| `iconTint` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/permissionui/LocationButtonRequest.Builder` | This value cannot be `null`. <br /> |

### setPaddingBottom

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

```
public LocationButtonRequest.Builder setPaddingBottom (int paddingBottom)
```

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.

<br />

| Parameters ||
|---|---|
| `paddingBottom` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/permissionui/LocationButtonRequest.Builder` | This value cannot be `null`. <br /> |

### setPaddingLeft

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

```
public LocationButtonRequest.Builder setPaddingLeft (int paddingLeft)
```

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.

<br />

| Parameters ||
|---|---|
| `paddingLeft` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/permissionui/LocationButtonRequest.Builder` | This value cannot be `null`. <br /> |

### setPaddingRight

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

```
public LocationButtonRequest.Builder setPaddingRight (int paddingRight)
```

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.

<br />

| Parameters ||
|---|---|
| `paddingRight` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/permissionui/LocationButtonRequest.Builder` | This value cannot be `null`. <br /> |

### setPaddingTop

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

```
public LocationButtonRequest.Builder setPaddingTop (int paddingTop)
```

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.

<br />

| Parameters ||
|---|---|
| `paddingTop` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/permissionui/LocationButtonRequest.Builder` | This value cannot be `null`. <br /> |

### setPressedCornerRadius

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

```
public LocationButtonRequest.Builder setPressedCornerRadius (float cornerRadius)
```

Sets the corner radius of the button when pressed.

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

<br />

| Parameters ||
|---|---|
| `cornerRadius` | `float` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/permissionui/LocationButtonRequest.Builder` | This value cannot be `null`. <br /> |

### setStrokeColor

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

```
public LocationButtonRequest.Builder setStrokeColor (int strokeColor)
```

Sets the stroke color of the button.

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

<br />

| Parameters ||
|---|---|
| `strokeColor` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/permissionui/LocationButtonRequest.Builder` | This value cannot be `null`. <br /> |

### setStrokeWidth

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

```
public LocationButtonRequest.Builder setStrokeWidth (int strokeWidth)
```

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.

<br />

| Parameters ||
|---|---|
| `strokeWidth` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/permissionui/LocationButtonRequest.Builder` | This value cannot be `null`. <br /> |

### setTextColor

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

```
public LocationButtonRequest.Builder setTextColor (int textColor)
```

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.

<br />

| Parameters ||
|---|---|
| `textColor` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/permissionui/LocationButtonRequest.Builder` | This value cannot be `null`. <br /> |

### setTextType

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

```
public LocationButtonRequest.Builder setTextType (int textType)
```

Sets the text type of the button.

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

<br />

| Parameters ||
|---|---|
| `textType` | `int`: Value is one of the following: - `https://developer.android.com/reference/android/app/permissionui/LocationButtonSession#TEXT_TYPE_NONE` - `https://developer.android.com/reference/android/app/permissionui/LocationButtonSession#TEXT_TYPE_PRECISE_LOCATION` - `https://developer.android.com/reference/android/app/permissionui/LocationButtonSession#TEXT_TYPE_USE_PRECISE_LOCATION` - `https://developer.android.com/reference/android/app/permissionui/LocationButtonSession#TEXT_TYPE_SHARE_PRECISE_LOCATION` - `https://developer.android.com/reference/android/app/permissionui/LocationButtonSession#TEXT_TYPE_NEAR_MY_PRECISE_LOCATION` - `https://developer.android.com/reference/android/app/permissionui/LocationButtonSession#TEXT_TYPE_NEAR_YOUR_PRECISE_LOCATION` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/permissionui/LocationButtonRequest.Builder` | This value cannot be `null`. <br /> |