MenuItemColors


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

Summary

Public constructors

MenuItemColors(
    textColor: Color,
    leadingIconColor: Color,
    trailingIconColor: Color,
    disabledTextColor: Color,
    disabledLeadingIconColor: Color,
    disabledTrailingIconColor: Color
)

create an instance with arbitrary colors.

Cmn
MenuItemColors(
    textColor: Color,
    leadingIconColor: Color,
    trailingIconColor: Color,
    disabledTextColor: Color,
    disabledLeadingIconColor: Color,
    disabledTrailingIconColor: Color,
    containerColor: Color,
    disabledContainerColor: Color
)
Cmn
MenuItemColors(
    textColor: Color,
    leadingIconColor: Color,
    trailingIconColor: Color,
    disabledTextColor: Color,
    disabledLeadingIconColor: Color,
    disabledTrailingIconColor: Color,
    selectedTextColor: Color,
    selectedContainerColor: Color,
    selectedLeadingIconColor: Color,
    selectedTrailingIconColor: Color
)

This function is deprecated. MenuItemColors no longer supports selected colors.

Cmn
MenuItemColors(
    textColor: Color,
    leadingIconColor: Color,
    trailingIconColor: Color,
    disabledTextColor: Color,
    disabledLeadingIconColor: Color,
    disabledTrailingIconColor: Color,
    containerColor: Color,
    disabledContainerColor: Color,
    selectedTextColor: Color,
    selectedContainerColor: Color,
    selectedLeadingIconColor: Color,
    selectedTrailingIconColor: Color
)

This function is deprecated. MenuItemColors no longer supports selected colors.

Cmn

Public functions

MenuItemColors
copy(
    textColor: Color,
    containerColor: Color,
    leadingIconColor: Color,
    trailingIconColor: Color,
    disabledTextColor: Color,
    disabledContainerColor: Color,
    disabledLeadingIconColor: Color,
    disabledTrailingIconColor: Color
)

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

Cmn
MenuItemColors
copy(
    textColor: Color,
    containerColor: Color,
    leadingIconColor: Color,
    trailingIconColor: Color,
    disabledTextColor: Color,
    disabledContainerColor: Color,
    disabledLeadingIconColor: Color,
    disabledTrailingIconColor: Color,
    selectedTextColor: Color,
    selectedContainerColor: Color,
    selectedLeadingIconColor: Color,
    selectedTrailingIconColor: Color
)

This function is deprecated. MenuItemColors no longer supports selected colors.

Cmn
open operator Boolean
equals(other: Any?)
Cmn
open Int
Cmn

Public properties

Color

The container color of this menu item when enabled.

Cmn
Color

The container color of this menu item when not enabled.

Cmn
Color

the leading icon color of this DropdownMenuItem when not enabled

Cmn
Color

the text color of this DropdownMenuItem when not enabled

Cmn
Color

the trailing icon color of this DropdownMenuItem when not enabled

Cmn
Color

the leading icon color of this DropdownMenuItem when enabled and unselected / unchecked.

Cmn
Color

This property is deprecated. Use SelectableMenuItemColors instead.

Cmn
Color

This property is deprecated. Use SelectableMenuItemColors instead.

Cmn
Color

This property is deprecated. Use SelectableMenuItemColors instead.

Cmn
Color

This property is deprecated. Use SelectableMenuItemColors instead.

Cmn
Color

This property is deprecated. Use SelectableMenuItemColors instead.

Cmn
Color

the text color of this DropdownMenuItem when enabled and unselected / unchecked.

Cmn
Color

the trailing icon color of this DropdownMenuItem when enabled and unselected / unchecked.

Cmn

Public constructors

MenuItemColors(
    textColor: Color,
    leadingIconColor: Color,
    trailingIconColor: Color,
    disabledTextColor: Color,
    disabledLeadingIconColor: Color,
    disabledTrailingIconColor: Color
)

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

Parameters
textColor: Color

the text color of this DropdownMenuItem when enabled and unselected / unchecked.

leadingIconColor: Color

the leading icon color of this DropdownMenuItem when enabled and unselected / unchecked.

trailingIconColor: Color

the trailing icon color of this DropdownMenuItem when enabled and unselected / unchecked.

disabledTextColor: Color

the text color of this DropdownMenuItem when not enabled

disabledLeadingIconColor: Color

the leading icon color of this DropdownMenuItem when not enabled

disabledTrailingIconColor: Color

the trailing icon color of this DropdownMenuItem when not enabled

MenuItemColors(
    textColor: Color,
    leadingIconColor: Color,
    trailingIconColor: Color,
    disabledTextColor: Color,
    disabledLeadingIconColor: Color,
    disabledTrailingIconColor: Color,
    containerColor: Color,
    disabledContainerColor: Color
)
MenuItemColors(
    textColor: Color = Color.Unspecified,
    leadingIconColor: Color = Color.Unspecified,
    trailingIconColor: Color = Color.Unspecified,
    disabledTextColor: Color = Color.Unspecified,
    disabledLeadingIconColor: Color = Color.Unspecified,
    disabledTrailingIconColor: Color = Color.Unspecified,
    selectedTextColor: Color = Color.Unspecified,
    selectedContainerColor: Color = Color.Unspecified,
    selectedLeadingIconColor: Color = Color.Unspecified,
    selectedTrailingIconColor: Color = Color.Unspecified
)
MenuItemColors(
    textColor: Color,
    leadingIconColor: Color,
    trailingIconColor: Color,
    disabledTextColor: Color,
    disabledLeadingIconColor: Color,
    disabledTrailingIconColor: Color,
    containerColor: Color,
    disabledContainerColor: Color,
    selectedTextColor: Color,
    selectedContainerColor: Color,
    selectedLeadingIconColor: Color,
    selectedTrailingIconColor: Color
)

Public functions

copy

fun copy(
    textColor: Color = this.textColor,
    containerColor: Color = this.containerColor,
    leadingIconColor: Color = this.leadingIconColor,
    trailingIconColor: Color = this.trailingIconColor,
    disabledTextColor: Color = this.disabledTextColor,
    disabledContainerColor: Color = this.disabledContainerColor,
    disabledLeadingIconColor: Color = this.disabledLeadingIconColor,
    disabledTrailingIconColor: Color = this.disabledTrailingIconColor
): MenuItemColors

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”

copy

fun copy(
    textColor: Color = this.textColor,
    containerColor: Color = this.containerColor,
    leadingIconColor: Color = this.leadingIconColor,
    trailingIconColor: Color = this.trailingIconColor,
    disabledTextColor: Color = this.disabledTextColor,
    disabledContainerColor: Color = this.disabledContainerColor,
    disabledLeadingIconColor: Color = this.disabledLeadingIconColor,
    disabledTrailingIconColor: Color = this.disabledTrailingIconColor,
    selectedTextColor: Color = Color.Unspecified,
    selectedContainerColor: Color = Color.Unspecified,
    selectedLeadingIconColor: Color = Color.Unspecified,
    selectedTrailingIconColor: Color = Color.Unspecified
): MenuItemColors

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

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

Public properties

containerColor

val containerColor: Color

The container color of this menu item when enabled.

disabledContainerColor

val disabledContainerColor: Color

The container color of this menu item when not enabled.

disabledLeadingIconColor

val disabledLeadingIconColor: Color

the leading icon color of this DropdownMenuItem when not enabled

disabledTextColor

val disabledTextColor: Color

the text color of this DropdownMenuItem when not enabled

disabledTrailingIconColor

val disabledTrailingIconColor: Color

the trailing icon color of this DropdownMenuItem when not enabled

leadingIconColor

val leadingIconColor: Color

the leading icon color of this DropdownMenuItem when enabled and unselected / unchecked.

selectedContainerColor

val selectedContainerColor: Color

The container color of this menu item when enabled and selected.

selectedLeadingIconColor

val selectedLeadingIconColor: Color

The leading icon color of this menu item when enabled and selected.

selectedTextColor

val selectedTextColor: Color

The text color of this menu item when enabled and selected.

selectedTrailingContentColor

val selectedTrailingContentColor: Color

The trailing content color of this menu item when enabled and selected.

selectedTrailingIconColor

val selectedTrailingIconColor: Color

The trailing icon color of this menu item when enabled and selected.

textColor

val textColor: Color

the text color of this DropdownMenuItem when enabled and unselected / unchecked.

trailingIconColor

val trailingIconColor: Color

the trailing icon color of this DropdownMenuItem when enabled and unselected / unchecked.