I'm building an Android app following the MVVM architecture. Where do adapters (for recyclerView, viewPager, etc) belong to?
Do adapters belong to View or ViewModel?
I'm building an Android app following the MVVM architecture. Where do adapters (for recyclerView, viewPager, etc) belong to?
Do adapters belong to View or ViewModel?
If you're following MVVM architecture than , adapters are belongs to View not Viewmodel. All sub list item click events and other UI related things handled by adapter . So Adapter goes to View ..
if you want detail description , You can check this link to
Think on this direction.. Suppose you remove/replace your view from your code. View model should be able to reused again and can provide view data to new view. You can get answer yourself. Then adapter should be part of view only.