# TestWearableButtonsProvider.TestWearableButtonLocation

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/wear/input/testing/TestWearableButtonsProvider.TestWearableButtonLocation "View this page in Java")

<br />

```
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                                                                                                                                                                                                                                                                                                                                                           |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [TestWearableButtonLocation](https://developer.android.com/reference/kotlin/androidx/wear/input/testing/TestWearableButtonsProvider.TestWearableButtonLocation#TestWearableButtonLocation(float,float))`(x: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`, y: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Build a button location, with just the default button location.                                                                                                                                                                                                                                                                                      |
| [TestWearableButtonLocation](https://developer.android.com/reference/kotlin/androidx/wear/input/testing/TestWearableButtonsProvider.TestWearableButtonLocation#TestWearableButtonLocation(float,float,float,float))`(` ` x: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`,` ` y: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`,` ` rotatedX: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`,` ` rotatedY: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) `)` Build a button location, with both the default button location, and the location when the device is rotated through 180 degrees. |

|                               ### Public functions                                |
|-----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [PointF](https://developer.android.com/reference/android/graphics/PointF.html)    | [getLocation](https://developer.android.com/reference/kotlin/androidx/wear/input/testing/TestWearableButtonsProvider.TestWearableButtonLocation#getLocation())`()` Get the location of this button.                                          |
| [PointF](https://developer.android.com/reference/android/graphics/PointF.html)`?` | [getRotatedLocation](https://developer.android.com/reference/kotlin/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)  

```
TestWearableButtonLocation(x: Float, y: Float)
```

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

|                                      Parameters                                      |
|--------------------------------------------------------------------------------------|-----------------------------|
| `x: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | X coordinate of the button. |
| `y: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | Y coordinate of the button. |

### TestWearableButtonLocation

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

```
TestWearableButtonLocation(
    x: Float,
    y: Float,
    rotatedX: Float,
    rotatedY: Float
)
```

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

|                                         Parameters                                          |
|---------------------------------------------------------------------------------------------|--------------------------------------------------------|
| `x: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)        | X coordinate of the button.                            |
| `y: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)        | Y coordinate of the button.                            |
| `rotatedX: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | X coordinate of the button when the device is rotated. |
| `rotatedY: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | Y coordinate of the button when the device is rotated. |

## Public functions

### getLocation

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

```
fun getLocation(): PointF
```

Get the location of this button.  

|                                    Returns                                     |
|--------------------------------------------------------------------------------|-------------------------------------------------|
| [PointF](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)  

```
fun getRotatedLocation(): PointF?
```

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

|                                      Returns                                      |
|-----------------------------------------------------------------------------------|----------------------------------------------------------------------------|
| [PointF](https://developer.android.com/reference/android/graphics/PointF.html)`?` | A point specifying the location of this button when the device is rotated. |