In the picture what I want to do.
I have two menu.xml files. How to add the first menu at top app bar and the second at the bottom app bar? Can I do this in one activity or I should create activity with top app bar + fragment with a bottom app bar? Thanks.
So, I solved this problem.
For toolbar on top of the activity I use
setSupportActionBar() inflate menu in
onCreateOptionsMenu() and processing
MenuItem click in
For BottomAppBar (new material component) I use bottomAppBar.replaceMenu() in order to set the menu. For processing
How to add the first menu at top app bar and the second at bottom app
bar? Can I do this in one acivity or I should create
app bar + fragment with bottom ap bar?
You’ll probably be able to do that with
onCreateOptionsMenu() for the top of the
Toolbar) then use a
NavigationDrawer and another
View (Can be a custom view like
ImageViews or etc) or another
Toolbar in the bottom.
Or, using custom view and inflating
This might help for two
Toolbars in one
In your case (as we can see in the picture), i believe there is a
Toolbar at top of
CoordinatorLayout which has
FloatingActionButton in the middle and there will be just inflating in java-kotlin side left.