# TestWearableButtonsProvider.TestWearableButtonLocation

Artifact: [androidx.wear:wear-input-testing](https://developer.android.com/jetpack/androidx/releases/wear) [View Source](https://cs.android.com/search?q=file:androidx/wear/input/testing/TestWearableButtonsProvider.java+class:androidx.wear.input.testing.TestWearableButtonsProvider.TestWearableButtonLocation) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear#1.0.0)

*** ** * ** ***


```
public class TestWearableButtonsProvider.TestWearableButtonLocation
```

<br />

*** ** * ** ***

Class describing the location of a button on a wearable device. This has two forms; it can either store the absolute location of the button, or store both the absolute location of the button, and the absolute location when the screen is rotated through 180 degrees.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/wear/input/testing/TestWearableButtonsProvider.TestWearableButtonLocation#TestWearableButtonLocation(float,float)(float x, float y)` Build a button location, with just the default button location. |
| `https://developer.android.com/reference/androidx/wear/input/testing/TestWearableButtonsProvider.TestWearableButtonLocation#TestWearableButtonLocation(float,float,float,float)( float x, float y, float rotatedX, float rotatedY )` Build a button location, with both the default button location, and the location when the device is rotated through 180 degrees. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/graphics/PointF.html` | `https://developer.android.com/reference/androidx/wear/input/testing/TestWearableButtonsProvider.TestWearableButtonLocation#getLocation()()` Get the location of this button. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/graphics/PointF.html` | `https://developer.android.com/reference/androidx/wear/input/testing/TestWearableButtonsProvider.TestWearableButtonLocation#getRotatedLocation()()` Get the location of this button when the device is rotated. |

## Public constructors

### TestWearableButtonLocation

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

```
public TestWearableButtonLocation(float x, float y)
```

Build a button location, with just the default button location.

| Parameters |
|---|---|
| `float x` | X coordinate of the button. |
| `float y` | Y coordinate of the button. |

### TestWearableButtonLocation

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

```
public TestWearableButtonLocation(
    float x,
    float y,
    float rotatedX,
    float rotatedY
)
```

Build a button location, with both the default button location, and the location when the device is rotated through 180 degrees.

| Parameters |
|---|---|
| `float x` | X coordinate of the button. |
| `float y` | Y coordinate of the button. |
| `float rotatedX` | X coordinate of the button when the device is rotated. |
| `float rotatedY` | Y coordinate of the button when the device is rotated. |

## Public methods

### getLocation

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

```
public @NonNull PointF getLocation()
```

Get the location of this button.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/graphics/PointF.html` | A point specifying the location of this button. |

### getRotatedLocation

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

```
public @Nullable PointF getRotatedLocation()
```

Get the location of this button when the device is rotated.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/graphics/PointF.html` | A point specifying the location of this button when the device is rotated. |