Is it possible make a new Annotation class that wr...
# getting-started
t
Is it possible make a new Annotation class that wraps another existing one? It was suggested that I can do the following the other day:
Copy code
@Preview(apiLevel = 33, showBackground=true)
annotation class MyPreview
to get a preapplied Preview arguments. Is it possible to parrot some of the other Preview options and pass them on to the @Preview, e.g. hieghtDp? so that I could do MyPreview(heightDp = 42) and then I'd get apiLevel = 33, showBackground=true, heightDp=42 at the @Preview level?
m
I don’t think it’s possible but it’s a good idea for stuff like design systems
d
Like Maksym said, I don't think it works out of the box, however some annotation processing tools (for example Spring Boot) do support some things like this, where it will look at annotations' annotations for some things.