Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple containers for navigation component

Is it possible to share navigation graph between two (or more) containers? What I would like to achieve is to have two containers (NavHosts):

  • one smaller that is above bottom navigation and below toolbar
  • second is full screen.

I would like to have one navigation graph, because fragments from one container can trigger actions from other one. Otherwise it (having more navigation graphs that interacts with each other) will become untidy and problems created by library will surpass advantages.

like image 445
Wiktor Wardzichowski Avatar asked Jun 23 '18 20:06

Wiktor Wardzichowski


1 Answers

Seems like you cannot, however you can have nested navigation: i.e. wrap your toolbar navigation inside of fullscreen (of vice versa) and playing with navController.popBackStack(<id of nested item>)

like image 164
Dmitry Valetin Avatar answered Sep 28 '22 11:09

Dmitry Valetin