https://kotlinlang.org logo
a

Ash

09/27/2020, 4:37 PM
Not sure if doing something wrong? Building a complex UI with maps, scrolling, scale, images, etc ...
@Preview @Composable
85% of the time does not render anything ... emulator and device work perfect! Anything to be done to make
@Preview
work better?
Right now have to put each small piece into it's own
@Preview
and that works ... but would be nice to be able to render the whole UI ... wonder want can be done?
a

Adam Powell

09/27/2020, 4:47 PM
Please report repro cases for preview issues and we can take a look at them
a

Ash

09/27/2020, 4:49 PM
OK ... but there are no setting in Android Studio that might need to be set, changed?
a

Adam Powell

09/27/2020, 4:50 PM
I don't think so, but @nosuid would be the one to ask for certain
a

Ash

09/27/2020, 4:57 PM
OK ... sometimes have to replace the Composable view with a simple
Text("hi")
to get the
@Perview
working, than flip back and it works ... funny. Just wondering if the community had any thoughts on the matter?
r

romainguy

09/27/2020, 5:44 PM
Preview won’t work for anything that uses surface view or texture view
☝️ 1
So maps for instance won’t work
✔️ 4
a

Ash

09/28/2020, 3:27 PM
Spending 20% to 30% of my coding time trying to get
@Preview
to show up ... 1. Have to make the Preview as simple as possible by removing most of the components. 2. Get the preview to render the simple view 3. Then start putting the components back one by one till rendering the full view ... Open to any suggestion about how to improve / fix this workflow 🙂 !? Yes ... Yes we can use the emulator or a real device but I would like to have @Preview in my workflow ...
s

Sean McQuillan [G]

09/28/2020, 4:51 PM
Are any of your composables accessing network or disk?
a

Ash

09/28/2020, 4:57 PM
No ... what is interesting is the
@Preview
will ultimately render correctly... but have to sneak up on it 🙂 Building it one
@Composable
at a time till it is fully rendered ... that is why wondering if doing something wrong? Because it will eventually render correctly ... might just be my machine / Android Studio config?
s

Sean McQuillan [G]

09/28/2020, 6:31 PM
Sounds like a bug in the preview system. +1 to filing whatever you can share
👍🏽 1
a

Ash

09/29/2020, 12:20 AM
OK, but I think it's just me ... 1. No one else is complaining. 2. It ultimately does render ... just have to build the
@Preview
in steps ... Will keep working with it and if it gets too painful ... will file an example :-)