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
75
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
130
Migrate to Gradle version catalog and convention plugins
tatocaster
3
1.7k
Make Codebases Secure with OWASP
tatocaster
0
170
Secure Coding Standards
tatocaster
0
120
ტანგო ანდროიდთან
tatocaster
0
170
Adopting Huawei Mobile Services
tatocaster
0
45
Android UI Testing & Challenges
tatocaster
1
66
Reverse & Inject - droidcon
tatocaster
3
230
mobile DevOps
tatocaster
1
81
Other Decks in Programming
See All in Programming
1人で挑むSwiftコンパイラ 〜型システム入門編〜
s_shimotori
0
330
長期運用プロダクトの開発速度を維持し続けるためのリファクタリング実践例
wataruss
8
2.6k
dRuby 入門者によるあなたの身近にあるdRuby 入門
makicamel
4
350
Go Code Generation at newmo / 2024-08-27 #newmo_layerx_go
genkey6
0
550
月間4.5億回再生を超える大規模サービス TVer iOSアプリのリアーキテクチャ戦略 - iOSDC2024
techtver
PRO
1
750
オートマトン学習しろ / Do automata learning
makenowjust
3
110
Prolog入門
qnighy
3
880
メモリ最適化を究める!iOSアプリ開発における5つの重要なポイント
yhirakawa333
0
400
Boost Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
150
A New Era of Testing
mannodermaus
2
130
開発を加速する共有Swift Package実践
elmetal
PRO
0
380
Desafios e Lições Aprendidas na Migração de Monólitos para Microsserviços em Java
jessilyneh
2
140
Featured
See All Featured
Facilitating Awesome Meetings
lara
49
5.9k
Building Flexible Design Systems
yeseniaperezcruz
325
37k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
230
17k
Optimising Largest Contentful Paint
csswizardry
29
2.8k
In The Pink: A Labor of Love
frogandcode
139
22k
Rails Girls Zürich Keynote
gr2m
93
13k
Art, The Web, and Tiny UX
lynnandtonic
294
20k
GitHub's CSS Performance
jonrohan
1029
450k
Code Review Best Practice
trishagee
62
16k
Build The Right Thing And Hit Your Dates
maggiecrowley
30
2.2k
StorybookのUI Testing Handbookを読んだ
zakiyama
26
5k
Raft: Consensus for Rubyists
vanstee
135
6.5k
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