material-foundation / material-theme-builder

Visualize dynamic color and create a custom Material Theme.
https://material-foundation.github.io/material-theme-builder/
Apache License 2.0
363 stars 28 forks source link

Exporting for Android results in wrong closing tags and colour reference #72

Closed steamedham544 closed 2 years ago

steamedham544 commented 2 years ago

Describe the bug Exporting a theme for Android results in the following bugs:

  1. Colours in colors.xml have the wrong closing tag. It has </item>.
  2. In themes.xml for both dark and light themes have a typo for referencing inversePrimary.

To Reproduce Steps to reproduce the behavior:

  1. Create a theme
  2. Export to Android

Expected behavior

  1. The closing tags in colors.xml should be </color> instead of </item>

  2. Dark theme: change the colour referenced in colorPrimaryInverse from @color/md_theme_dark_primaryInverse to @color/md_theme_dark_inversePrimary

  3. Light theme: change the colour reference in colorPrimartInverse from @color/md_theme_light_primaryInverse to @color/md_theme_light_inversePrimary

steamedham544 commented 2 years ago

@jwill there's a problem with background colours too in both themes.xml files.

It's name has been set as android:colorBackground but it's supposed to be backgroundColor

I was wondering why using?attr/backgroundColor crashes my app.

jwill commented 2 years ago

android:colorBackground is actually correct, from the spec: https://github.com/material-components/material-components-android/blob/3fdfb6e230767138849edf858c13da1bf1d3f90b/lib/java/com/google/android/material/theme/res/values/themes_base.xml#L39

jwill commented 2 years ago

The other issue with closing tags was resolved in the recent build.