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,
    selectedTextColor: Color,
    selectedLeadingIconColor: Color,
    selectedTrailingIconColor: Color,
    selectedContainerColor: Color
)
Cmn

Public functions

MenuItemColors
copy(
    textColor: Color,
    leadingIconColor: Color,
    trailingContentColor: Color,
    disabledTextColor: Color,
    disabledLeadingIconColor: Color,
    disabledTrailingContentColor: Color
)

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

Cmn
MenuItemColors
copy(
    textColor: Color,
    containerColor: Color,
    leadingIconColor: Color,
    trailingContentColor: Color,
    disabledTextColor: Color,
    disabledContainerColor: Color,
    disabledLeadingIconColor: Color,
    disabledTrailingContentColor: Color,
    selectedTextColor: Color,
    selectedContainerColor: Color,
    selectedLeadingIconColor: Color,
    selectedTrailingContentColor: Color
)

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

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

Public properties

Color

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

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 content color of this menu item when not enabled.

Cmn
Color

This property is deprecated. Use disabledTrailingContentColor instead.

Cmn
Color

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

Cmn
Color

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

Cmn
Color

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

Cmn
Color

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

Cmn
Color

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

Cmn
Color

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

Cmn
Color

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

Cmn
Color

This property is deprecated. Use trailingContentColor instead.

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,
    selectedTextColor: Color,
    selectedLeadingIconColor: Color,
    selectedTrailingIconColor: Color,
    selectedContainerColor: Color
)

Public functions

copy

fun copy(
    textColor: Color = this.textColor,
    leadingIconColor: Color = this.leadingIconColor,
    trailingContentColor: Color = this.trailingContentColor,
    disabledTextColor: Color = this.disabledTextColor,
    disabledLeadingIconColor: Color = this.disabledLeadingIconColor,
    disabledTrailingContentColor: Color = this.disabledTrailingContentColor
): 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,
    trailingContentColor: Color = this.trailingContentColor,
    disabledTextColor: Color = this.disabledTextColor,
    disabledContainerColor: Color = this.disabledContainerColor,
    disabledLeadingIconColor: Color = this.disabledLeadingIconColor,
    disabledTrailingContentColor: Color = this.disabledTrailingContentColor,
    selectedTextColor: Color = this.selectedTextColor,
    selectedContainerColor: Color = this.selectedContainerColor,
    selectedLeadingIconColor: Color = this.selectedLeadingIconColor,
    selectedTrailingContentColor: Color = this.selectedTrailingContentColor
): 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 containerColorColor

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

disabledContainerColor

val disabledContainerColorColor

The container color of this menu item when not enabled

disabledLeadingIconColor

val disabledLeadingIconColorColor

the leading icon color of this DropdownMenuItem when not enabled

disabledTextColor

val disabledTextColorColor

the text color of this DropdownMenuItem when not enabled

disabledTrailingContentColor

val disabledTrailingContentColorColor

The trailing content color of this menu item when not enabled.

disabledTrailingIconColor

val disabledTrailingIconColorColor

the trailing icon color of this DropdownMenuItem when not enabled

leadingIconColor

val leadingIconColorColor

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

selectedContainerColor

val selectedContainerColorColor

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

selectedLeadingIconColor

val selectedLeadingIconColorColor

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

selectedTextColor

val selectedTextColorColor

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

selectedTrailingContentColor

val selectedTrailingContentColorColor

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

textColor

val textColorColor

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

trailingContentColor

val trailingContentColorColor

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

trailingIconColor

val trailingIconColorColor

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