Reputation: 199
Started new project from navigation drawer activity template. By default, all drawer menu items are at the same navigation level. All fragments display hamburger menu button, that shows drawer.
I need to keep all items in drawer, but place Home as top level item and others as it's children like this:
Tried to overwrite toolbar?.setNavigationOnClickListener { }
in Gallery fragment, but it also affects Home fragment and I didn't find how to restore default behavior.
How can I set Home as navigation parent for others or how to set navigation click listener to only one fragment?
Upvotes: 0
Views: 295
Reputation: 152
For example you have set tag for every fragment to trace when you start new fragment and now check with Home and set click event..
Fragment home = getSupportFragmentManager().findFragmentByTag("home");
Upvotes: -1