Enum Class LayoutType
- All Implemented Interfaces:
Serializable,Comparable<LayoutType>,Constable
Enum to define the available layout types for CardView.
Defines two states: compact (default) and expanded (with expansion handle).
- Since:
- 21.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic LayoutTypefromString(String name) Converts a string to the corresponding LayoutTypeGets the layout namebooleanChecks if this layout is of compact typebooleanChecks if this layout is of expanded typetoString()static LayoutTypeReturns the enum constant of this class with the specified name.static LayoutType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
COMPACT
Compact layout - standard card display (initial state) -
EXPANDED
Expanded layout - used when the card is expanded via handle
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getLayoutName
Gets the layout name- Returns:
- The layout name as string
-
fromString
Converts a string to the corresponding LayoutType- Parameters:
name- The layout name- Returns:
- The corresponding LayoutType, or COMPACT if not found
-
isExpanded
public boolean isExpanded()Checks if this layout is of expanded type- Returns:
- true if the layout is expanded
-
isCompact
public boolean isCompact()Checks if this layout is of compact type- Returns:
- true if the layout is compact
-
toString
- Overrides:
toStringin classEnum<LayoutType>
-