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

SegmentedButtonColors

@ExperimentalMaterial3Api
public final class SegmentedButtonColors


The different colors used in parts of the SegmentedButton in different states

Summary

Public constructors

SegmentedButtonColors(
    @NonNull Color activeContainerColor,
    @NonNull Color activeContentColor,
    @NonNull Color activeBorderColor,
    @NonNull Color inactiveContainerColor,
    @NonNull Color inactiveContentColor,
    @NonNull Color inactiveBorderColor,
    @NonNull Color disabledActiveContainerColor,
    @NonNull Color disabledActiveContentColor,
    @NonNull Color disabledActiveBorderColor,
    @NonNull Color disabledInactiveContainerColor,
    @NonNull Color disabledInactiveContentColor,
    @NonNull Color disabledInactiveBorderColor
)

create an instance with arbitrary colors, see SegmentedButtonDefaults for a factory method using the default material3 spec

Public methods

final @NonNull SegmentedButtonColors
copy(
    @NonNull Color activeContainerColor,
    @NonNull Color activeContentColor,
    @NonNull Color activeBorderColor,
    @NonNull Color inactiveContainerColor,
    @NonNull Color inactiveContentColor,
    @NonNull Color inactiveBorderColor,
    @NonNull Color disabledActiveContainerColor,
    @NonNull Color disabledActiveContentColor,
    @NonNull Color disabledActiveBorderColor,
    @NonNull Color disabledInactiveContainerColor,
    @NonNull Color disabledInactiveContentColor,
    @NonNull Color disabledInactiveBorderColor
)

Returns a copy of this ChipColors, optionally overriding some of the ues.

boolean
equals(Object other)
final @NonNull Color

the color used for the border when enabled and active

final @NonNull Color

the color used for the container when enabled and active

final @NonNull Color

the color used for the content when enabled and active

final @NonNull Color

the color used for the border when disabled and active

final @NonNull Color

the color used for the container when disabled and active

final @NonNull Color

the color used for the content when disabled and active

final @NonNull Color

the color used for the border when disabled and inactive

final @NonNull Color

the color used for the container when disabled and inactive

final @NonNull Color

the color used for the content when disabled and inactive

final @NonNull Color

the color used for the border when enabled and active

final @NonNull Color

the color used for the container when enabled and inactive

final @NonNull Color

the color used for the content when enabled and inactive

int

Public constructors

SegmentedButtonColors

public SegmentedButtonColors(
    @NonNull Color activeContainerColor,
    @NonNull Color activeContentColor,
    @NonNull Color activeBorderColor,
    @NonNull Color inactiveContainerColor,
    @NonNull Color inactiveContentColor,
    @NonNull Color inactiveBorderColor,
    @NonNull Color disabledActiveContainerColor,
    @NonNull Color disabledActiveContentColor,
    @NonNull Color disabledActiveBorderColor,
    @NonNull Color disabledInactiveContainerColor,
    @NonNull Color disabledInactiveContentColor,
    @NonNull Color disabledInactiveBorderColor
)

create an instance with arbitrary colors, see SegmentedButtonDefaults for a factory method using the default material3 spec

Parameters
@NonNull Color activeContainerColor

the color used for the container when enabled and active

@NonNull Color activeContentColor

the color used for the content when enabled and active

@NonNull Color activeBorderColor

the color used for the border when enabled and active

@NonNull Color inactiveContainerColor

the color used for the container when enabled and inactive

@NonNull Color inactiveContentColor

the color used for the content when enabled and inactive

@NonNull Color inactiveBorderColor

the color used for the border when enabled and active

@NonNull Color disabledActiveContainerColor

the color used for the container when disabled and active

@NonNull Color disabledActiveContentColor

the color used for the content when disabled and active

@NonNull Color disabledActiveBorderColor

the color used for the border when disabled and active

@NonNull Color disabledInactiveContainerColor

the color used for the container when disabled and inactive

@NonNull Color disabledInactiveContentColor

the color used for the content when disabled and inactive

@NonNull Color disabledInactiveBorderColor

the color used for the border when disabled and inactive

Public methods

copy

public final @NonNull SegmentedButtonColors copy(
    @NonNull Color activeContainerColor,
    @NonNull Color activeContentColor,
    @NonNull Color activeBorderColor,
    @NonNull Color inactiveContainerColor,
    @NonNull Color inactiveContentColor,
    @NonNull Color inactiveBorderColor,
    @NonNull Color disabledActiveContainerColor,
    @NonNull Color disabledActiveContentColor,
    @NonNull Color disabledActiveBorderColor,
    @NonNull Color disabledInactiveContainerColor,
    @NonNull Color disabledInactiveContentColor,
    @NonNull Color disabledInactiveBorderColor
)

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

equals

public boolean equals(Object other)

getActiveBorderColor

public final @NonNull Color getActiveBorderColor()

the color used for the border when enabled and active

getActiveContainerColor

public final @NonNull Color getActiveContainerColor()

the color used for the container when enabled and active

getActiveContentColor

public final @NonNull Color getActiveContentColor()

the color used for the content when enabled and active

getDisabledActiveBorderColor

public final @NonNull Color getDisabledActiveBorderColor()

the color used for the border when disabled and active

getDisabledActiveContainerColor

public final @NonNull Color getDisabledActiveContainerColor()

the color used for the container when disabled and active

getDisabledActiveContentColor

public final @NonNull Color getDisabledActiveContentColor()

the color used for the content when disabled and active

getDisabledInactiveBorderColor

public final @NonNull Color getDisabledInactiveBorderColor()

the color used for the border when disabled and inactive

getDisabledInactiveContainerColor

public final @NonNull Color getDisabledInactiveContainerColor()

the color used for the container when disabled and inactive

getDisabledInactiveContentColor

public final @NonNull Color getDisabledInactiveContentColor()

the color used for the content when disabled and inactive

getInactiveBorderColor

public final @NonNull Color getInactiveBorderColor()

the color used for the border when enabled and active

getInactiveContainerColor

public final @NonNull Color getInactiveContainerColor()

the color used for the container when enabled and inactive

getInactiveContentColor

public final @NonNull Color getInactiveContentColor()

the color used for the content when enabled and inactive

hashCode

public int hashCode()