Skip to content
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

Merged
merged 5 commits into from
Oct 27, 2021

Conversation

kaiwidmer
Copy link
Contributor

This pull request adds:

  • Icons: JetPack compose extension classes
  • Colors: Jetpack compose extension classes
  • Typography: Jetpack compose extension classes and letterspacing attribute for xml's
  • Config: additional fields to configure compose extension export

@subdan
Copy link
Collaborator

subdan commented Oct 22, 2021

Thanks for the PR. I will review it on weekend.

Copy link
Collaborator

@subdan subdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Add Android JetPack Compose example project configured with FigmaExport.
  2. Add information about this feature to README.md

@kaiwidmer kaiwidmer requested a review from subdan October 26, 2021 11:47
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:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#### 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The utility supports Dark Mode, SwiftUI and Compose.
The utility supports Dark Mode, SwiftUI and Jetpack Compose.

@@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Example Android Compose project
### Example Android Jetpack Compose project


### Example Android Compose project

There is an example Android Studio project in `AndroidComposeExample` directory which demostrates how to use `figma-export` configured for compose.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `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`
Copy link
Collaborator

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):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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):

Copy link
Collaborator

@subdan subdan left a 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.

@kaiwidmer kaiwidmer requested a review from subdan October 26, 2021 21:33
@subdan subdan merged commit fe6dff8 into RedMadRobot:master Oct 27, 2021
@kaiwidmer kaiwidmer deleted the feature/android_export_extension branch October 27, 2021 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants