Closed lonja closed 7 years ago
@lonja I can't understand your comment, Could you more explicit please? but if you are looking the View Model for adapter you can see this https://github.com/erikcaffrey/People-MVVM/blob/master/app/src/main/java/com/example/jhordan/people_mvvm/viewmodel/ItemPeopleViewModel.java
Hi, I think @lonja mean that you pass view contract to viewmodel and now it look more like presenter than viewmodel.
And i also want to resolve this issue (communicating with activity from viewmodel) but not know how. Maibe @lonja know?
I'm not impressed by class PeopleActivity extends AppCompatActivity implements PeopleViewModelContract.MainView
because PeopleViewModelContract.MainView
feels more like MVP.
For MVVM I anticipated an observer to make the adapter watch the list of data
@abiemann It was my first iteration I'm according with you communication isn't Model ViewModel but neither MVP, it's a Presentation Model pulls the state and behavior of the view out into a model class that is part of the presentation. The Presentation Model coordinates with the domain layer and provides an interface to the view that minimizes decision making in the view. I created a new implementation more like MVVM Solution -> https://github.com/erikcaffrey/People-MVVM/pull/7 although for me the best solution is to use a DataBinding Engine. Thanks for your feedback!
maybe
PeopleViewModel
should has reference toPeopleAdapter
insteadView
?