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
Jetpack Compose
Search
TakuSemba
May 21, 2019
Technology
3.7k
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Jetpack Compose
TakuSemba
May 21, 2019
More Decks by TakuSemba
See All by TakuSemba
Customize & Debug ExoPlayer @droidkaigi 2020
takusemba
0
2.1k
Protobuf in Kotlin
takusemba
2
2k
Single Activity with MVVM
takusemba
4
1.4k
KotlinConf Report @ca.kt#7
takusemba
2
500
Request in a QUIC way @shibuya.apk#28
takusemba
2
1.1k
Lint for Kotlin @R.kt#3
takusemba
3
1.6k
Auto Release @potatochips#48
takusemba
1
1.3k
Media streaming on Android @droidkaigi 2018
takusemba
6
8.3k
gRPC on Android @DroidconSF Report
takusemba
1
640
Other Decks in Technology
See All in Technology
AI時代の開発生産性を捉え直す — 経営と現場をつなぐ「開発組織のオブザーバビリティ」— / AI Dev Ex Conference 2026
tkyowa
0
180
Making sense of Google’s agentic dev tools
glaforge
1
290
壊して学ぶAWS CDK: そのcdk deployで消えるもの、残るもの
k_adachi_01
1
420
「顧客の声を聞かなければ何も始まらない」 ── 顧客の声から生まれた『AI返信補助機能』の開発プロセス / AICon2026_shikata_imai
rakus_dev
0
140
Type-safe IaC for Dart
coborinai
0
160
【Claude Code】鹿野さんに聞く 私の推しの並行開発環境 大公開 / claude-code-parallel-2026-07-15
tonkotsuboy_com
13
8.8k
第67回コンピュータビジョン勉強会CVPR2026読会前編
tsukamotokenji
0
150
AIが実装を自走する時代の認知負債との戦い
lycorptech_jp
PRO
1
600
副作用のある Lambda でも Lambda Power Tuning は使えるのか / lambda-power-tuning-side-effects
koukihosaka
1
120
Data + AI Summit 2026 イベントレポート: 「AIがビジネスで意思決定するデータ基盤」へ
nek0128
0
280
プロダクト開発組織の現在地(Ver.2026/07) / product-organization
kaonavi
0
120
最適な自走を最小限の支援で — M&Aで拡大する組織で少人数SREが挑んだ1年 / SRE NEXT 2026
genda
0
1.5k
Featured
See All Featured
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
64
56k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.2k
Navigating Weather and Climate Data
rabernat
0
380
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
For a Future-Friendly Web
brad_frost
183
10k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Into the Great Unknown - MozCon
thekraken
41
2.6k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.7k
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
200
Transcript
+FUQBDL$PNQPTF TakuSemba CyberAgent.Inc
@takusemba https://github.com/TakuSemba
+FUQBDL$PNQPTF
+FUQBDL$PNQPTF https://www.youtube.com/watch?v=VsStyq4Lzxo
@Composable fun Greeting(name: String) { Text ("Hello $name!") }
@Composable fun Greeting(name: String) { Text ("Hello $name!") }
None
None
What’s Composable
What’s Composable ɾA new set of Jetpack UI widgets
What’s Composable ɾA new set of Jetpack UI widgets ɾA
kotlin compiler plugin
What’s Composable ɾA new set of Jetpack UI widgets ɾA
kotlin compiler plugin ɾFully compatible with your existing app/code
What’s Composable ɾA new set of Jetpack UI widgets ɾA
kotlin compiler plugin ɾFully compatible with your existing app/code ɾExperimental
@Composable
Text(“Hello world!”)
@Composable fun Greeting(name: String) { Text("Hello $name!") }
@Composable fun Greeting(name: String) { Text("Hello $name!") } class ComposeSampleActivity
: Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) } }
@Composable fun Greeting(name: String) { Text("Hello $name!") } class ComposeSampleActivity
: Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { CraneWrapper { Greeting("takusemba") } } } }
@Composable fun Greeting(name: String) { Text("Hello $name!") } class ComposeSampleActivity
: Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { CraneWrapper { Greeting("takusemba") } } } }
@Composable fun Greeting(name: String) { Text("Hello $name!") } class ComposeSampleActivity
: Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { CraneWrapper { Greeting("takusemba") } } } }
@Composable fun Greeting(name: String) { Text("Hello $name!") } class ComposeSampleActivity
: Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { CraneWrapper { Greeting("takusemba") } } } }
class ComposeSampleActivity : Activity() { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) setContent { CraneWrapper { MaterialTheme { Greeting("takusemba") } } } } } @Composable fun Greeting(name: String) { Text("Hello $name!") }
@Composable fun Greeting(name: String) { Text(text = "Hello $name!", style
= +themeTextStyle { h5 }) } class ComposeSampleActivity : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { CraneWrapper { MaterialTheme { Greeting("takusemba") } } } } }
@Composable fun <T> ScrollingList( data: List<T>, body: @Composable()(T) -> Unit
) { // ... body(item) // ... }
@Composable fun <T> ScrollingList( data: List<T>, body: @Composable()(T) -> Unit
) { // ... body(item) // ... } @Composable fun NewsFeed(stories: List<Story>) { ScrollingList(stories) { story -> StoryWidget(story) } }
@Composable fun <T> ScrollingList( data: List<T>, body: @Composable()(T) -> Unit
) { // ... body(item) // ... } @Composable fun MenuList(items: List<Item>) { ScrollingList(items) { item -> when (item) { is FoodItem -> FoodWidget(item) is DrinkItem -> DrinkWidget(item) } } }
@Model
@Composable fun Greeting(name: String) { Text("Hello $name!") }
@Composable fun Greeting(name: String) { val count = +state {
0 } Column { Button(text = "greet", onClick = { count.value++ }) Text(text = "$name greeted ${count.value} times") } }
@Composable fun Greeting(name: String) { val count = +state {
0 } Column { Button(text = "greet", onClick = { count.value++ }) Text(text = "$name greeted ${count.value} times") } }
@Composable fun Greeting(name: String) { val count = +state {
0 } Column { Button(text = "greet", onClick = { count.value++ }) Text(text = "$name greeted ${count.value} times") } }
@Model class GreetCounter(var count: Int) { fun add() { count++
} fun substract() { count-- } } @Composable fun Greeting(name: String) { val count = +state { 0 } Column { Button(text = "greet", onClick = { count.value++ }) Text(text = "$name greeted ${count.value} times") } }
@Model class GreetCounter(var count: Int) { fun add() { count++
} fun substract() { count-- } } @Composable fun Greeting(name: String) { val counter = +memo { GreetCounter(0) } Column { Button(text = "greet", onClick = { count.add() }) Text(text = "$name greeted ${count.count} times") } }
@Composable fun Greeting(name: String) { val counter = +memo {
GreetCounter(0) } Column { Button(text = "greet", onClick = { count.add() }) Text(text = "$name greeted ${count.count} times") } } @Model class GreetCounter(var count: Int) { fun add() { count++ } fun substract() { count-- } }
@Model class LoginState(var username: String, var password: String) { val
valid: Boolean get() = username.isNotEmpty() && password.isNotEmpty() }
@Model class LoginState(var username: String, var password: String) { val
valid: Boolean get() = username.isNotEmpty() && password.isNotEmpty() } @Composable fun LoginScreen(onClick: () -> Unit) { val model = +memo { LoginState() } EditText( text=model.username, onTextChange={ text -> model.username = text } ) EditText( text=model.password, onTextChange={ text -> model.password = text } ) Button(text="Login", enabled=model.valid, onClick={ onClick() }) }
@Model class LoginState(var username: String, var password: String) { val
valid: Boolean get() = username.isNotEmpty() && password.isNotEmpty() } @Composable fun LoginScreen(onClick: () -> Unit) { val model = +memo { LoginState() } EditText( text=model.username, onTextChange={ text -> model.username = text } ) EditText( text=model.password, onTextChange={ text -> model.password = text } ) Button(text="Login", enabled=model.valid, onClick={ onClick() }) }
@GenerateView
@Composable fun Greeting(name: String) { Text ("Hello $name!") }
@Composable @GenerateView fun Greeting(name: String) { Text ("Hello $name!") }
@Composable @GenerateView fun Greeting(name: String) { Text ("Hello $name!") }
// In your existing xml <GreetingView app:name="takusemba" />
@Composable @GenerateView fun Greeting(name: String) { Text ("Hello $name!") }
// In your existing xml <GreetingView app:name="takusemba" /> // find view by Id val greeting = findViewById(R.id.greeting)
@Discussion
None
+FUQBDL$PNQPTF https://github.com/takusemba https://twitter.com/takusemba