-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add compose extensions for android export #124
Add compose extensions for android export #124
Conversation
Thanks for the PR. I will review it on weekend. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Add Android JetPack Compose example project configured with FigmaExport.
- Add information about this feature to README.md
README.md
Outdated
fun Colors.backgroundPrimary(): Color = colorResource(id = R.color.background_primary) | ||
``` | ||
|
||
Icons will be exported to `drawable` directory as vector xml files. For `jetpack compose`, following code will be generated, if conifgured: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Icons will be exported to `drawable` directory as vector xml files. For `jetpack compose`, following code will be generated, if conifgured: | |
Icons will be exported to `drawable` directory as vector xml files. For Jetpack Compose, following code will be generated, if configured: |
README.md
Outdated
@@ -201,13 +201,61 @@ Example of these files: | |||
### Android | |||
|
|||
Colors will be exported to `values/colors.xml` and `values-night/colors.xml` files. | |||
For `jetpack compose`, following code will be generated, if conifgured: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For `jetpack compose`, following code will be generated, if conifgured: | |
For Jetpack Compose, following code will be generated, if configured: |
README.md
Outdated
|
||
Vector images will be exported to `drawable` and `drawable-night` directories as vector `xml` files. | ||
Raster images will be exported to `drawable-???dpi` and `drawable-night-???dpi` directories as `png` or `webp` files. | ||
|
||
Typography will be exported to `values/typography.xml` | ||
Typography will be exported to `values/typography.xml`. For `jetpack compose`, following code will be generated, if conifgured: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typography will be exported to `values/typography.xml`. For `jetpack compose`, following code will be generated, if conifgured: | |
Typography will be exported to `values/typography.xml`. For Jetpack Compose, following code will be generated, if configured: |
README.md
Outdated
@@ -312,6 +362,11 @@ android { | |||
} | |||
``` | |||
|
|||
#### Compose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#### Compose | |
#### Jetpack Compose |
README.md
Outdated
@@ -14,7 +14,7 @@ Command line utility to export colors, typography, icons and images from Figma t | |||
* icon — Figma's component with small black/colorized vector image | |||
* image — Figma's components with colorized image (Light/Dark) | |||
|
|||
The utility supports Dark Mode and SwiftUI. | |||
The utility supports Dark Mode, SwiftUI and Compose. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The utility supports Dark Mode, SwiftUI and Compose. | |
The utility supports Dark Mode, SwiftUI and Jetpack Compose. |
Examples/README.md
Outdated
@@ -39,3 +39,14 @@ There is an example Android Studio project in `AndroidExample` directory which d | |||
* To export icons run: `figma-export icons` | |||
* To export images run: `figma-export images` | |||
* To export typography run: `figma-export typography` | |||
|
|||
### Example Android Compose project |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Example Android Compose project | |
### Example Android Jetpack Compose project |
Examples/README.md
Outdated
|
||
### Example Android Compose project | ||
|
||
There is an example Android Studio project in `AndroidComposeExample` directory which demostrates how to use `figma-export` configured for compose. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an example Android Studio project in `AndroidComposeExample` directory which demostrates how to use `figma-export` configured for compose. | |
There is an example Android Studio project in `AndroidComposeExample` directory which demostrates how to use `figma-export` configured for Jetpack Compose. |
README.md
Outdated
@@ -278,6 +326,8 @@ Run `fastlane sync_colors` to run FigmaExport. | |||
|
|||
In the `figma-export.yaml` file you must specify the following properties: | |||
- `android.mainRes` | |||
- `android.resourcePackage` | |||
- `android.mainSrc` if you want generate compose code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `android.mainSrc` if you want generate compose code | |
- `android.mainSrc` if you want generate Jetpack Compose code |
README.md
Outdated
@@ -278,6 +326,8 @@ Run `fastlane sync_colors` to run FigmaExport. | |||
|
|||
In the `figma-export.yaml` file you must specify the following properties: | |||
- `android.mainRes` | |||
- `android.resourcePackage` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add information about this property.
README.md
Outdated
@@ -312,6 +362,11 @@ android { | |||
} | |||
``` | |||
|
|||
#### Compose | |||
For Typography, Colors and Icons you can enable code generation for the use with compose in your [config file](CONFIG.md): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Typography, Colors and Icons you can enable code generation for the use with compose in your [config file](CONFIG.md): | |
For Typography, Colors and Icons you can enable code generation for the use with Jetpack Compose in your [config file](CONFIG.md): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix backward compatibility. resourcePackage
property must be optional.
This pull request adds: