futurice / freesound-android

Unofficial Android client for the Freesound Project
Apache License 2.0
85 stars 16 forks source link

Communication between fragment viewmodel and adapter view model #174

Closed reinaldomoreira closed 6 years ago

reinaldomoreira commented 6 years ago

How is it possible to make a communication between these too?

related question

peter-tackage commented 6 years ago

Perhaps you've already solved this. I would imagine that you would need a shared data source/model. It should be scoped to the largest scope of the populating Views (probably the Fragment). This is a fairly standard way to approach data sharing between Views, if I've understood your need correctly. Hope that helps.

reinaldomoreira commented 6 years ago

Thanks for your answer! I solved it by sharing one view model for both of them. :)