mortar & flow - mce 2015

Post on 23-Jul-2015

583 Views

Category:

Engineering

3 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Pierre-Yves Ricau / @Piwai

Mortar & Flow

Fragments

http://corner.squareup.com/2014/10/advocating-against-android-fragments.html

https://www.flickr.com/photos/albaraa/7087660805/

Lessons

• Single Activity Interface • Local Backstack • DIY: activities, views and layout inflater

Backstack

Flow

• Flow = navigation controller & holds backstack • Screen = URL: params + layout

Single Responsibility Principle

Dependency Injection

Boring boilerplate

Dagger

• @Inject • Compile time

Dagger 1

Dagger 2

Best practices

• Custom views • Presenters for business logic • Tests against presenters

Tests

Scoped Singletons

Mortar

• Create and manager scoped object graphs • Lifecycle when you need it

View

ContextWrapper Magic

Presenter with lifecycle

Questions?

@Piwai

top related