title: how to use Navigation component navhostfragment while altering full screen/above bottom Navigation
body: <p>I'm using the single activity multi fragments with navigation component.how do i hide the bottom navigation bar for some of the fragments?</p>
  
  <p>i tried the following:</p>
  
  <ol>
  <li>controlling the visibility of the bottomnavigation bar through databinding.(buggy)   </li>
  <li>toggling the bottomnavigation visibility before opening the fragment and on the backstack ( buggy)   </li>
  <li>making 2 host fragments: 1 full screen, 1 bound by the bottomnavigation </li>
  <li>making 2 navgraphs ..</li>
  </ol>
  
  <p></p>
  
  <p>activity_main.xml:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;com.google.android.material.bottomnavigation.BottomNavigationView
              android:id="@+id/bottomNavigation"
              android:visibility="@{viewModel.uiUtils.shouldShow ? View.VISIBLE:View.GONE}"/&gt;
  </code></pre>
  
  <p>mainactivity.java:</p>
  
  <pre class="lang-java prettyprint-override"><code>    private void observeShouldShow() {
          mainViewModel.uiUtils.getShouldShow().observe(this, new Observer&lt;Boolean&gt;() {
              @Override
              public void onChanged(Boolean aBoolean) {
                  ViewGroup.LayoutParams layoutParams = binding.bottomNavigation.getLayoutParams();
                  if (mainViewModel.getUiUtils().getShouldShow().getValue()) {
                      binding.bottomNavigation.setVisibility(View.VISIBLE);
  
                      layoutParams.height = 170;
                      binding.bottomNavigation.setLayoutParams(layoutParams);
                  } else {
                      layoutParams.height = 0;
                      binding.bottomNavigation.setLayoutParams(layoutParams);
  
                   binding.bottomNavigation.setVisibility(View.INVISIBLE);
                  }
              }
          });
  </code></pre>
  
  <p>the bottomnavbar blinks when switching between full screen fragments and normal fragments</p>