DiscreteRotation.Companion


public static class DiscreteRotation.Companion


Summary

Public methods

static final @NonNull DiscreteRotation
from(int degrees)

Convert integer degrees to a DiscreteRotation

static final @NonNull DiscreteRotation
fromSurfaceRotation(int surfaceRotation)

Get a DiscreteRotation from Surface rotation values.

static final @NonNull DiscreteRotation
static final @NonNull DiscreteRotation
static final @NonNull DiscreteRotation
static final @NonNull DiscreteRotation
static final @NonNull DiscreteRotation
round(float degrees)

Round degrees to the nearest DiscreteRotation (0, 90, 180, 270).

static final @NonNull DiscreteRotation
round(int degrees)

Round degrees to the nearest DiscreteRotation (0, 90, 180, 270).

Public methods

from

Added in 1.7.0-alpha02
public static final @NonNull DiscreteRotation from(int degrees)

Convert integer degrees to a DiscreteRotation

fromSurfaceRotation

Added in 1.7.0-alpha02
public static final @NonNull DiscreteRotation fromSurfaceRotation(int surfaceRotation)

Get a DiscreteRotation from Surface rotation values.

Rotation values are relative to the device's "natural" rotation, Surface.ROTATION_0.

getROTATION_0

public static final @NonNull DiscreteRotation getROTATION_0()

getROTATION_180

public static final @NonNull DiscreteRotation getROTATION_180()

getROTATION_270

public static final @NonNull DiscreteRotation getROTATION_270()

getROTATION_90

public static final @NonNull DiscreteRotation getROTATION_90()

round

Added in 1.7.0-alpha02
public static final @NonNull DiscreteRotation round(float degrees)

Round degrees to the nearest DiscreteRotation (0, 90, 180, 270).

Negative values are rounded to the nearest positive DiscreteRotation (e.g. -90 rounds to 270). Boundary values (e.g. 45.0) are rounded up to the nearest 90-degree increment (e.g. 45.0 rounds to 90).

See also
round

round

Added in 1.7.0-alpha02
public static final @NonNull DiscreteRotation round(int degrees)

Round degrees to the nearest DiscreteRotation (0, 90, 180, 270).

Negative values are rounded to the nearest positive DiscreteRotation (e.g. -90 rounds to 270). Boundary values (e.g. 45) are rounded up to the nearest 90-degree increment (e.g. 45 rounds to 90).

See also
round