I'm currently working on an app. There are three fragments. One is the home page fragment where there's a list of some popular locations of the world listed in a RecyclerView. And the other one is the favourite page fragment where favourited locations are listed in the RecyclerView as well. And the last one is the details page fragment where the information of the selected location is shown.
Favourited locations are stored in the room database. I have an entity class for the database and a model class for locations that are listed on the home page. I can navigate to the details fragment from both the favourites fragment and the home fragment.
Each list item has a fav icon. If the location is added to the favourites, the icon should be filled. So my question here is, where/how do I save/check the state of the icon? in the model class or in the database?
And also, how do I pass the selected location info data from the favourites page to the details page? Like with a bundle? If so, then don't I have to implement Parcelable in the entity class? Is it against the MVVM architecture?