Skip to content

StandardChip placeholder icon color not changing when disabled #329

@luizgrp

Description

@luizgrp

StandardChip placeholder icon should have an alpha applied in order to change the color when on disabled state.

Compare:

Screen Shot 2022-07-11 at 15 17 40

Our implementation relies on Chip from androidx.wear.compose.material which seems to implement this functionality. From the kdoc:

In order to correctly render when the Chip is not enabled the icon must set its alpha value to [LocalContentAlpha].

However, our implementation uses Coil's rememberAsyncImagePainter to display a placeholder, which receives a Painter type as placeholder, and might not work well with that alpha applied in Chip.

Expected outcome from this task

  • PrimaryChip preview for disabled state displays placeholder icon with correct alpha applied
  • SecondaryChip preview for disabled state displays placeholder icon with correct alpha applied
  • Other previews for PrimaryChip and SecondaryChip are not affected
  • PrimaryChip snapshot test for disabled state displays placeholder icon with correct alpha applied
  • SecondaryChip snapshot test for disabled state displays placeholder icon with correct alpha applied
  • Other snapshot tests for PrimaryChip and SecondaryChip are not affected

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions