I'm building an Android application using MVP. One of the screen displays data in a sort of Master/Detail view (a content page embedding a player):
At the top, there is the player (fragment) and below is the content info (viewpager with fragments), and user can swipe between pages (ViewPager) to switch between contents. When the Viewpager position changes, the player is updated accordingly and starts playing the current content.
Data requested by the presenter comes from a repository, with local(database)/remote(Rest API) datasources.
How can I make the best use of MVP to avoid requesting the same data multiple times?
Should I have only one Presenter in my Activity, and persist/cache data requested for the Content Info Info somewhere, to pass it back to the player when the position is changed?
Or is it better to have a presenter for each ContentInfo, requesting its own data, and a presenter for the player, requesting the same data again when the play() method is called?
I found this related topic, but it doesn't really fit to my case, as the data is not updated in the player at the same time that it is requested in the Content Info fragment (I'm fetching the data onCreate of the fragment by the ViewPager to have it already loaded when the swipe is done).