I don't seem to be getting a live preview? :confus...
# compose
f
I don't seem to be getting a live preview? 😕
c
Did you re-run?
I also noticed that Preview doesn’t display if you have split view setup in the IDE, it seems to only work if you only have one tab open
f
do you mean re-build? I didn't try running the app.
c
The IDE should prompt you to rebuild anytime you change something for Compose
f
Not getting it!
r
Rebuilding should be all you need
f
There's something wrong with my install, then.
c
What version of Android Studio are you running?
f
4.0 canary 1
c
@Fudge can you check out
PostCardTop
? That preview seems to work for me, adding
@Preview
is not working for me in JetnewsApp.kt
f
you're totally right
c
@romainguy — adding Preview to certain Composables seems to be broken at least in the sample project
👆 1
j
The
@Preview
annotation can only be applied to composable functions with zero parameters. Otherwise, the IDE doesn't know what values to pass in for those parameters.
c
@jim — the IDE will provide a warning, the screenshot above has
@Preview
on a zero parameter function.
l
@jim what if functions with parameter have default values?
f
That’s not really related considering the function had no parameters in this case.
l
@Fudge sorry, just curiosity 😛