Тёмный

Understanding Compose (Android Dev Summit '19) 

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

This session covers the benefits of a declarative reactive UI system like Jetpack Compose and how it applies to real problems that Android developers have today. Additionally, this talk expands on the programming model of Jetpack Compose and some of its implementation details the can help you understand how Compose works.
Presented by: Leland Richardson‎
Jetpack Sessions → goo.gle/AndroidJetpack
Android Dev Summit '19 all sessions playlist → goo.gle/ADS19allsessions
Subscribe to the Android Developers channel! → goo.gle/AndroidDevs
Check out the photo album → goo.gle/ADS19Photos
#AndroidDevSummit #jetpackcompose event: Android Dev Summit 2019; re_ty: Publish; product: Android - Jetpack Compose; fullname: Leland Richardson;

Наука

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

 

8 июл 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 93   
@CodyEngelCodes
@CodyEngelCodes 4 года назад
Really awesome video, I can't wait to see how Compose progresses. Playing around with it during the conference was very promising though. I think after I get through the rest of my Modern Android Development video series I'll start creating one for future looking things (such as Compose) 😁
@alexneeky7920
@alexneeky7920 4 года назад
Google io 2021 we are introducing redux-compose and redux-coroutines for communication between different layers
@oziespeed8444
@oziespeed8444 3 года назад
@DNO h1ldny21r7jr92h8h6le26ayue612t2rl3gn2a2c3snyiapinm227h2621 d2.22obe72t72vre4wxf322222leta3ja12q9y72 2km722vgmea2toz5hv3v3wa52hq6lflfpehvs6wg6a2kk2h56SD72GQFMHVT4MKVCWA764W221DV43U1G2VEJMWYABEANBV340JFW4922HA2DDEM2N7V249H2GFLMW32WEH2NV6V3GJSSU2QUAmei4fiew6ccks72n1btkgml9bw2r21f2512t2prn68m27QUALITY606EABGS5.ID22F3U1EBf3ym9cim9y2c asb22w0ARvs22tu22vRme0hball7k26l5fl3ybdw12lbffx2qvg20m35mj932ww2ar97hb7velvetdw8g77a2lv1goew2a251m2h2sb882422na3623ac33d022wg13xw2n1rk24er223rm27wet3372r2ym21y22men722j2ve2s.org5gV3md1fergiel253yuhqqrek02w2a3mv22ak25btf.r5mnn2rn33wp bgs25yjx2kww2y56ivaxh227w7u22g2tb1f7w72kaf9ri2d2vwell24jwa3072yax721cl5xawejgqsa411r4Vmtkh65skryq2l90s2239211feyihv2282b4v66eev3x9j222eyevm2r6suRweaq2b61222l27b5v452c022m2265f2u22C2vvfex4ms233l3222gt0lmnglr5hn27,a1132l2xese2kh2e
@moshewaisberg7639
@moshewaisberg7639 4 года назад
Google is trying to migrate layout XMLs to be like Flutter?
@nikhilshetye2229
@nikhilshetye2229 4 года назад
Exactly
@i-am-learning-life
@i-am-learning-life 4 года назад
Exactly 😂😂
@JohnSeabourn
@JohnSeabourn 4 года назад
It's competing with Apple's SwiftUI
@antekone1
@antekone1 4 года назад
I hope so!
@jackvial5591
@jackvial5591 4 года назад
SwiftUI, Jetpack Compose and Flutter are all based on React
@BasantSiingh
@BasantSiingh 4 года назад
So it's basically like React Components now, which is a good thing!
@redstrike91dn
@redstrike91dn 3 года назад
I was right when I said it's quite similar to React.js (with Hooks + Functional Components).
@liyu6978
@liyu6978 2 года назад
@@redstrike91dn yeah, and even those side effects APIs look similar, too!
@abnerwilliams6591
@abnerwilliams6591 4 года назад
awesome share for go deep into ui development construct.
@praveen18p1
@praveen18p1 Год назад
Very helpful video, compose makes much more sense after understanding this.
@AndroidDevelopers
@AndroidDevelopers Год назад
Hey, Praveen! Thanks so much for your kind words! For more on Jetpack at Android Dev Summit '19, check out the featured playlist-that includes this video-below 👇 goo.gle/3BzXMQT
@robchr
@robchr 4 года назад
You had me at declarative ui
@meridiansoftware6177
@meridiansoftware6177 4 года назад
Well, you convinced me!
@Condog64
@Condog64 2 года назад
@9:20 When declaring Declarative vs Imperative, there is a minor bug in the imperative code (if no paper, remove paper). But, more importantly, the declarative code doesn't even handle the edge case of displaying the text "99+". It wouldn't add much complexity to cover that edge case in the declarative code (Badge(text=if(fire) "99+" else "$count") but it feels dishonest to ignore it and benefit from the code looking "cleaner".
@arvindrangarajan1241
@arvindrangarajan1241 3 года назад
Does this mean that we will go away from context and reference of the activity to the views ?
@santoshpillai3696
@santoshpillai3696 3 года назад
Notes for myself - Declarative vs Imperative: 8:40 - Composition: 11:00 - What @composable actually does? 18:19
@danieldaschle
@danieldaschle 4 года назад
I didn't understand yet what the "+" before the "hooks" mean.
@leonk6950
@leonk6950 4 года назад
I guess it's some kind of "hack" where they abuse the operator function to invoke some stuff internally, I really don't know for sure though. I'd guess it's similar to how you do div { +"Foo bar" } In kotlinx.html. the + is just a shorter way of invoking something as a function that actually isn't one (like the string litteral here) Maybe this is calling some function in the context of the composeable function, so as to be able to reference the surrounding function in any way 😉
@ankurg_
@ankurg_ 4 года назад
That will go away before the release.
@CodyEngelCodes
@CodyEngelCodes 4 года назад
It seems like you use the + for effect operators. The documentation is still pretty sparse though, the compose channel in the Kotlin slack community is really active though and a great place to provide feedback.
@Kushtrimm2
@Kushtrimm2 4 года назад
It's unaryPlus operator. See this: kotlinlang.org/docs/reference/operator-overloading.html
@ChromeExtension
@ChromeExtension 4 года назад
It's a common thing used for kotlin DSL builders. It effectively uses the overloaded version of the unary operator and invokes the "function" with a receiver based on the context/body it is in. See the docs for more info kotlinlang.org/docs/reference/type-safe-builders.html Although I'm not 100% sure whether the compose plugin does something slightly different to this.
@ikeo8666
@ikeo8666 2 года назад
20:20 this is why you learn algorithms when interviewing for FAANG
@user-lc7ku6je1o
@user-lc7ku6je1o 4 года назад
If I understand this properly, it's able to memorize states of your UI and change views only if the state changes. Seems powerful, but the usage is still confusing. First, I didn't get what the '+' operator means. Next, it was told that "a composable function can be called from only within a composable function", so, how can one use this with libraries like, for example, RxJava? In the presentation there is a call to getData() function (25:42), which either returns the prepared data or returns null, if the data is not ready yet. And thus, there must be a way to re-call the composable App function when the data is ready. How is this handled? Does the module which provides the data call the UI module's App function? - But that's a total snafu because it's typically the UI which calls the data module's methods. So, after watching 2 videos from Google IO's about composable UI I'm left with a huge misunderstanding.
@abunapha
@abunapha 4 года назад
> First, I didn't get what the '+' operator means. It's getting removed > how can one use this with libraries like, for example, RxJava? A composable function can call any normal function (but not the other way around). There's not much reason to use RxJava with compose though. > And thus, there must be a way to re-call the composable App function when the data is ready. How is this handled? When the data is ready it will trigger a callback that will call recompose() which will call the same composable App function again.
@antonmalyshev5002
@antonmalyshev5002 4 года назад
@@abunapha but who exactly will call recompose when the data is ready? ViewModel?
@samuelprince3900
@samuelprince3900 4 года назад
I believe using the @Model annotation to create a UI state would be useful in the cases where RxJava is used. The @Model classes are "converted" into observables under the hood as i understood it, so changing the state would automatically be reflected in the UI as the state drives the UI.
@samduranyoutubebrandaccoun4126
@samduranyoutubebrandaccoun4126 4 года назад
Great
@RinoSss
@RinoSss 4 года назад
Welcome Flutter!
@jibraniqbal7830
@jibraniqbal7830 4 года назад
So it's react and that's cool.
@deepakbisht4957
@deepakbisht4957 Год назад
No it's declarative. Both things are now declarative ui things...
@JoseMachava
@JoseMachava 4 года назад
this is a huge game changer
@nOx1D3
@nOx1D3 4 года назад
no it's not
@user-hl9vw2gz6t
@user-hl9vw2gz6t 3 месяца назад
great!from china
@siddharthareddy2006
@siddharthareddy2006 4 года назад
I think at 9:38 Last second if statement is wrong
@maxchin2
@maxchin2 3 года назад
im lost since minute 16, the recomposition. Compose is simply an implementation of React.js's Component. Why not use the same name, it is good for developer :D
@iphonebonn
@iphonebonn 4 года назад
Betting on Kotlin takes its toll. Requiring changes to a compiler for such things is ridiculous. But as the CTO of Jetbrains often reiterates, he doesn't see use cases for compile time functions (aka real macros). Well this here is one of 'em.
@DonaldTamMisterDee
@DonaldTamMisterDee 2 года назад
I think they could have used Kotlin language constructs for abstraction instead of the @Composable annotation the @Composable basically creates a new language out of the standard Kotlin, which makes things confusing to me
@GianetanSekhon
@GianetanSekhon 4 года назад
Second comment from India, first one from 50 ft under the ground.
@nOx1D3
@nOx1D3 4 года назад
9:32 , that code is wrong.
@Elphoya
@Elphoya 4 года назад
true, removePaper() addPaper()
@ranjietolentinoalag4884
@ranjietolentinoalag4884 2 года назад
SteadFast Updated
@OresteAcacia
@OresteAcacia 4 года назад
For me is total no-sense, I think they will provide this as an external library to integrate in projects but we still be able to use XML layouts, then this approach for me has so much lacks. For example how this approach would works if I want to build a custom animated drawable? Then, how to extend a Button() to make a custom view? Then how to see layout changes in real time while creating the view inside the editor itself? It should let me see a preview of what the final result is I will prefer XML so far, it is much clear then with dataBinding it is the top of the top
@dineshraturi
@dineshraturi 4 года назад
exactly.
@deepakbisht4957
@deepakbisht4957 Год назад
Lol you are talking about the things you don't know. Compose has everything covered that you are asking for...
@TheDnaitsirc
@TheDnaitsirc 4 года назад
Is this still a thing? Android associate certification doesn't cover this
@dariushmalek6325
@dariushmalek6325 4 года назад
val count = +state { 0 } :| What does it mean?!!
@leonk6950
@leonk6950 4 года назад
That the count is a state variable (all changes to count are observed and will cause the composeable function to rerender. And to initialize it with a value of 0 It's pretty much the same thing as "useState" from react hooks
@yaroslavkulinich7155
@yaroslavkulinich7155 4 года назад
Think about this like "create livedata with init value of 0 lazily "
@Apenschi
@Apenschi 4 года назад
So, if you make Kotlin like Flutter, then why shouldn't I use Flutter in the first place?
@k4ba
@k4ba Год назад
That was not the point
@xiaochuanyao5346
@xiaochuanyao5346 4 года назад
it is much more convenient to build ui in android than in iOS,but experience in iOS is better.
@devarshbhatt5612
@devarshbhatt5612 4 года назад
First Comment from Star-Link
@yishubaghel5824
@yishubaghel5824 4 года назад
Can anyone tell me that how can I improve my coding skill without any cost?... . please
@leasual
@leasual 4 года назад
First comment from China
@bestintentions6089
@bestintentions6089 4 года назад
It's like react but for Android
@liskajp
@liskajp 4 года назад
pavelzaitsev Except without all the expensive runtime tree diffing
@mightytechno
@mightytechno 4 года назад
More like flutter
@gondaimgano
@gondaimgano 4 года назад
Welcome Kotlin to the flutter /react world what took you so long kkk
@pixelPlex
@pixelPlex 4 года назад
You have forgotten that Kotlin already has solutions for building/managing views (some predate JetPack Compose, and Flutter by a few years like Anko and KotlinX HTML for example): - Anko ( github.com/Kotlin/anko ) - KotlinX HTML ( github.com/Kotlin/kotlinx.html ) - TornadoFX ( tornadofx.io/ ) - Fritz2 ( www.fritz2.dev/ ; ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-s_C3uhThzgk.html ) - Kotlin React ( ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-FDOECr-sT6U.html ) Both Android, and Flutter are late to the party :) .
@sabinshrestha8176
@sabinshrestha8176 4 года назад
Comment from ..... See dp 😀
@santoshacharya2994
@santoshacharya2994 4 года назад
I thought i was the first
@i-am-learning-life
@i-am-learning-life 4 года назад
So we are the gang of Nepalese Android developer 😍😍
@electronszinc6270
@electronszinc6270 4 года назад
First Comment from Swaziland
@maxchin2
@maxchin2 4 года назад
Sample app of Compose on github.com/android github.com/android/compose-samples
@evertsmits4952
@evertsmits4952 4 года назад
9:35 alright so if (count > 0 && !hasPaper()) remove the paper anyway. I guess we're not getting any paper boys. Maybe this mistake was to show us how easily bugs are introduced ;)
@002jeevan
@002jeevan 4 года назад
I do not understand exact reasons of introducing compose . Even XML layout are also declarative. Isn't ? we leave out exact position and make that to be more generic to fit all type of devices .
@deepakbisht4957
@deepakbisht4957 Год назад
Lol no. XML has lots of coupling and from so many places from where the state of a ui can change...
@hadifromlebanon3812
@hadifromlebanon3812 4 года назад
Did the flutter team help with this
@abunapha
@abunapha 4 года назад
yes
@Majora96
@Majora96 3 года назад
9:26 and 9:46 are terrible examples. The non-compose code at 9:26 is intentionally written badly. You could write it in a very similar manner to the compose example. And the compose example is terrible because it's the opposite of separating concerns. The first 5 minutes is talk about separating concerns and then you give an example with business logic and ui mixed together.
@Majora96
@Majora96 2 года назад
For the most part I think this video is terrible. Not that Compose is terrible, but there's a lot of programming buzzwords, explanations, and examples thrown out that just don't make sense and aren't being used correctly. So don't fret if this video didn't totally make sense to you.
@selimcangunduz3506
@selimcangunduz3506 2 года назад
senin bu hareketleri bana yapmna hiç anlam veremyom gercekden sen böle biri deyilsin ama oluyormuş
@Rajmanov
@Rajmanov 4 года назад
First comment from Mexico 😈🥰
@CesarTreetops
@CesarTreetops 4 года назад
Rajmanov damn it was going to comment that
@edwinbello4311
@edwinbello4311 4 года назад
First comment from Kenya
@jackvial5591
@jackvial5591 4 года назад
Can’t we just have Swift on Android already and make app devs lives easier
@deepakbisht4957
@deepakbisht4957 Год назад
Can't we just have Kotlin in iOS. Can't Xcode and iOS development directly done in Windows platform instead of buying Mac for that...
@huangdi7116
@huangdi7116 4 года назад
It's flutter kotlin version
@huulamhoang4276
@huulamhoang4276 4 года назад
right guy, the same idea lol=]]~
@carbloq
@carbloq 4 года назад
First comment from India
@jamesgrugett6840
@jamesgrugett6840 4 года назад
First reply from Thailand!
@ikeo8666
@ikeo8666 2 года назад
lies. you still have to think about it because of rules and behaviors of recomposition.
@Dpk950
@Dpk950 4 года назад
I really don't like this flutter version of the Android. We have already XML which manages layouts amazingly amd also separates the UI logic, then why bringing this one, a component driven programming like flutter/react does.
@deepakbisht4957
@deepakbisht4957 Год назад
Because Declarative programming is more superior than coupling your code with XML...
@fleeingturtle
@fleeingturtle 10 месяцев назад
​@@deepakbisht4957if what you said is true, android should fix xml by adopting QML much earlier😂😂😂
@deepakbisht4957
@deepakbisht4957 10 месяцев назад
@@fleeingturtle well what I said is the truth. I have been doing Android development since the start and writing XML is not an issue for me but it has a lot of coupling and that's the issue from the start. They came up with XML from early days and it's not like they will still stick to the same thing after a decade...
@sanek1985t
@sanek1985t 9 месяцев назад
​@@deepakbisht4957what do you mean by "lot of couple"?
Далее
What's new in Jetpack Compose (Android Dev Summit '19)
41:02
3M❤️ #thankyou #shorts
00:14
Просмотров 8 млн
Testing Coroutines on Android (Android Dev Summit '19)
20:51
Compose Modifiers deep dive
21:02
Просмотров 32 тыс.
Declarative UI patterns (Google I/O'19)
35:11
Просмотров 100 тыс.
Thinking in Compose
25:27
Просмотров 86 тыс.
Так ли Хорош Founders Edition RTX 4080 ?
13:00
Сложная распаковка iPhone 15
1:01
Просмотров 14 тыс.