style-dictionary icon indicating copy to clipboard operation
style-dictionary copied to clipboard

Compose object imports

Open giovannimartusciello opened this issue 2 years ago • 1 comments

Issue #, if available: Selectively import on compose class was not available

Description of changes: Added a formatHelper for import option + added map function in the compose template

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

giovannimartusciello avatar Sep 19 '22 07:09 giovannimartusciello

This is amazing! It's exactly what I miss to convert to Android Compose objects

cgal-capco avatar Sep 20 '22 08:09 cgal-capco

Really need this. Is there a reason it was never merged?

martymiller avatar Jan 24 '23 20:01 martymiller

+1 @martymiller

Ideally the imports should be automatically imported from the classes and functions used on whether the applied transforms actually need.

However, at the moment the current code hardcodes 2 imports

import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.*

I think this change, although it won't reach the desired goal, it will improve the current code allowing to import more than the 2 hardcoded imports.

cjgaliana avatar Jan 25 '23 10:01 cjgaliana

@dbanksdesign can we request an approve for this? in order to integrate this feature?

giovannimartusciello avatar Jan 25 '23 10:01 giovannimartusciello

Really need this. Is there a reason it was never merged?

Not really, we are waiting for an approve

giovannimartusciello avatar Jan 25 '23 10:01 giovannimartusciello