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

ButtonColors

public final class ButtonColors


Represents the container and content colors used in a button in different states.

Summary

Public constructors

ButtonColors(
    @NonNull Color containerColor,
    @NonNull Color contentColor,
    @NonNull Color disabledContainerColor,
    @NonNull Color disabledContentColor
)

create an instance with arbitrary colors.

Public methods

final @NonNull ButtonColors
copy(
    @NonNull Color containerColor,
    @NonNull Color contentColor,
    @NonNull Color disabledContainerColor,
    @NonNull Color disabledContentColor
)

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

boolean
equals(Object other)
final @NonNull Color

the container color of this Button when enabled.

final @NonNull Color

the content color of this Button when enabled.

final @NonNull Color

the container color of this Button when not enabled.

final @NonNull Color

the content color of this Button when not enabled.

int

Public constructors

ButtonColors

public ButtonColors(
    @NonNull Color containerColor,
    @NonNull Color contentColor,
    @NonNull Color disabledContainerColor,
    @NonNull Color disabledContentColor
)

create an instance with arbitrary colors.

Parameters
@NonNull Color containerColor

the container color of this Button when enabled.

@NonNull Color contentColor

the content color of this Button when enabled.

@NonNull Color disabledContainerColor

the container color of this Button when not enabled.

@NonNull Color disabledContentColor

the content color of this Button when not enabled.

Public methods

copy

public final @NonNull ButtonColors copy(
    @NonNull Color containerColor,
    @NonNull Color contentColor,
    @NonNull Color disabledContainerColor,
    @NonNull Color disabledContentColor
)

Returns a copy of this ButtonColors, 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)

getContainerColor

public final @NonNull Color getContainerColor()

the container color of this Button when enabled.

getContentColor

public final @NonNull Color getContentColor()

the content color of this Button when enabled.

getDisabledContainerColor

public final @NonNull Color getDisabledContainerColor()

the container color of this Button when not enabled.

getDisabledContentColor

public final @NonNull Color getDisabledContentColor()

the content color of this Button when not enabled.

hashCode

public int hashCode()