Refactor presentation MVP presenters and views
@tmingos Thanks for your feedback about my refactoring! I really appreciate it. About your question: Thanks for pointing this. Yes, sure, it should be
public abstract class BaseFragment<PRESENTER extends Presenter<VIEW>, VIEW extends View> extends Fragment {
I have updated my pull request with your suggestion. BTW: now I doubt a bit if BaseFragment (as an implementation if a View) should have a reference to Presenter at all. So how I would change it? I would divide View into 2 interfaces: ViewInput and ViewOutput. BaseFragment would implement ViewInput and has a reference to ViewOutput (instead of a reference to Presenter). And Presenter would implement ViewOutput (by other words, View will delegate all actions to Presenter, e.g: onViewCreated, onButtonClicked etc).
Very cool refactoring, using MVP in this way makes more sens.
What I don't really like about MVP in android is that the presenter holds a reference to the view and views in android have a lifecycle, I had separated this via a contract, very similar to the implementation discussed in this article https://medium.com/@manuelvicnt/rxjava2-android-mvvm-lifecycle-app-structure-with-retrofit-2-cf903849f49e#.kx4cntcyi