Navigation Component FragmentContainerView does not play well with fitsSystemWindows=true

508 Views Asked by At

I've been working on updating my best practices showcase app with the latest Android Architecture Components, and ran into this issue.

I'm using the Navigation Component and fragments to create my screens. As I prefer to manage my window insets manually (and Chris Banes' Insetter is an amazingly straightforward solution which I recommend wholeheartedly!), all my layout roots have appropriate fitsSystemWindows flags set.

The issue appears on the third fragment in the initially linear navigation, UserHomeFragment. It is not that different from other layouts, although it is the first more complex one. And this is the only fragment so far where this happens.

Upon navigating to this fragment, containers all the way up to the main content view suddenly lose their inset awareness, and get the default insets applied - against my wishes, as I specifically ASK for the inset not to be applied. I do not see why a simple fragment transaction happening this way would suddenly affect views all the way up to the root view.

0

There are 0 best solutions below