Skip to content

Material Theming with Jetpack Compose #145

@smmac72

Description

@smmac72

URL of codelab

In which task and step of the codelab can this issue be found?
Add Color

Describe the problem

  • Add color palette to theme - Material Builder export has different color variable namings compared with the tutorial section
  • Color mapping / Dynamic Color - Dynamic color is enabled by default in the project leading to issues with the Color mapping task (green color became default system gray)

Steps to reproduce?
Material Builder namings:

  1. Go to the Material Builder
  2. Create and export the color scheme
  3. Compare color variable names from the tutorial and the exported Color.kt (no idea why it shifted the color value). Example:
    val md_theme_light_primary = Color(0xFF006C4C)
    val primaryLight = Color(0xFF1F6A4E)
  4. Same issue can be seen in the Theme.kt files

Wrong color for the Color mapping section:

  1. Checkout to the starter branch of the Woof app
  2. Get to the Color mapping section - it's implied that the DogItem card color must be green
  3. In fact, DogItem card color is gray (light theme)
  4. Get to the Dynamic color section - the dynamicColor variable is already set to true
  5. Setting the dynamicColor to false restores green color to the DogItem card

Versions
Android Studio version: Otter | 2025.2.1
API version of the emulator: 36.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions