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:

Model

and a screen like this:

Screen

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



implementing repository using MVVM in android

Updated May 15, 2018 11:05 AM