Android: full-screen visibility spins window inserts

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)

enter image description here

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

+4
2

setSystemUiVisibility() ( ).

, layout.setSystemUiVisibility() onCreateView(), layout . , .

getActivity().getWindow().getDecorView().setSystemUiVisibility() onCreateView(), , .

0

. NavigationView . , NavigationView, .

NavigationView :

  • , setFitsSystemWindows (false) , , NavigationView, .

  • , SuperView NavigationView OnApplyWindowInsetsListener: ScrimInsetsFrameLayout, , , /, ViewCompat.setOnApplyWindowInsetsListener(mNavigationView, null).

    /li >

NavView , , .

0

Source: https://habr.com/ru/post/1621545/


All Articles