The Airbnb Tech Blog | Medium

Introducing Trio | Part II

Part two of the series discusses Trio, Airbnb's Compose-based architecture for Android. Trio simplifies navigation by storing Trios in ViewModel's state, allowing for easy navigation control. The ViewModel can update data and navigation in one place, making asynchronous navigation changes possible. The navigation stack is modeled by a chain of ViewModels and their states, creating a corresponding Compose UI hierarchy. Trios can represent various UI elements, including nested screens and sections. The modularization structure involves feature modules containing Trio screens and navigation modules defining routers. Routers ensure type safety and reduce circular dependencies. The Router class helps instantiate Trios and create intents for starting new activities. When starting Trios in new activities, the Trio instance is extracted from the intent and shown in the activity's content. Trio's navigation system supports starting activities for results using Result types on the router.
favicon
medium.com
medium.com
Create attached notes ...