TestWearableButtonsProvider.TestWearableButtonLocation

public class 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

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

TestWearableButtonLocation(
    @NonNull float x,
    @NonNull float y,
    @NonNull float rotatedX,
    @NonNull 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

@NonNull PointF

Get the location of this button.

@Nullable PointF

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

Public constructors

TestWearableButtonLocation

public TestWearableButtonLocation(@NonNull float x, @NonNull float y)

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

Parameters
@NonNull float x

X coordinate of the button.

@NonNull float y

Y coordinate of the button.

TestWearableButtonLocation

public TestWearableButtonLocation(
    @NonNull float x,
    @NonNull float y,
    @NonNull float rotatedX,
    @NonNull float rotatedY
)

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

Parameters
@NonNull float x

X coordinate of the button.

@NonNull float y

Y coordinate of the button.

@NonNull float rotatedX

X coordinate of the button when the device is rotated.

@NonNull float rotatedY

Y coordinate of the button when the device is rotated.

Public methods

getLocation

@NonNull
public PointF getLocation()

Get the location of this button.

Returns
PointF

A point specifying the location of this button.

getRotatedLocation

@Nullable
@NonNull
public PointF getRotatedLocation()

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

Returns
PointF

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