Expanded Library

MVVM & Nested Fragments/Views - ViewModel Contracts

by droidcon SF

Droidcon SF 2019 | MVVM & Nested Fragments/Views - ViewModel Contracts | Marcos Paulo Damesceno and Bret Erickson

What you'll learn

As smartphones get more powerful with bigger screens, the complexity of tasks that people want to be able to do with them follows the same growth. Fragments are making a comeback, combined with LiveData and ViewModels. As you adopt these architecture components into your apps, how can you build support for complex use cases with multiple fragments on screen? Should each fragment have a ViewModel? What about custom views? ViewModel Contracts propose the idea of having fragments (and potentially custom views) declare a ViewModel and LiveData via interface to abstract out all of the communication details between nested fragments and their parents. In this talk, Marcos Paulo Damesceno and Bret Erickson explain how to implement them, how architecture components deal with ViewModels, what ViewModelFactories are, and how you can reuse them.

Table of contents

MVVM & Nested Fragments/Views - ViewModel Contracts

About the author

Droidcon is the largest global network of developer conferences which bring together the industry's foremost experts dedicated to advancing the Android platform. Droidcon engages a global network of over 25,000 developers attending our events in 22 cities. Our first droidcon conference was held in 2009 in Berlin and since then it has spread its influence across the globe and has established itself as the world's foremost community-driven conference format. Droidcon is the place to meet the inter... more

Ready to upskill? Get started