An Activity
containing NavigationDrawer is supposed to juggle its fragments. My problem is that the drawer has to be available on all possible screens of the application, which makes my only activity MainActivity very cluttered with fragment-callback code and different sorts of navigation/business logic.
As the application grows it becomes harder to navigate through the activity and I've started to think about possible alternative approaches. New approach must maintain the same visual behavior of the original and remove the clutter.
Apart from navigation drawer events, there're multiple fragments that also contain navigation/business logic, which is also to be handled by the MainActivity. For instance, a fragment might contain 3 or more buttons that would launch other fragments or perform some cross-concern business logic.
So .. the resulting amount of listener interfaces implemented by MainActivity grows and as of this moment amounts to 20. You might imagine it doesn't look or feel any good.
I think I might decouple things to multiple NavigationDrawer activities to ease the maintenance. It suggests larger resource consumption and slight visual effects deviation, since new activities will be launched only after the drawer is closed contrary to the original approach which changes fragments instantly.
Do you think that it's a bad idea? How can it be improved? Or there's a better solution?
Thanks.
UPD refined the description.