Google is committed to advancing racial equity for Black communities. See how.

TestWearableButtonLocation

open class TestWearableButtonLocation
kotlin.Any
   ↳ androidx.wear.input.testing.TestWearableButtonsProvider.TestWearableButtonLocation

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
<init>(x: Float, y: Float)

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

<init>(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.

Public methods
open PointF

Get the location of this button.

open PointF?

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

Public constructors

<init>

TestWearableButtonLocation(
    x: Float,
    y: Float)

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

Parameters
x Float: X coordinate of the button.
y Float: Y coordinate of the button.

<init>

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: X coordinate of the button.
y Float: Y coordinate of the button.
rotatedX Float: X coordinate of the button when the device is rotated.
rotatedY Float: Y coordinate of the button when the device is rotated.

Public methods

getLocation

@NonNull open fun getLocation(): PointF

Get the location of this button.

Return
PointF A point specifying the location of this button.

getRotatedLocation

@Nullable open fun getRotatedLocation(): PointF?

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

Return
PointF? A point specifying the location of this button when the device is rotated.