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
110
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Facebook Litho
Droid Up 7.0 , 2017 talk about Facebook Litho
Merab Tato Kutalia
May 04, 2017
More Decks by Merab Tato Kutalia
See All by Merab Tato Kutalia
What's new in Android 14?
tatocaster
0
210
Migrate to Gradle version catalog and convention plugins
tatocaster
3
1.9k
Make Codebases Secure with OWASP
tatocaster
0
220
Secure Coding Standards
tatocaster
0
180
ტანგო ანდროიდთან
tatocaster
0
340
Adopting Huawei Mobile Services
tatocaster
0
84
Android UI Testing & Challenges
tatocaster
1
130
Reverse & Inject - droidcon
tatocaster
3
330
mobile DevOps
tatocaster
1
160
Other Decks in Programming
See All in Programming
Contextとはなにか
chiroruxx
1
380
はてなアカウント基盤 State of the Union
cockscomb
1
1k
Strategic Design in the Frontend: Moduliths & Micro Frontends @DDDEurope
manfredsteyer
PRO
0
130
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2.4k
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.4k
OSもどきOS
arkw
0
600
AI 輔助遺留系統現代化的經驗分享
jame2408
1
1.1k
ローカルLLMを使ってB2Bサービスを作っていての学び
yaotti
0
220
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
310
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
220
Datadog LLM Observabilityで実現する 安全なLLM Usage 管理
3150
0
120
Creating Composable Callables in Contemporary C++
rollbear
0
170
Featured
See All Featured
Un-Boring Meetings
codingconduct
0
330
Design in an AI World
tapps
1
250
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
Automating Front-end Workflow
addyosmani
1370
210k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.3k
Skip the Path - Find Your Career Trail
mkilby
1
160
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
150
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
590
Visualization
eitanlees
152
17k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
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