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

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

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 interact browser from android application?

Updated June 27, 2015 15:02 PM

MVVM: Strictness of Views Referencing Models

Updated July 15, 2015 17:02 PM