Hey, I'm having some trouble in compose - I would ...
# compose
t
Hey, I'm having some trouble in compose - I would like someone to DM me so we can talk further.
☝🏽 1
z
It’s better to discuss in the channel, in case other people are having the same issues, or a future discussion wants to refer back to this.
t
ok well Compose is taking a long time to update the preview in Android Studio Arctic Fox and I have to wait at least 20 seconds to see changes is this normal?
z
that 20 seconds is on top of the build time?
t
after I edited some code it says that the preview is out of data and a refresh is needed - there is no indication of a build of any sorts, just a refresh of the preview (I could be wrong). Anyways, with XML the preview time is 0 after making changes... With compose I am having to wait a long amount of time so it's making me less inclined to use this for future projects. Cheers, any solution would be appreciated.
h
I just opened this channel to ask this very same question. I’ll be interested to know what suggestion you get here. I have multi-module project and every time something is changed it wants to build again. I understand that this is the requirement for the way compose works as of now. But with such long time, it will decrease the velocity of team.
t
Exactly, more attention should be focused on this issue. If the Android team wants more people switching from XML to Compose they need to cut the preview times to zero or perhaps 1 to 2 seconds. Not sure if it's related but my PC is quite low end (from around 5 years ago) and that certainly doesn't help; although I am not getting this issue in XML. This problem makes it much more inefficient to use Compose over XML which is the completely opposite result of what Compose was designed for in the first place!
h
@therealbluepandabear That’s true. XML and Compose has different requirements to work so it will be a while before compose (tooling) reaches to the maturity as of XML layout. But I just read somewhere that it works relatively faster on Android Studio Bumblebee (Canary Build). Need to try that then.
t
Interesting, I'm going to download bumblebee now and I will update you.
h
z
Refresh requires rebuilding the module
t
@Harsh Bhakta not seeing any major improvements in Bumblee - knew this whole 'compose' thing is overrated. Thanks but no thanks. I'll stick to designing apps with the ConstraintLayout in the visual editor 😉
I'm actually getting more problems in Bumblebee
There's absolutely zero point in developing apps in Compose if it takes 10-15 seconds for the preview to finish - it's utterly counterintuitive.
z
There are plenty of other reasons to use compose besides using previews, but it is frustrating that it’s not instant. And I’m very jealous of your 15 second build times 😜
h
I'm jealous too😂
t
@Harsh Bhakta don't be - it's 15 second build time for a new project with nothing in it 🤣 Think about the preview time for a large-scale application such as yours
t
Yeah this preview thing is taking ridiculous amount of time to refresh. Sometime it won’t update after refresh so I have to preview the change in the simulator 🙃
c
My build times in my very large project are like 10 minutes+. But I also understand there's nothing compose will be able to do about that. If I want better perf for composable previews then I would put it in a separate module.
There's absolutely zero point in developing apps in Compose if it takes 10-15 seconds for the preview to finish - it's utterly counterintuitive.
😂 I would use compose over the view system even @Preview didn't exist at all. Seems like you have some different expectations in mind in terms of what compose is.
8
t
@Colton Idle (Note: What I am about to say might hurt Jetpack Compose 'fanboys', so please - precede with precaution. Also people who said the Earth was round in the beginning were laughed at 😂. I think over time many people will come to agree with my opinion like they did with those 'crazies' who claimed the Earth was round. I'm never one to follow the opinion of the masses.) It seems like you're not as design-centric as most people here. I have my preferences, and you have your preferences and I can accept that although I will respectfully disagree with your statement. XML works and will continue to work and function snappy - until the Android team cuts the build time to at least 2 seconds then they might have a chance of converting myself. Oftentimes there's a load of hype surrounded these new technologies which oftentimes don't bring anything that major to the table. You see this in many ecosystems and not just the Android one. In my eyes, what's not broken doesn't need to be fixed - I don't and have never had an issue with the View system. Again, using the LinearLayout is a pain the ass - which is why I prefer using ConstraintLayout + Designer and trust me you can create A-level-style UI like you may be able to in Jetpack Compose. Except with XML the preview time is 0-1 seconds so you can make minute changes (such as changing the colour of text) and view the desired result instantly. I will agree to disagree with you... Stick with your 10 minute plus build times and perhaps one day you will realise how much time you could've saved by using XML 🤣 Thanks but no thanks 🙂
c
I'm not hurt. I will take my 10 liner lazyColumn in compose vs a 200 line recyclerView any day.
2
t
@Colton Idle 😂