We don’t yet - but I can rope them in :slightly_sm...
# compose
c
We don’t yet - but I can rope them in 🙂
🎉 7
🪢 2
c
I wasn't that excited for relay because i dont really want/need figma <> compose integration/syncing. BUT on twitter someone said that you can just export from figma into a composable and modify the composable to your hearts content. I haven't tried it yet... but if that works. and I don't need to manually figure out gradients and gradient color stop percentages vs color alpha percentages I would be SOOO happy. my designers use so many gradients as backgrounds for cards and so if there was just an export to composable button or something in figma. thatd be so legit.
c
There is not an explicit “export to Composable” action in the Relay Figma plugin. What happens today is the designer annotates a Figma component as a Relay component, via the Figma plugin. You then have to import your Relay components into your Android project, which is done by pointing the Relay Studio plugin to a Figma file (URL), which it then uses to generate the directory of Relay UI components, using all the data from Figma to do the code-gen. The generated code then lives in your project and you can use it as-is, or copy-paste it if you want to modify it further. You can’t really modify the generated code directly because it’s generated on every build build, using the Relay metadata, so local changes will be overridden.
Stepping back, Relay has the logic/machinery to do what you are asking for (they’ve solved the harder part on Figma > Compose code-gen). I think they just have to package it up in a way that requires less setup.
d
I am not at the right machine ATM but I found a bug with the Gradle plugin. I will post the error here soon.
Our designers at work use Figma and the handoff problem is real. Some of us here (including myself) are very excited about this tool.
c
Indeed and I’m in-progress of getting the team in here to discuss more with y’all. Agree the handoff problem is real, with the challenge that it can vary from team to team, designer to designer, engineer to engineer. I think Relay has a fuller solution to the handoff problem then I’ve seen from other products in the past, e.g. Zeplin, but that might not be needed for everyone and maybe some just want better code generated in the Android tab in Figma Inspect mode.
d
Copy code
Unable to find method ''com.android.build.api.variant.SourceDirectories com.android.build.api.variant.Sources.getJava()''
'com.android.build.api.variant.SourceDirectories com.android.build.api.variant.Sources.getJava()'

Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)

Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.

Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
Got this
My cache is not corrupt.
I am not seeing the bug tracker for Relay.
c
Seems they are not using a bug tracker, but instead a feedback form: https://services.google.com/fb/forms/relay-feedback/
d
Thanks
c
cc @Kris Giesing
k
Hi! Kris here from the Relay team. Nice to meet you all :)
@dewildte Did you report that error via the feedback form? The error message indicates an incompatibility between the Relay Gradle plugin and the version of the Android Gradle Plugin used in your project
We fixed an error that looked very similar to that in the alpha release (0.3.00)
d
@Kris Giesing Nice to meet you! I did send a message in the feedback form. But my message was actually not about this.
I realized I was setting up the Gradle plugin incorrectly.
k
Ah, I see. Which part of the install instructions are incorrect?
We’ve revised these instructions a few times - there is an older pattern for using plugins that involves adding an entry to
classpath
. We no longer include those instructions because the
plugins
block approach is quite a bit simpler and seems to be the recommended pattern going forward
d
message has been deleted
It seems that the Relay IntelliJ plugin imported things alright. But the Gradle plugin breaks when it is applied.
@Kris Giesing ☝️
k
Hm, that looks like what I’m using successfully in local projects. What did you change to get things to build? Also, what version of Android Studio and Android Gradle Plugin are you using here?
d
I’ll get you that data soon, I am on my work machine right now.
What did you change to get things to build?
Instead of:
id("com.google.relay") version "0.3.00"
I did:
id("com.google.relay") version "0.3.00" apply false
But that means the plugin is not going to run.
Android Studio Dolphin | 2021.3.1 Patch 1 Build #AI-213.7172.25.2113.9123335, built on September 29, 2022 Runtime version: 11.0.13+0-b1751.21-8125866 x86_64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. I was on AGP 7.3.0-rc01 I am going to try 7.3.1 now
Ok, AGP 7.3.1 builds. But when trying to generate the composable code I am getting new errors.
Ah I see, the plugin is using:
Copy code
import androidx.compose.material.*
when my project uses:
Copy code
import androidx.compose.material3.*
only.
k
Ah, yes, that’s a known issue. We currently assume material 2.
d
😿
@Kris Giesing Thanks for your taking your time to go over this stuff with me. Can you let me know when a bug tracker is open for this?
k
We’re working on making our bug tracker public. Stay tuned…
Also we’re working on eliminating the explicit dependency on material 2. Not sure when that change will land but we can bump the priority now that we know it’s affecting people
d
This is great news!!!!
I am so excited to make this product a success!
I do have some concerns over the generated
@Composables
though. Mainly times when I need to modify them to do things like animate.
But I probably don’t fully understand the vision for the tool and such.
I should probably watch the 1hr video of it being used by Googlers.