Step #2: Defining a FilterMode
From the standpoint of the UI, we have three possible filter conditions:
- We want to show the completed to-do items
- We want to show the outstanding to-do items (i.e., the ones not yet completed)
- We want to show all items, regardless of completion status
That is beyond a simple Boolean
value, but we can model that via an enum class
.
In the ToDoRepository.kt
source file, add this enum class
before the ToDoRepository
definition:
enum class FilterMode { ALL, OUTSTANDING, COMPLETED }
Prev Table of Contents Next
This book is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license.