question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for Android Jetpack Compose

See original GitHub issue

Jetpack Compose is the future of Android UI development, and I’d love to see first-class support for Compose in style dictionary.

While Jetpack Compose has an interop layer with style resources, I would love to see a more idiomatic integration.

For example, today with Compose + Style Dictionary we could do:

@Composable
fun TextExample() {
  Text(
    text = "Hello World",
    color = colorResource(R.color.color_font_base)
}

But I would much rather have Style Dictionary generate a Kotlin file containing the colors so we can have something like this:

@Composable
fun TextExample() {
  Text(
    text = "Hello World",
    color = StyleDictionary.colors.font.base
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
vrickey123commented, Jan 19, 2021

My team is using the style dictionary and is also interested in first-class Jetpack Compose support. Bumping this thread in case anyone is able to prioritize it.

1reaction
bherbstcommented, Apr 29, 2021

I took a swing at what a format that supports dark mode in Compose might look like based on your work-in-progress dark mode repo:

https://gist.github.com/bherbst/1b8c9a66953f25044631db68dd773429

There’s a bit of awkward juggling to get the references to the Palette object when constructing the light/dark Colors objects, but overall I think it is workable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jetpack Compose UI App Development Toolkit
Jetpack Compose is Android's recommended modern toolkit for building native UI. It simplifies and accelerates UI development on Android.
Read more >
Quick start | Jetpack Compose
Create a new app with support for Compose; Set up Compose for an existing app; Try Jetpack Compose sample apps; Using the Bill...
Read more >
Android Studio support for Compose | Jetpack Compose
Android Studio offers some features to extend composable previews. You can change their container design, interact with them, or deploy them ...
Read more >
Adding Jetpack Compose to your app
If you want to use Jetpack Compose in an existing project, you'll need to configure your project with required settings and dependencies.
Read more >
Get started with Jetpack Compose
Jetpack Compose is the modern toolkit for building native Android UI. Here's where you'll find the latest information about using Compose.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found