{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

Orientation

public enum Orientation extends Enum

java.lang.Object
   ↳ kotlin.Enum
     ↳ androidx.compose.foundation.gestures.Orientation

Class to define possible directions in which common gesture modifiers like draggable and scrollable can drag.

Summary

Enum Values

Horizontal

Horizontal orientation representing X axis.

Vertical

Vertical orientation representing Y axis

Public methods

final @NonNull EnumEntries<@NonNull Orientation>

Class to define possible directions in which common gesture modifiers like draggable and scrollable can drag.

final @NonNull Orientation

Returns the enum constant of this type with the specified name.

final @NonNull Orientation[]

Returns an array containing the constants of this enum type, in the order they're declared.

Enum Values

Horizontal

Orientation Orientation.Horizontal

Horizontal orientation representing X axis.

Note: this value specifies just the axis, not the direction (left-to-right or right-to-left). To support RTL cases, use reverseDirection = true on scrollable and draggable.

Vertical

Orientation Orientation.Vertical

Vertical orientation representing Y axis

Public methods

getEntries

public final @NonNull EnumEntries<@NonNull OrientationgetEntries()

Class to define possible directions in which common gesture modifiers like draggable and scrollable can drag.

valueOf

public final @NonNull Orientation valueOf(@NonNull String value)

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Throws
kotlin.IllegalArgumentException

if this enum type has no constant with the specified name

values

public final @NonNull Orientation[] values()

Returns an array containing the constants of this enum type, in the order they're declared.

This method may be used to iterate over the constants.