Let's jump directly to the topic! Here's the thing: I've got an android app using mvp pattern. There's an activity containing two fragments which are tabs and both of them are lists. Both fragments share the same Database Interactor and a ViewHolder. Both lists display the same content with the only difference that first one contains all items and the second is filtered. Filtering is done in Database Interactor so fragments presenter query Database Interactor for filtered or not filtered list of items.
In the Activity, on ActionBar there's a menu that I want to use for sorting both lists. Acitivity does nothing, it is just a container for fragments and action bar.
I'm really confused. How can i tell both fragments to sort their items? And how should it look like? I guess that putting all the code in fragments' presenters is not a good idea.
Another thing is that lists contains objects with multiple attribute, like: MyObject(Date, Distance, Name) and depending on choosen option i want to sort by Date OR Distance OR ... etc.
Thanks in advance!