Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Facebook Litho
Search
Merab Tato Kutalia
May 04, 2017
Programming
2
78
Facebook Litho
Droid Up 7.0 , 2017 talk about Facebook Litho
Merab Tato Kutalia
May 04, 2017
Tweet
Share
More Decks by Merab Tato Kutalia
See All by Merab Tato Kutalia
What's new in Android 14?
tatocaster
0
140
Migrate to Gradle version catalog and convention plugins
tatocaster
3
1.7k
Make Codebases Secure with OWASP
tatocaster
0
180
Secure Coding Standards
tatocaster
0
130
ტანგო ანდროიდთან
tatocaster
0
190
Adopting Huawei Mobile Services
tatocaster
0
48
Android UI Testing & Challenges
tatocaster
1
69
Reverse & Inject - droidcon
tatocaster
3
260
mobile DevOps
tatocaster
1
90
Other Decks in Programming
See All in Programming
バグを見つけた?それAppleに直してもらおう!
uetyo
0
180
php-conference-japan-2024
tasuku43
0
310
情報漏洩させないための設計
kubotak
2
250
useSyncExternalStoreを使いまくる
ssssota
6
1.1k
103 Early Hints
sugi_0000
1
230
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
140
開発者とQAの越境で自動テストが増える開発プロセスを実現する
92thunder
1
190
Amazon S3 NYJavaSIG 2024-12-12
sullis
0
100
各クラウドサービスにおける.NETの対応と見解
ymd65536
0
100
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
190
42 best practices for Symfony, a decade later
tucksaun
1
180
競技プログラミングへのお誘い@阪大BOOSTセミナー
kotamanegi
0
360
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
Into the Great Unknown - MozCon
thekraken
33
1.5k
4 Signs Your Business is Dying
shpigford
181
21k
Building Applications with DynamoDB
mza
91
6.1k
Navigating Team Friction
lara
183
15k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
95
17k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
0
98
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Transcript
Facebook Litho A declarative UI framework for Android
Tato Kutalia tatocaster tatocaster.me github.com/tatocaster twitter.com/@tatokutalia
Litho’s History
Litho’s History iOS Platform, now known as Texture(Pinterest).
Litho Appeared @ Facebook F8 primarily built to implement complex
scrollable UIs based on RecyclerView.
Litho - View flattening - Declarative - AsyncLayout - Recycling
- Good Debugging Tools a declarative framework for building efficient UIs
Litho uses Yoga, also by Facebook cross-platform layout engine Everything
is a component immutable inputs knowns as Props React Terminology
Litho Core Elements State Props LayoutSpec - groups existing components
together in an immutable layout tree. MountSpec - defines a component that can render views or drawables.
Litho Recycler
Litho Touch and Click @LayoutSpec class ListItemSpec { @OnCreateLayout static
ComponentLayout onCreateLayout( ComponentContext c, @Prop(optional = true, resType = ResType.DIMEN_OFFSET) int shadowRadius, @Prop int color, @Prop String title, @Prop String subtitle) { return Column.create(c) .paddingDip(ALL, 16) .backgroundColor(color) .child( Text.create(c) .text(title) .textSizeSp(40)) .child( Text.create(c) .text(subtitle) .textStyle(ITALIC) .textSizeSp(20)) .clickHandler(ListItem.onClick(c)) .build(); } @OnEvent(ClickEvent.class) static void onClick(ComponentContext c, @FromEvent View view, @Prop OnListItemClickListener listener) { listener.onListItemClick(view); }
Litho Custom View
Litho Install // Litho compile 'com.facebook.litho:litho-core:0.2.0' compile 'com.facebook.litho:litho-widget:0.2.0' provided 'com.facebook.litho:litho-annotations:0.2.0'
annotationProcessor 'com.facebook.litho:litho-processor:0.2.0' // SoLoader compile 'com.facebook.soloader:soloader:0.2.0' // Optional // For debugging debugCompile 'com.facebook.litho:litho-stetho:0.2.0' //stetho itself compile 'com.facebook.stetho:stetho:1.5.0'
Litho Summary and Demo