MVI and the Sample App
The sample app uses the simplified MVI approach outlined in the preceding chapter, skipping the intent/action separation and just having the view emit actions:
The view consists of our three fragments, as they each operate off of the same state: the roster of to-do items.
The model is made up of two parts:
- The to-do items themselves, stored in a Room-managed database, fronted by a repository, and converted into model objects used as part of our view state
- The filter mode, which we want to persist across runs of the app, stored in a
SharedPreferencesfronted by another repository
We also have actions, a controller, results, and a reducer as well, to mirror the MVI structure. Though, as you will see, the reducer is named something other than Reducer.
Prev Table of Contents Next
This book is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license.