Only for toy programs. If you have something more complex you don't want it. I can maintain and update my states myself with a little boilerplate code.
Great video, compose is awesome!! I Appreciate all your hard work around Navigation Ian. Looking forward to seeing how nested navigation and multi back stack is going to work.
That's exactly what worries me somewhat. When using nested stuff, etc how to describe it in a way that's understandable and usable? In a project we did the onboarding UI flow with navigation (it's a complex message/phone/contact handling app, not just a simple lookup for plants :-) ) and even this was not straightforward. All other UI flows use 'pure programming' 😉(not Navigation) to cover all the different flows, screens, pop-up etc.
6:15 I'm glad that you are starting to explain some best practises around state and events (stateless/stateful). Of course you seem to forget that a lot of compose examples have if / elses littered in the composable which are side effects, no an ideal best practise (tell don't ask). Also these principles can be applied well, anywhere (traditional xml layouts with data binding for instance) - its not synonymous with Compose.
Jetpack Compose for UI development on Android is great. I've been using it for a while and I enjoy it a lot. It is unfortunate however that the Compose navigation library does not support passing complex data as a navigation arguments, such as a custom Parcelable. The non-compose version of navigation components supports it with "safe args" and that feature is simple to use and productive. Not supporting complex data as arguments in compose forces developers to introduce abstractions that they might otherwise not need or even wish to have.
Wow this was a lot. Especially the part with the savedstatehandle. You show how it's retrieved to call the repository, but where does it get set in the first place? Is there a sample with this entire app somewhere with the implementation as discussed in this video?
I mentioned this at 16:48 - the SavedStateHandle is *automatically* populated from the arguments on your Navigation Compose composable destination; there's nothing you have to do to get that working. There's no sample specifically for the fictional 'Bloom' app we talked about here, but many of the techniques are used in our existing Compose Samples (e.g., the Owl sample app): github.com/android/compose-samples
@@IanLake awesome, as I said you did kinda lose me there 😂 So where is that happening exactly? Does hiltNavGraphViewModel() do that? I don't see where else the VM would get the argument.
@@GakisStylianos yeah hiltNavGraphViewModel() is basically setting the savedStateHandle with the parameters from the route when instantiating the viewModel
The routing definitely needs some type safety. I get the flexibility with using simple string values, but too error prone on referring to a path or trying to discover one. Some type safety would be better. E.g. sealed class MyRoutes: Route and referring to routes through the types of this route. Hope it will get better .
I would like to use Fragments, Activities etc and pure Compose, but without Hilt, Navigation. IMHO this adds too much overhead and also complex UIs flows are very complicate to create with Navigation. It just adds confusion. These so called navigation paths/trees are IMHO a nightmare when it comes to non-linear UI flows, when the app needs to deviate, or showing screens in case or errors and needs to follow a complete different UI flow. Will it be possible to use Fragments and compose without using 'onCreateView(...)' and all its inflate parameters? Maybe a new 'onCreateWithCompose(..)' function or alike? For an Activity it's quite simple to set the compose content. Why not for Fragments as well?
We actually specifically point this in the guide (see the note at the end of this section: developer.android.com/jetpack/compose/navigation#nav-to-composable) - star the existing feature request for transitions in Navigation Compose for updates: issuetracker.google.com/issues/172112072
@@Soulcybering yes found out it challenges app, but i guess my point still stand. With lot of those samples, which one that considerably best practice and shown in this video. Im curious about the Flow implementation. Anyway, thanks for the link
@@OliverRhyme i'm using hilt to inject just like in 1:53, but when executing anything in the ```init block```, it throws an error of repository not instantiated
Modern android development is a bird language - every time you have to remember these spells. How new incoming android developer can understand this?! It seems to me all this is very overcomplicated.
Working hard on my Compose course 🥵
Excellent session and a great overview of what to expect when we finally move to a fully composable world! Thanks Ian and Manuel!
So happy to be here 🥰🥰🥰🥰
This is hands down my favorite I/O session this year 🙌🏼🙌🏼
Declarative UI is the future.
Very informative video, good job guys! 👍
Only for toy programs. If you have something more complex you don't want it. I can maintain and update my states myself with a little boilerplate code.
I'm a fan of your channel @Stevdza-San
@@mrtruthvirtue8752 💜🙏
The lifes of Android developers is going to get so much more easier and fun with Jetpack Compose and all that it brings!
Need compose course in Udacity!
Great video, compose is awesome!! I Appreciate all your hard work around Navigation Ian. Looking forward to seeing how nested navigation and multi back stack is going to work.
That's exactly what worries me somewhat. When using nested stuff, etc how to describe it in a way that's understandable and usable? In a project we did the onboarding UI flow with navigation (it's a complex message/phone/contact handling app, not just a simple lookup for plants :-) ) and even this was not straightforward. All other UI flows use 'pure programming' 😉(not Navigation) to cover all the different flows, screens, pop-up etc.
6:15 I'm glad that you are starting to explain some best practises around state and events (stateless/stateful). Of course you seem to forget that a lot of compose examples have if / elses littered in the composable which are side effects, no an ideal best practise (tell don't ask). Also these principles can be applied well, anywhere (traditional xml layouts with data binding for instance) - its not synonymous with Compose.
Good answer!
Jetpack Compose for UI development on Android is great. I've been using it for a while and I enjoy it a lot.
It is unfortunate however that the Compose navigation library does not support passing complex data as a navigation arguments, such as a custom Parcelable. The non-compose version of navigation components supports it with "safe args" and that feature is simple to use and productive. Not supporting complex data as arguments in compose forces developers to introduce abstractions that they might otherwise not need or even wish to have.
Is there a github repo to this compose project mentioned in the video?
Yeah I also want to know.
There are a lot of them because it was a sample app called "Bloom" for the Android Compose Dev Challenge. Like this one: github.com/msasikanth/bloom
Thanks Ian!
Your work is very helpful to the Android dev community
Wow this was a lot. Especially the part with the savedstatehandle. You show how it's retrieved to call the repository, but where does it get set in the first place? Is there a sample with this entire app somewhere with the implementation as discussed in this video?
I mentioned this at 16:48 - the SavedStateHandle is *automatically* populated from the arguments on your Navigation Compose composable destination; there's nothing you have to do to get that working. There's no sample specifically for the fictional 'Bloom' app we talked about here, but many of the techniques are used in our existing Compose Samples (e.g., the Owl sample app): github.com/android/compose-samples
@@IanLake awesome, as I said you did kinda lose me there 😂 So where is that happening exactly? Does hiltNavGraphViewModel() do that? I don't see where else the VM would get the argument.
@@GakisStylianos Hilt sets up the AbstractSavedStateViewModelFactory correctly with the proper initial arguments
@@IanLake Wasn't bloom just one of the app designs for the AndroidDev Challenge some time back?
@@GakisStylianos yeah hiltNavGraphViewModel() is basically setting the savedStateHandle with the parameters from the route when instantiating the viewModel
The routing definitely needs some type safety. I get the flexibility with using simple string values, but too error prone on referring to a path or trying to discover one. Some type safety would be better.
E.g. sealed class MyRoutes: Route and referring to routes through the types of this route.
Hope it will get better .
great demo, thanks
nav part seems bit complicated compared to compose
I would like to use Fragments, Activities etc and pure Compose, but without Hilt, Navigation. IMHO this adds too much overhead and also complex UIs flows are very complicate to create with Navigation. It just adds confusion. These so called navigation paths/trees are IMHO a nightmare when it comes to non-linear UI flows, when the app needs to deviate, or showing screens in case or errors and needs to follow a complete different UI flow.
Will it be possible to use Fragments and compose without using 'onCreateView(...)' and all its inflate parameters? Maybe a new 'onCreateWithCompose(..)' function or alike? For an Activity it's quite simple to set the compose content. Why not for Fragments as well?
can I ask u what tool u are using to make this great presentations !?
Concerning the compose navigation, how can we implement the transition animation between screens when navigating?
you can't
@@cepelinmaisis Is it implement now? because in previous navigation-compose version, this attributes aren't take into account
NavGraph XML? In Navigation-Compose? Where??
We actually specifically point this in the guide (see the note at the end of this section: developer.android.com/jetpack/compose/navigation#nav-to-composable) - star the existing feature request for transitions in Navigation Compose for updates: issuetracker.google.com/issues/172112072
Thanks for tutorial but where can i find the source code of Bloom?❔
Any plans to have compose version of React Context Api
At 13:06 hiltNavGraphViewModel doesn't work anymore now it is hiltViewModel() as version 1.0.0
I want to embed Unity Game into Compose UI, how can I do it better?
Where is the link to that sample app? is Bloom a commercial app belongs to company so the code is not shared?
One of the many samples you can find on GitHub: github.com/msasikanth/bloom
@@Soulcybering yes found out it challenges app, but i guess my point still stand. With lot of those samples, which one that considerably best practice and shown in this video. Im curious about the Flow implementation. Anyway, thanks for the link
Feels like react router in android
how do you guarantee the repository is instantiated when using it in the init block of the view model?
It is injected so it is already instantiated
@@OliverRhyme i'm using hilt to inject just like in 1:53, but when executing anything in the ```init block```, it throws an error of repository not instantiated
@ you have an instantiation code for your repository??
Modern android development is a bird language - every time you have to remember these spells. How new incoming android developer can understand this?!
It seems to me all this is very overcomplicated.
Senior dev level material.
Jesus Christ!!