I'm trying to follow the MVVM pattern in a new App I'm currently writing.
Basically it gets a list of items in JSON from my REST-Backend and displays it in a RecycleView inside my fragment.
I created a repository, which fetches the data and hands it over to the ViewModel which has LiveData which is observed by the fragment.
That all works fine.
But: Every item also has a url for an icon. When the list is fetched, for every item I want to load the icon from this url into a ImageView.
Actually I am using Glide to directly (asynchronously) load the icon into the corresponding ImageView - which is good for UX and performance (in my opinion), since the user already sees data while the icons load in the background
My question:
Does using Glide directly in the fragment break the MVVM pattern?
What's an alternative approach to that?
E.g. loading the icons in the Repository, updating the RecycleView every time a icon is fetched (bad performance)?