0

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?

  • 1
    Your model is too fragmented. If this is one screen, then all you need is one ViewModel object. – Robert Harvey Mar 13 '18 at 1:54

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.