Fixed
Status Update
Comments
sh...@gmail.com <sh...@gmail.com> #2
I accidentally reported this issue as bug, but it's a feature request.
ma...@google.com <ma...@google.com>
Er...@gtempaccount.com <Er...@gtempaccount.com> #3
I have the same use-case as the author where I need to support, light, dark, RTL and increased font sizes. This would be a great feature to have to minimise duplication of the same preview annotations each time. Many thanks for creating this.
am...@google.com <am...@google.com>
ls...@google.com <ls...@google.com>
da...@gmail.com <da...@gmail.com> #4
This would be fantastic, as previews can start to build up like you said. Light mode, dark mode, landscape, portrait etc for each screen gets out of control.
ys...@google.com <ys...@google.com> #5
It's useful for Wear use as multiple sizes need to be tested, more crucial than on mobile.
kf...@gmail.com <kf...@gmail.com> #6
I would also really like to see this.
sh...@gmail.com <sh...@gmail.com> #7
Star up folks :)
mh...@vertica.dk <mh...@vertica.dk> #8
I could also be nice to be able to define global default values for all previews.
yu...@schimke.ee <yu...@schimke.ee> #9
We got it!
rm...@gmail.com <rm...@gmail.com> #10
What do you mean we got it? Can you share more information?
sh...@gmail.com <sh...@gmail.com> #11
They announced it in IO:
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOo3bTpTxdJblOS8tMzxMv93HqK2xYw4gLCSdRLiFYwsvWyqcBPpERe6gf8ORlrJcPKOOI6EhWNYEoZmonJHpDlpVgSvIPHd1E_Fhjwjh9GUEqzcojitWY6O0FBK_XhZ8AY6QXmTOKAUeQQ3V-UMMCtcGa22pRjGLF9q-3bwYDdNgGgV3PG10BP66X/s1600/image16.png
I wonder why the ticket is still opened
I wonder why the ticket is still opened
yu...@schimke.ee <yu...@schimke.ee> #12
Announced at io. In electric eel canary.
Description
In my app I have a predefined set of
@Preview
annotations:The problem is that I have to duplicate this set across all of my composable functions.
I'd like to offer a solution. If accepted, it'll need to be implemented in
androidx.compose.ui:ui-tooling-preview
library and be enforced by Android Studio preview mechanism.The Solution:
I'd like to be able to create my own preview annotation and annotate my annotation with that predefined previews.
Android Studio will have to dig up the internal preview annotations to identify those.
For example, my composable will look like this:
And
@MyPreview
annotation will look like this:I think 2 things needs to be done:
@Preview
annotation will need to be targeted to functions and annotations (currently it only targets functions).@Preview
annotations