I saw an interesting article today . The core content is to generate Compose code through Figma design draft and use it in AS. Since access to the original text requires magic, this briefly organizes the article.
The header image is taken from this article
Figma
-
Open Figma to create an account
-
Install plugins in Figma
-
save to version histor
-
generate token
-
copy Link
AS
-
Install the Relay for Android Studio plugin
-
build.gradle uses plugin
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'com.google.relay' version '0.3.02' // Relay
}
- set token
- Import Figma UI Package
There is a problem with material3, use material here
After build, you can see that Compose code is generated according to the design draft
Then we can call the Compose function to use it~