Skip to content

EricAtPlanGrid/componentizationArch

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Netflix’s Android Componentization Architecture

Lifecycle aware, testable and reusable UI components for Android.

Droidcon NYC 2018 Talk

Droidcon SF 2018 Talk (Comming Soon)

Sample code

Fragment / Activity

...
LoadingComponent(container, EventBusFactory.get(this))
...

Component (Presenter/Controller/ViewModel)

...
bus.getSafeManagedObservable(ScreenStateEvent::class.java)
            .subscribe {
                when (it) {
                    ScreenStateEvent.Loading -> {
                        uiView.show()
                    }
                    ScreenStateEvent.Loaded -> {
                        uiView.hide()
                    }
                    ScreenStateEvent.Error -> {
                        uiView.hide()
                    }
                }
            }
...   

UIView

class LoadingView(container: ViewGroup) : UIView<UserInteractionEvent>(container) {
    private val view: View =
        LayoutInflater.from(container.context).inflate(R.layout.loading, container, true)
            .findViewById(R.id.loadingSpinner)
...            

Complete Samples

Basic Loading/Error/Success Screen

Basic Player UI Component

Unit Tests

Unit tests for Components

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 100.0%