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
397 stars 27 forks source link

Exported Theme for Jetpack Compose is faulty #56

Closed djnotes closed 2 years ago

djnotes commented 2 years ago

Describe the bug Exported code for Compose code does not compile. Lots of missing imports in Theme.kt and some types do not resolve to anything.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'https://material-foundation.github.io/material-theme-builder/#/custom'
  2. Click 'Export' after making some changes or as is.
  3. Select Jetpack Compose (Theme.kt)
  4. Extract files and copy the three files Theme, Color, and Type(.kt) to your-package.m3
  5. Rename the package address at the top of the files to your package.
  6. There are lots of red lines in Theme.kt

Expected behavior There should be no errors and the required compoents should have already been imported in the file.

Screenshots Screenshot from 2022-04-11 14-30-17 safari]

Desktop (please complete the following information):

Additional context I'm running Android Studio Chipmunk 2021.2.1 Beta 4.

androidx.compose.material3, androidx.compose.material, and com.google.android.material* has been added to dependencies.

fuomag9 commented 2 years ago

Also some variables are straight missing or should not even be there? image

CmdrSharp commented 2 years ago

@rodydavis What're the odds you've had a chance to look at this? :)

jwill commented 2 years ago

Harmonization on Compose was meant to be a beta feature and not exported all the time, I'm in the midst of a migration so I can't roll a quick fix.

You can safely delete everything from data class CustomColor until the end of the file.

ArbenMaloku commented 2 years ago

+1

jwill commented 2 years ago

Fixed in recent build.