Rotation

public final class Rotation extends Object

Rotation constants in 90º increments for View rotation.

See Also

Nested Class Summary

@interface Rotation.Enum  

Constant Summary

int ADAPTIVE_CLOCKWISE Child is rotated clockwise in LTR, and counter-clockwise in RTL.
int ADAPTIVE_COUNTER_CLOCKWISE Child is rotated counter-clockwise in LTR, and clockwise in RTL.
int CLOCKWISE Child is always rotated clockwise, so its top is on the right.
int COUNTER_CLOCKWISE Child is always rotated counter-clockwise, so its top is on the left.
int NONE Child is not rotated.
int ROTATION_DIRECTION_MASK Rotation flag bit mask for clockwise or counter-clockwise directions.
int RTL_AWARE_BIT Rotation flag bit field to mark LTR/RTL aware roations.

Public Method Summary

static boolean
isRotated(int rotation)
static boolean
isRtlAware(int rotation)
static int
normalize(int rotation, View view)
static int
normalize(int rotation, int layoutDir)
static int
normalize(int rotation, boolean isRtl)

Inherited Method Summary

Constants

public static final int ADAPTIVE_CLOCKWISE

Child is rotated clockwise in LTR, and counter-clockwise in RTL.

Constant Value: 17

public static final int ADAPTIVE_COUNTER_CLOCKWISE

Child is rotated counter-clockwise in LTR, and clockwise in RTL.

Constant Value: 18

public static final int CLOCKWISE

Child is always rotated clockwise, so its top is on the right.

Constant Value: 1

public static final int COUNTER_CLOCKWISE

Child is always rotated counter-clockwise, so its top is on the left.

Constant Value: 2

public static final int NONE

Child is not rotated.

Constant Value: 0

public static final int ROTATION_DIRECTION_MASK

Rotation flag bit mask for clockwise or counter-clockwise directions.

Constant Value: 3

public static final int RTL_AWARE_BIT

Rotation flag bit field to mark LTR/RTL aware roations.

Constant Value: 16

Public Methods

public static boolean isRotated (int rotation)

Parameters
rotation
Returns
  • True if rotation represents rotation in either direction.

public static boolean isRtlAware (int rotation)

Parameters
rotation

public static int normalize (int rotation, View view)

Parameters
rotation
view
Returns
  • The absolute rotation direction in the context of view.

public static int normalize (int rotation, int layoutDir)

Parameters
rotation
layoutDir
Returns
  • The absolute rotation direction, given the provided layoutDir.

public static int normalize (int rotation, boolean isRtl)

Parameters
rotation
isRtl
Returns
  • The absolute rotation direction, accounting for right-to-left if isRtl is true.