I need to sort the list using Comparator
which depends on Resources
. The list (data) is loaded from the repository (Model layer). How can I do this if a
Presenter should not have access to Context
? Should I inject already created Comparator
?
new ProductsPresenter(new ProductsRepository(), productsFragment, new ProductsComparator(context))
(prodcutsFragment is a View layer)
- Is it correct?
- What if the Presenter needs to use more
Context
depended classes? If I inject all of them, the constructor will have a lot of parameters.
Here is the code from Android blueprints where for example I'd like to add sorting the list with Comparator
depended on Resources.