Open jjvargas opened 9 years ago
check issue #6 to know how to access the Activity's methods from a presenter/view
I have read this but I am able to make it work, it would be nice if someone can integrate an example on the sample app. Cheers.
I'll write an example when 0.2 is out.
But in practice, in my own experience, you don't need to call setSupportActionBar(toolbar)
from a view. The toolbar contains all the methods to setup a title, a menu, etc on itself without the need of the container activity.
So I have the main toolbar from the activity but some of my views have a custom Toolbar , so I hide the main toolbar and show the custom toolbar, but the main toolbar has items that need to be in the custom toolbar thats why I need to setSupportActionBar(customToolbar).
What I am doing right now is just to have an event that is received in the MainActivity and switches accordingly.
I can't seem to find how to get a reference from the Main Activity from a View, something like getActivity(). I would like to execute setSupportActionBar(toolbar) from the view.