Тёмный
No video :(

Using Jetpack libraries in Compose | Session 

Android Developers
Подписаться 1,3 млн
Просмотров 33 тыс.
50% 1

Jetpack Compose integrates seamlessly with other Jetpack libraries. There's no need to rewrite everything from scratch to start using Compose in your app. The UI code might change, but the rest of your app architecture remains intact. In this Session, we add Compose to an existing app that already uses ViewModel, LiveData/Flow, Paging, Room, Hilt, and Navigation! Learn how the libraries work with Compose, when to use ViewModels, and how to get the most out of Navigation Compose.
Resources:
Compose Pathway → goo.gle/compos...
Compose documentation → goo.gle/compos...
Compose Samples → goo.gle/compos...
Speakers: Ian Lake, Manuel Vicente Vivo
Watch more:
Android and Play at Google I/O 2021 Playlist → goo.gle/io21-A...
All Google I/O 2021 Technical Sessions → goo.gle/io21-t...
All Google I/O 2021 Sessions → goo.gle/io21-a...
Subscribe to Android Developers → goo.gle/Androi...
#GoogleIO #Android #Featured #JetpackCompose
product: Android - Jetpack Compose; event: Google I/O 2021; fullname: Ian Lake, Manuel Vicente Vivo; re_ty: Premiere;

Опубликовано:

 

6 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 54   
@codinginflow
@codinginflow 3 года назад
Working hard on my Compose course 🥵
@GoDigital685
@GoDigital685 Год назад
So happy to be here 🥰🥰🥰🥰
@samstoyroom
@samstoyroom 3 года назад
Need compose course in Udacity!
@idleidle3448
@idleidle3448 3 года назад
Excellent session and a great overview of what to expect when we finally move to a fully composable world! Thanks Ian and Manuel!
@Mrdresden
@Mrdresden 3 года назад
The lifes of Android developers is going to get so much more easier and fun with Jetpack Compose and all that it brings!
@StevdzaSan
@StevdzaSan 3 года назад
Declarative UI is the future. Very informative video, good job guys! 👍
@llothar68
@llothar68 3 года назад
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.
@mrtruthvirtue8752
@mrtruthvirtue8752 3 года назад
I'm a fan of your channel @Stevdza-San
@StevdzaSan
@StevdzaSan 3 года назад
@@mrtruthvirtue8752 💜🙏
@teowenlong9042
@teowenlong9042 3 года назад
Is there a github repo to this compose project mentioned in the video?
@MaggicBones
@MaggicBones 3 года назад
Yeah I also want to know.
@Soulcybering
@Soulcybering 3 года назад
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
@devprouk9512
@devprouk9512 3 года назад
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 .
@kirsh300
@kirsh300 3 года назад
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.
@narendratechguy7140
@narendratechguy7140 3 года назад
nav part seems bit complicated compared to compose
@MK-to4et
@MK-to4et 3 года назад
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.
@juanvq690
@juanvq690 2 года назад
Good answer!
@aksh1618
@aksh1618 3 года назад
This is hands down my favorite I/O session this year 🙌🏼🙌🏼
@GakisStylianos
@GakisStylianos 3 года назад
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?
@IanLake
@IanLake 3 года назад
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
@GakisStylianos
@GakisStylianos 3 года назад
@@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.
@Zhuinden
@Zhuinden 3 года назад
@@GakisStylianos Hilt sets up the AbstractSavedStateViewModelFactory correctly with the proper initial arguments
@yashovardhandhanania473
@yashovardhandhanania473 3 года назад
@@IanLake Wasn't bloom just one of the app designs for the AndroidDev Challenge some time back?
@yashovardhandhanania473
@yashovardhandhanania473 3 года назад
@@GakisStylianos yeah hiltNavGraphViewModel() is basically setting the savedStateHandle with the parameters from the route when instantiating the viewModel
@wernerdittmann7579
@wernerdittmann7579 3 года назад
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?
@Girrafffe
@Girrafffe 3 года назад
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.
@wernerdittmann7579
@wernerdittmann7579 3 года назад
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.
@johnjeremih
@johnjeremih Год назад
At 13:06 hiltNavGraphViewModel doesn't work anymore now it is hiltViewModel() as version 1.0.0
@cnkaptan
@cnkaptan 2 года назад
Thanks for tutorial but where can i find the source code of Bloom?❔
@Nomad7541
@Nomad7541 3 года назад
Thanks Ian! Your work is very helpful to the Android dev community
@RadiLayt7078
@RadiLayt7078 3 года назад
Concerning the compose navigation, how can we implement the transition animation between screens when navigating?
@Zhuinden
@Zhuinden 3 года назад
you can't
@RadiLayt7078
@RadiLayt7078 3 года назад
@@cepelinmaisis Is it implement now? because in previous navigation-compose version, this attributes aren't take into account
@Zhuinden
@Zhuinden 3 года назад
NavGraph XML? In Navigation-Compose? Where??
@IanLake
@IanLake 3 года назад
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
@robelseyoum1583
@robelseyoum1583 3 года назад
great demo, thanks
@YoutCodeProgrammingTutorials
@YoutCodeProgrammingTutorials 3 года назад
can I ask u what tool u are using to make this great presentations !?
@AIGameMonster
@AIGameMonster Год назад
I want to embed Unity Game into Compose UI, how can I do it better?
@bahaaka828
@bahaaka828 3 года назад
Any plans to have compose version of React Context Api
@abrarwiryawan
@abrarwiryawan 3 года назад
Where is the link to that sample app? is Bloom a commercial app belongs to company so the code is not shared?
@Soulcybering
@Soulcybering 3 года назад
One of the many samples you can find on GitHub: github.com/msasikanth/bloom
@abrarwiryawan
@abrarwiryawan 3 года назад
@@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
3 года назад
how do you guarantee the repository is instantiated when using it in the init block of the view model?
@OliverRhyme
@OliverRhyme 3 года назад
It is injected so it is already instantiated
3 года назад
​@@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
@OliverRhyme
@OliverRhyme 3 года назад
@ you have an instantiation code for your repository??
@viniciussantosguimares2994
@viniciussantosguimares2994 3 года назад
Feels like react router in android
@sanek1985t
@sanek1985t 2 года назад
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.
@IUfidi
@IUfidi 2 года назад
Senior dev level material.
@mast_mast_music
@mast_mast_music 5 месяцев назад
Excellent video but very hard to understand this accent. Tip: listen on 0.75 speed with subtitles. It helps. [Thank God the white guy took it over later 😂]
@pvarela
@pvarela 3 года назад
Jesus Christ!!
Далее