title: Single Activity with Navigation Component: how to handle different AppBar / Themes
body: <p>I've been using the new <a href="https://developer.android.com/topic/libraries/architecture/navigation/" rel="noreferrer">Navigation Component</a> since shortly after it has been announced at Google I/O, and also started to embrace the single-activity as much as possible.</p>
  
  <p><strong>The Single Activity allowed me to share ViewModels between view for an awesome experience and I really don't want to go back to multi-activity if I'm not forced to.</strong></p>
  
  <p>But there's something that gets in the way: AppBar / Themes (status bar) to the single activity concept.</p>
  
  <p>This is part of the design I'm working in:</p>
  
  <p><a href="https://i.stack.imgur.com/3ptJh.png" rel="noreferrer"><img src="https://i.stack.imgur.com/3ptJh.png" alt="AppBar design in different sections"></a></p>
  
  <p>As you can see there are different requirments for how the Actionbar / status bar should look.</p>
  
  <ol>
  <li>It's a simple drawer with standard actionbar</li>
  <li>Classic detail with image going under the translucent status bar, supposed to use <code>CollapsingToolbarLayout</code> to turn into a standard actionbar when scrolling up</li>
  <li>In this case it is non-standard actionbar, I'd call it a "floating toolbar" cause it doesn't expand to the full with of the screen and contains an already expanded SearchView / EditText</li>
  <li>Fairly standard AppBar with tabs</li>
  </ol>
  
  <p>List of issues that arise from leaving the single activity:</p>
  
  <ul>
  <li>can't share <code>ViewModel</code>s between activities</li>
  <li>complex navigations which re-use parts already defined in another activity navigation graph have to be duplicated / moved into a dedicated activity</li>
  <li>back navigation "re-construction" doesn't work between activities</li>
  </ul>
  
  <p>Those are issues I want to avoid if possible, but how do you guys manage these kind of situation on a single-activity with navigation component. Any idea?</p>