I am writing an application that has one activity and a bunch of fragments, and one of these fragments is full-screen. For this I am trying to use the Visibility System UI Visibility flags.
For the full-screen fragment, I set the visibility:
layout.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
As soon as I do this, the window inserts change to values that seem to make no sense. Then, when I exit this full-screen fragment, I end up with a wrong fill in my view (based on weird attachments)

Does anyone know what is going on here? The way I understand window inserts should be erroneous because this behavior seems completely counter intuitive. Any insight would be appreciated.
, , , :
https://github.com/dapp/visibilitytest