Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Jetpack Compose + design systems
Search
François Blavoet
May 03, 2022
Programming
450
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Jetpack Compose + design systems
François Blavoet
May 03, 2022
More Decks by François Blavoet
See All by François Blavoet
Accessibility made Easy
francois_blavoet
0
140
Vectorial Victories - Android Makers 2018 - Paris
francois_blavoet
0
850
New York Accessibility Hackathon - Accessibility on Android
francois_blavoet
1
130
SVG
francois_blavoet
0
140
And then my phone became smarter - A journey into the Awareness API - MobileEra 2016
francois_blavoet
0
740
And then my phone became smarter - A journey into the Awareness API
francois_blavoet
2
1.5k
Let's Sprinkle some #PerfMatters on your ViewGroups - Droidcon Turin 2016
francois_blavoet
10
1.6k
Let's Sprinkle some #PerfMatters on your ViewGroups - Droidcon Paris 2015
francois_blavoet
13
1.7k
Other Decks in Programming
See All in Programming
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
510
The Rails Doctrine Decade
koic
2
330
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1k
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
1
11k
市販E-Readerを乗っ取れ 〜Embedded Swiftで電子ペーパーガジェットを制御する〜
trickart
0
200
モバイル交通系ICへのチャージ実例から考える、クロスプラットフォーム開発におけるiOS実機テスト設計とCI運用
yusuga
1
540
FreeBSDでZabbixを動かす
kenkino
0
320
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
160
thread_parallel_with_free-threaded_Python_and_NumPy.pdf
riku_sakamoto
0
350
SREの越境 / SRE Collaboration
y0hgi
2
270
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
160
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
160
Featured
See All Featured
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.8k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.1k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
The Limits of Empathy - UXLibs8
cassininazir
1
690
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
990
RailsConf 2023
tenderlove
30
1.6k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
1k
Designing Powerful Visuals for Engaging Learning
tmiket
1
580
Transcript
Jetpack Compose + Design Systems François Blavoet
Jetpack Compose • Compose is the future of Android UI
development • When is the best time to start adopting it ?
Design systems What is a Design system ? -> it
is a complete set of standards intended to manage design at scale using reusable components and patterns.
Design systems @GET("/addresses") fun getAddresses(): Single<GetAddressesResponse> @PUT("/addresses/{address_id}") fun updateAddress(@Path("address_id") id:
String, @Body body: Map<String, Any>): Single<AddressResponse>
Let’s have a look at one component
Let’s have a look at one component
Let’s have a look at one component
Let’s have a look at one component
Let’s have a look at one component Row.Content { leading(
label = "Order Changes Preferences", label2 = "Suggest replacements ...", ) trailing( label = "Edit", option = Row.TrailingOption.Clickable(onPreferenceClick) ) }
Let’s have a look at one component Row.Content { leading(
label = "Tue Jun 2, 4–5pm", option = LeadingOption.Icon(Icon.Time), ) }
One design system
Material Design
Material Design Button( onClick: () -> Unit, modifier: Modifier =
Modifier, enabled: Boolean = true, interactionSource: MutableInteractionSource = remember {..}, elevation: ButtonElevation? = ButtonDefaults.elevation(), shape: Shape = MaterialTheme.shapes.small, border: BorderStroke? = null, colors: ButtonColors = ButtonDefaults.buttonColors(), contentPadding: PaddingValues = ButtonDefaults.ContentPadding, content: @Composable RowScope.() -> Unit, )
Material Design?
Material Design? ?
None
Let’s implement our own system
Atoms
Atoms Requirements: • Day/night • Customizable for white label apps
• As easy to use as possible • Have an abstract representation outside of the composition
Atoms interface ColorSpec { @Composable fun value(): Color }
Atoms interface ColorSpec { @Composable fun value(): Color companion object
{ val SystemGrayscale70: ColorSpec = … val SystemGrayscale50: ColorSpec = … … } }
Atoms interface ColorSpec { @Composable fun value(): Color companion object
{ val SystemGrayscale70: ColorSpec = … val SystemGrayscale50: ColorSpec = … … fun fromColor(color: Color): ColorSpec { return StaticColor(color) } } }
Atoms @Composable fun DesignTheme( configuration: ThemeConfig? = null, content: @Composable
() -> Unit, ) { … } object DesignTheme { val colors: Colors @Composable @ReadOnlyComposable get() = LocalColors.current }
Atoms
Atoms interface IconSlot { @Composable fun Content(contentColor: Color) }
Atoms interface IconSlot { @Composable fun Content(contentColor: Color) companion object
{ fun fromResource( @DrawableRes res: Int, contentDescription: TextSpec?, ): IconSlot { return ResIcon(res, contentDescription) } } }
Atoms enum class Icons(@DrawableRes internal val resId: Int) : IconSlot
{ Accessibility(R.drawable.cp_accessibility), Account(R.drawable.cp_account), Add(R.drawable.cp_add), … }
Molecules
Molecules data class PillSpec( val label: TextSpec, val onClick: (()
-> Unit)?, val selected: Boolean = false, ) @Composable fun Pill( spec: PillSpec, modifier: Modifier = Modifier, )
Molecules data class PillSpec( val label: TextSpec, val onClick: (()
-> Unit)?, val selected: Boolean = false, ) @Composable fun Pill( spec: PillSpec, modifier: Modifier = Modifier, ) @Composable fun BasePill( selected: Boolean, onClick: (() -> Unit)?, modifier: Modifier = Modifier, … content: @Composable BoxScope.(contentColor: Color) -> Unit, )
Going Further import androidx.compose.material.Text @Composable fun Text( text: AnnotatedString, modifier:
Modifier = Modifier, style: TextStyle = LocalTextStyle.current, … ) {
Going Further import com.instacart.compote.foundation.Text @Composable fun Text( text: RichTextSpec, modifier:
Modifier = Modifier, style: TextStyle = TextStyleSpec.Default, … )
33
Thank you! François Blavoet