I have a main fragment with a map, and below the map is a viewpager2 with several tabs/fragments. The tabs show different information depending on user location.
I see 2 possible designs:
- One single shared viewmodel with all the data-logic. It's gonna be somewhat big and somewhat messy, because the only shared data among the fragments is the name of the location.
- A shared viewmodel parent with the name of the location, and then one viewmodel pr fragment that reads the location from the shared viewmodel parent and then handles the data-logic of the individual fragment.
Or is there a better way to do it?
Thanks