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
)

Creates an instance with colors for a standard menu item.

Cmn
@ExperimentalMaterial3ExpressiveApi
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
)

create an instance with arbitrary colors.

Cmn

Public functions

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

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

Cmn
MenuItemColors
@ExperimentalMaterial3ExpressiveApi
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
)

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 DropdownMenuItemContent when not enabled

Cmn
Color

the text color of this DropdownMenuItemContent when not enabled

Cmn
Color

the trailing icon color of this DropdownMenuItemContent when not enabled

Cmn
Color

the leading icon color of this DropdownMenuItemContent when enabled

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 icon color of this menu item when enabled and selected.

Cmn
Color

the text color of this DropdownMenuItemContent when enabled

Cmn
Color

the trailing icon color of this DropdownMenuItemContent when enabled

Cmn

Public constructors

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

Creates an instance with colors for a standard menu item.

This constructor is used for DropdownMenuItem.

Parameters
textColor: Color

the text color of this menu item when enabled

leadingIconColor: Color

the leading icon color of this menu item when enabled

trailingIconColor: Color

the trailing icon color of this menu item when enabled

disabledTextColor: Color

the text color of this menu item when not enabled

disabledLeadingIconColor: Color

the leading icon color of this menu item when not enabled

disabledTrailingIconColor: Color

the trailing icon color of this menu item when not enabled

@ExperimentalMaterial3ExpressiveApi
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
)

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

Parameters
textColor: Color

the text color of this DropdownMenuItemContent when enabled

leadingIconColor: Color

the leading icon color of this DropdownMenuItemContent when enabled

trailingIconColor: Color

the trailing icon color of this DropdownMenuItemContent when enabled

disabledTextColor: Color

the text color of this DropdownMenuItemContent when not enabled

disabledLeadingIconColor: Color

the leading icon color of this DropdownMenuItemContent when not enabled

disabledTrailingIconColor: Color

the trailing icon color of this DropdownMenuItemContent when not enabled

containerColor: Color

the container color of this menu item when enabled and unselected

disabledContainerColor: Color

the container color of this menu item when not enabled

selectedTextColor: Color

the text color of this menu item when enabled and selected

selectedLeadingIconColor: Color

the leading icon color of this menu item when enabled and selected

selectedTrailingIconColor: Color

the trailing icon color of this menu item when enabled and selected

selectedContainerColor: Color

the container color of this menu item when enabled and selected

Public functions

copy

fun copy(
    textColor: Color = this.textColor,
    leadingIconColor: Color = this.leadingIconColor,
    trailingIconColor: Color = this.trailingIconColor,
    disabledTextColor: Color = this.disabledTextColor,
    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

@ExperimentalMaterial3ExpressiveApi
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 = this.selectedTextColor,
    selectedContainerColor: Color = this.selectedContainerColor,
    selectedLeadingIconColor: Color = this.selectedLeadingIconColor,
    selectedTrailingIconColor: Color = this.selectedTrailingIconColor
): 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

@ExperimentalMaterial3ExpressiveApi
val containerColorColor

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

disabledContainerColor

@ExperimentalMaterial3ExpressiveApi
val disabledContainerColorColor

The container color of this menu item when not enabled

disabledLeadingIconColor

val disabledLeadingIconColorColor

the leading icon color of this DropdownMenuItemContent when not enabled

disabledTextColor

val disabledTextColorColor

the text color of this DropdownMenuItemContent when not enabled

disabledTrailingIconColor

val disabledTrailingIconColorColor

the trailing icon color of this DropdownMenuItemContent when not enabled

leadingIconColor

val leadingIconColorColor

the leading icon color of this DropdownMenuItemContent when enabled

selectedContainerColor

@ExperimentalMaterial3ExpressiveApi
val selectedContainerColorColor

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

selectedLeadingIconColor

@ExperimentalMaterial3ExpressiveApi
val selectedLeadingIconColorColor

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

selectedTextColor

@ExperimentalMaterial3ExpressiveApi
val selectedTextColorColor

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

selectedTrailingIconColor

@ExperimentalMaterial3ExpressiveApi
val selectedTrailingIconColorColor

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

textColor

val textColorColor

the text color of this DropdownMenuItemContent when enabled

trailingIconColor

val trailingIconColorColor

the trailing icon color of this DropdownMenuItemContent when enabled