Enum Orientation

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Orientation>

    public enum Orientation
    extends java.lang.Enum<Orientation>
    • Enum Constant Detail

      • ORIENTATION_PORTRAIT

        public static final Orientation ORIENTATION_PORTRAIT
        Device is in portrait mode and buttons are below screen
      • ORIENTATION_LANDSCAPE_RIGHT

        public static final Orientation ORIENTATION_LANDSCAPE_RIGHT
        Device is in landscape mode and buttons are right of screen
      • ORIENTATION_PORTRAIT_UPSIDE

        public static final Orientation ORIENTATION_PORTRAIT_UPSIDE
        Device is in portrait mode and buttons are above screen
      • ORIENTATION_LANDSCAPE_LEFT

        public static final Orientation ORIENTATION_LANDSCAPE_LEFT
        Device is in landscape mode and buttons are left of screen
      • ORIENTATION_UNKNOWN

        public static final Orientation ORIENTATION_UNKNOWN
        Device is lying on the table
    • Method Detail

      • values

        public static Orientation[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Orientation c : Orientation.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Orientation valueOf​(java.lang.String name)
        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.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • intValue

        public int intValue()
      • isVertical

        public boolean isVertical()
        Returns:
        true if this orientation is vertical (portrait or inverse portrai)
      • isHorizontal

        public boolean isHorizontal()
        Returns:
        true if this orientation is horizontal (landscape)
      • rotate90Clockwise

        @NonNull
        public Orientation rotate90Clockwise()
        Returns orientation obtained by rotating current orientation by 90 degrees clockwise.
        Returns:
        orientation obtained by rotating current orientation by 90 degrees clockwise.
      • rotate90CounterClockwise

        @NonNull
        public Orientation rotate90CounterClockwise()
        Returns orientation obtained by rotating current orientation by 90 degrees counter-clockwise.
        Returns:
        orientation obtained by rotating current orientation by 90 degrees counter-clockwise.
      • rotate180

        @NonNull
        public Orientation rotate180()
        Returns orientation obtained by rotating current orientation by 180 degrees.
        Returns:
        orientation obtained by rotating current orientation by 180 degrees.
      • toString

        @NonNull
        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Enum<Orientation>
      • fromInt

        @NonNull
        public static Orientation fromInt​(int value)
      • fromActivityInfoCode

        @NonNull
        public static Orientation fromActivityInfoCode​(int value)