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

MenuItemColors

public final class MenuItemColors


Represents the text and icon colors used in a menu item at different states.

Summary

Public constructors

MenuItemColors(
    @NonNull Color textColor,
    @NonNull Color leadingIconColor,
    @NonNull Color trailingIconColor,
    @NonNull Color disabledTextColor,
    @NonNull Color disabledLeadingIconColor,
    @NonNull Color disabledTrailingIconColor
)

create an instance with arbitrary colors.

Public methods

final @NonNull MenuItemColors
copy(
    @NonNull Color textColor,
    @NonNull Color leadingIconColor,
    @NonNull Color trailingIconColor,
    @NonNull Color disabledTextColor,
    @NonNull Color disabledLeadingIconColor,
    @NonNull Color disabledTrailingIconColor
)

Returns a copy of this MenuItemColors, optionally overriding some of the values.

boolean
equals(Object other)
final @NonNull Color

the leading icon color of this DropdownMenuItemContent when not enabled

final @NonNull Color

the text color of this DropdownMenuItemContent when not enabled

final @NonNull Color

the trailing icon color of this DropdownMenuItemContent when not enabled

final @NonNull Color

the leading icon color of this DropdownMenuItemContent when enabled

final @NonNull Color

the text color of this DropdownMenuItemContent when enabled

final @NonNull Color

the trailing icon color of this DropdownMenuItemContent when enabled

int

Public constructors

public MenuItemColors(
    @NonNull Color textColor,
    @NonNull Color leadingIconColor,
    @NonNull Color trailingIconColor,
    @NonNull Color disabledTextColor,
    @NonNull Color disabledLeadingIconColor,
    @NonNull Color disabledTrailingIconColor
)

create an instance with arbitrary colors. See MenuDefaults.itemColors for the default colors used in a DropdownMenuItemContent.

Parameters
@NonNull Color textColor

the text color of this DropdownMenuItemContent when enabled

@NonNull Color leadingIconColor

the leading icon color of this DropdownMenuItemContent when enabled

@NonNull Color trailingIconColor

the trailing icon color of this DropdownMenuItemContent when enabled

@NonNull Color disabledTextColor

the text color of this DropdownMenuItemContent when not enabled

@NonNull Color disabledLeadingIconColor

the leading icon color of this DropdownMenuItemContent when not enabled

@NonNull Color disabledTrailingIconColor

the trailing icon color of this DropdownMenuItemContent when not enabled

Public methods

copy

public final @NonNull MenuItemColors copy(
    @NonNull Color textColor,
    @NonNull Color leadingIconColor,
    @NonNull Color trailingIconColor,
    @NonNull Color disabledTextColor,
    @NonNull Color disabledLeadingIconColor,
    @NonNull Color disabledTrailingIconColor
)

Returns a copy of this MenuItemColors, optionally overriding some of the values. This uses the Color.Unspecified to mean “use the value from the source”

equals

public boolean equals(Object other)

getDisabledLeadingIconColor

public final @NonNull Color getDisabledLeadingIconColor()

the leading icon color of this DropdownMenuItemContent when not enabled

getDisabledTextColor

public final @NonNull Color getDisabledTextColor()

the text color of this DropdownMenuItemContent when not enabled

getDisabledTrailingIconColor

public final @NonNull Color getDisabledTrailingIconColor()

the trailing icon color of this DropdownMenuItemContent when not enabled

getLeadingIconColor

public final @NonNull Color getLeadingIconColor()

the leading icon color of this DropdownMenuItemContent when enabled

getTextColor

public final @NonNull Color getTextColor()

the text color of this DropdownMenuItemContent when enabled

getTrailingIconColor

public final @NonNull Color getTrailingIconColor()

the trailing icon color of this DropdownMenuItemContent when enabled

hashCode

public int hashCode()