I refined the Activity Drawer project template for Android Studio, which uses the Toolbar , v7.app.ActionBarDrawerToggle and NavigationView instead of the NavigationDrawerFragment (and layout / fragment_navigation_drawer.xml) file.

It works great. Then I move on. I have a Navigation Box project in dive-sticky mode (full screen mode).
@Override public void onWindowFocusChanged(boolean hasFocus) { super.onWindowFocusChanged(hasFocus); if (hasFocus) { View decorationView = getWindow().getDecorView(); decorationView.setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); } } @Override protected void onCreate(Bundle savedInstanceState) { ... toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar actionBar = getSupportActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); drawerToggle = new ActionBarDrawerToggle( this, drawerLayout, R.string.navigation_drawer_open, R.string.navigation_drawer_close ) { @Override public void onDrawerClosed(View drawerView) { super.onDrawerClosed(drawerView); invalidateOptionsMenu();
There is a problem. The bars of the shadow overlay on the NavigationView that are displayed from the status bar (on the top side) and the navigation bar (on the bottom side) remain motionless.


How can I get rid of them?
I reviewed the sources of v7.app.ActionBarDrawerToggle or Android NavigationView, but in vain.
Updated:
Thanks for the @lcw_gg advice, I completely got rid of the state shadow (as long as the shadows on the navigation bar remain). That is, set the android:windowFullscreen true attribute to the xml layout.
But I want to do this in Java code. I found a method and probably it is equivalent to the xml method:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
And at the same time, you no longer need to set these two flags - View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN and View.SYSTEM_UI_FLAG_FULLSCREEN - on decorationView .

However, I cannot find a way to get rid of the shadow of the navigation bar. I am waiting for a decision.
android android-fullscreen navigation-drawer android-navigation-drawer android-navigationview
hata
source share