Recommended Archictecture in Android for communication between main View and RecyclerViewAdapter with MVVM

by Viper Alpha   Last Updated March 13, 2018 01:05 AM - source

I'm trying to architect a screen with a fragment containing a date picker and some basic inputs and a list of items which more inputs. I'll try to exemplify with images:


and a screen like this:


Input Field 1 and 2 is in ViewModel. The input field N is in the List and it is in ViewModelItem. And I have some calculations for each item of the list based on the general data. I don't know if knowing the implementation of the adapter will help anyone, but here is the link.

Finally, my question is: What is the best way to make this communication between these viewmodels? I Can't separate them in other screens (my client does want this)

The only thing I can think of is making a "global object" and I would hate to do that. I don't know what else, maybe I'm not applying MVVM correctly?

Tags : android mvvm

Related Questions

How to reduce a big ViewModel into small classes

Updated April 11, 2019 18:05 PM

implementing repository using MVVM in android

Updated May 15, 2018 11:05 AM