WHAT TO EXPECT WHEN WHAT TO EXPECT WHEN YOU'RE EXPECTING... JETPACK - - PowerPoint PPT Presentation

what to expect when what to expect when you re expecting
SMART_READER_LITE
LIVE PREVIEW

WHAT TO EXPECT WHEN WHAT TO EXPECT WHEN YOU'RE EXPECTING... JETPACK - - PowerPoint PPT Presentation

WHAT TO EXPECT WHEN WHAT TO EXPECT WHEN YOU'RE EXPECTING... JETPACK YOU'RE EXPECTING... JETPACK COMPOSE COMPOSE Mark Murphy, CommonsWare mmurphy@commonsware.com NEW TALK, WHO DIS? NEW TALK, WHO DIS? NEW TALK, WHO DIS? NEW TALK, WHO DIS?


slide-1
SLIDE 1

WHAT TO EXPECT WHEN WHAT TO EXPECT WHEN YOU'RE EXPECTING... JETPACK YOU'RE EXPECTING... JETPACK COMPOSE COMPOSE

Mark Murphy, CommonsWare mmurphy@commonsware.com

slide-2
SLIDE 2

NEW TALK, WHO DIS? NEW TALK, WHO DIS?

slide-3
SLIDE 3

NEW TALK, WHO DIS? NEW TALK, WHO DIS?

slide-4
SLIDE 4

A BRIEF COMPOSE HISTORY A BRIEF COMPOSE HISTORY

BECAUSE COMPOSE HASN'T BEEN AROUND LONG BECAUSE COMPOSE HASN'T BEEN AROUND LONG Announced at Google I|O 2019 First bits released fall 2019 Role: replacement UI framework Timeline Now: developer preview "Summer 2020": alpha 2021: stable

slide-5
SLIDE 5

A BIT OF COMPOSIN' A BIT OF COMPOSIN'

@Composable fun NewsStory() { val image = imageResource(R.drawable.header) Column(modifier = Modifier.padding(16.dp)) { val imageModifier = Modifier .preferredHeightIn(maxHeight = 180.dp) .fillMaxWidth() Image(image, modifier = imageModifier, contentScale = ContentScale.Crop) HeightSpacer(16.dp) Text("A day in Shark Fin Cove") Text("Davenport California")

slide-6
SLIDE 6

REVISITING GOOGLE AND REVISITING GOOGLE AND KOTLIN KOTLIN

THOSE WHO DO NOT LEARN FROM HISTORY... THOSE WHO DO NOT LEARN FROM HISTORY... 2017: Oh, you're interested in Kotlin? 2018: We support Kotlin! 2019: Kotlin first! But we still support Java! (hint: they said that once about Eclipse)

slide-7
SLIDE 7

TALENT ACQUISITION TALENT ACQUISITION

DEVELOPERS DON'T GROW ON TREES (USUALLY) DEVELOPERS DON'T GROW ON TREES (USUALLY) Hiring Android talent has been tough... until 2020 upended matters Being considered "behind the times" makes that tougher How long before you can't land talent because you're using Java? Reasonably likely that Compose will have a similar effect

slide-8
SLIDE 8

WHY WE CARE NOW WHY WE CARE NOW

VERSUS, Y'KNOW, LATER VERSUS, Y'KNOW, LATER Do you remember how that Kotlin migration went? Migrating to Compose will be narrower yet more complicated Narrower: effects grow closer you get to the UI rendering Complicated: less automatic tool support, most likely Perfect Planning Prevents Poor Production... Perhaps

slide-9
SLIDE 9

WHAT WE WANT WHAT WE WANT

BESIDES FEWER MURDER HORNETS BESIDES FEWER MURDER HORNETS Minimize transition pain... with minimal extraneous prep work, in case Compose fizzles Identify opportunities to improve the apps... as Compose itself is largely a lateral move

slide-10
SLIDE 10

KOTLINIZE! KOTLINIZE!

ALL THE THINGS! MOSTLY! ALL THE THINGS! MOSTLY! Compose relies upon a Kotlin compiler plugin to perform its magic Net: Java ain't walkin' through that door By the time Compose is mainstream, Java will be tech debt

slide-11
SLIDE 11

CLEAN UP YOUR LAYOUTS CLEAN UP YOUR LAYOUTS

THEY'RE PROBABLY CRUFTY THEY'RE PROBABLY CRUFTY Move everything you can into styles, themes, dimension resources, etc. Those still have roles in Compose More tools/libraries to assist, such as Accompanist Objective: minimize what is in the layouts, since those get rewritten

slide-12
SLIDE 12

GO EASY ON DATA BINDING GO EASY ON DATA BINDING

CAN'T MAKE AN OMELETTE... CAN'T MAKE AN OMELETTE... Data binding is tied to layout resources Layout resources are going away (mostly) Net: your binding expressions will need to get replaced Maybe don't change what you have, but perhaps don't add more to the pile

slide-13
SLIDE 13

A BIT MORE COMPOSIN' A BIT MORE COMPOSIN'

private data class AgreementViewState( val terms: Boolean, val privacy: Boolean ) { fun canProceed() = terms && privacy } @Composable fun Agreement() { Column( verticalArrangement = Arrangement.SpaceAround, horizontalGravity = Alignment.CenterHorizontally ) { val viewState = state { AgreementViewState(terms = false, privacy = f Column(horizontalGravity = Alignment Start) {

slide-14
SLIDE 14

EVEN MORE COMPOSIN' EVEN MORE COMPOSIN'

(INSERT ANDROID STUDIO HERE) (INSERT ANDROID STUDIO HERE)

slide-15
SLIDE 15

CLEAN UP YOUR CLEAN UP YOUR ARCHITECTURES ARCHITECTURES

YES, ALL OF THEM YES, ALL OF THEM Compose designed for unidirectional data flows State flows down Events flow up Widgets are not stateful May require some tweaking of your approaches (e.g., two-way data binding) Consistent architecture will simplify migration

slide-16
SLIDE 16

IDENTIFY TACTICAL UI IDENTIFY TACTICAL UI IMPROVEMENTS IMPROVEMENTS

MAKE GOOGLE HAPPY! USERS TOO! MAKE GOOGLE HAPPY! USERS TOO! Landscape? Dark mode? Split-screen?

slide-17
SLIDE 17

PONDER MOONSHOTS PONDER MOONSHOTS

CREW DRAGON HAS TOUCHSCREENS, SO... CREW DRAGON HAS TOUCHSCREENS, SO... Things that are "game changers" that Compose might make easier to achieve Example: Desktop via ui-desktop Kotlin/Multiplatform Windows/macOS/Linux via the JVM Can you expand your market with modest re-engineering?

slide-18
SLIDE 18

BUDGET PLAY TIME BUDGET PLAY TIME

SKIN YOUR KNEES EARLY! SKIN YOUR KNEES EARLY! By the time Compose reaches beta, try to start experimenting Partly, so you can learn and use that knowledge to better steer your plans Partly, so you can tell us what you need to succeed Tell your favorite GDE Tell your favorite Compose library maintainer Tell #compose on Kotlinlang Slack (or DM me there)

slide-19
SLIDE 19

PREPARE ARGUMENTS FOR PREPARE ARGUMENTS FOR MANAGEMENT MANAGEMENT

OR PERHAPS JUST GENTLE CONVERSATIONS OR PERHAPS JUST GENTLE CONVERSATIONS Why are we bothering with Compose? (recruiting) Will this interrupt our delivery schedules? (hopefully not, using progressive replacement) How does this help our users? (tactical UI changes plus moontshots) How does this help the CEO's golf game? (you're on your own for that

  • ne)
slide-20
SLIDE 20

R-E-L-A-X R-E-L-A-X

WHAT? WRONG QB? WHAT? WRONG QB? Expect a significant hype train All the cool kids will be slinging Compose code You will get your turn too Do right by your users and your team, and don't Compose without a plan

slide-21
SLIDE 21

WHERE TO GET THIS WHERE TO GET THIS PRESENTATION PRESENTATION

https://commonsware.com/presos/2020-06-Compose/