Can there only be one `@Preview` function and does it need to be in the main activity?
m
Can there only be one
@Preview
function and does it need to be in the main activity?
z
You can have as many preview functions as you want in whatever files you want - when that file is open, it will show all those previews together at once.
m
Odd. If I paste my preview into the main activity it displays, but it doesn't if I define it in a new file
z
I think there's a bug where you need to reopen the file the first time you add a preview function
m
Yep, that did it. Thanks!
l
yep. that bug (i think?) is fixed on the latest canary build of studio, but i could be wrong
l
How far you see the preview if your function in an activity? Preview are meant to be top level functions 😧
l
i think perhaps he meant that it was in the same file. the IDE basically looks for the presence of @Preview when the file is opened, but doesn’t check after that