Main activity has a CoordinatorLayout
in which there is an AppBar
and a FrameLayout
for fragments, a NavigationView
and a FloatingActionButton
.
We have more than 50 fragments. More than 40 fragments use the same simple toolbar/actionbar/appbar (truly annoying architecture, design, and naming by Google guys, and we still can't really differentiate them). They only need a back button, a simple title, and the icon for opening/closing navigation menu. The rest of the fragments have their own icons and might be taller.
We saw some questions, including this question:
Coordinator Layout with Toolbar in Fragments or Activity
Based on it, we decided to use a FrameLayout
inside our main AppBarLayout
and just like fragments, use FragmentManager
to replace it for custom AppBarLayouts
. Are we safe following this decision? We can't come to another solution for not repeating common toolbars across fragments.