airbnb / Showkase

🔦 Showkase is an annotation-processor based Android library that helps you organize, discover, search and visualize Jetpack Compose UI elements
https://medium.com/airbnb-engineering/introducing-showkase-a-library-to-organize-discover-and-visualize-your-jetpack-compose-elements-d5c34ef01095
Apache License 2.0
2.11k stars 107 forks source link

Feature request: allow `ShowkaseColor` and `ShowkaseTypography` also for `@Composable` functions #286

Open francescocervone opened 1 year ago

francescocervone commented 1 year ago

Currently, the @ShowkaseColor and @ShowkaseTypography annotations can be applied only to fields:

Sometimes, you need to declare Colors and TextStyles as composable functions, for example in this case:

// colorResource(...) is a composable function
val brand: Color @Composable get() = colorResource(id = R.color.brand)

It would be nice to be able to apply the @ShowkaseColor and @ShowkaseTypography also to functions, probably the same targets allowed by the @Composable annotation (https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable), at least for property getters.

Thanks.

vinaygaba commented 1 year ago

I was looking into it just yesterday. I think this should be possible to do if I do some minor refactors. Also related to #115

ameliethery-prima commented 8 months ago

Hey @vinaygaba ! This feature would still be a great addition imo, do you know if there is a chance it will be considered? Thanks!

whencathasamouse commented 3 months ago

Second this, it would be a great addition