Closed TJCC closed 9 years ago
First of all let me say thank you for this code. It works great!
In my app I have the need to set full screen using:
if (Global.prefFullScreen && Build.VERSION.SDK_INT >= 18) { mDecorView.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 // hide nav bar | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); getSupportActionBar().hide(); } else if (Global.prefFullScreen) { mDecorView.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 // hide nav bar | View.SYSTEM_UI_FLAG_FULLSCREEN);// hide status bar getSupportActionBar().hide(); }
Everything works fine but when I exit full screen
mDecorView.setSystemUiVisibility(0); getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); getSupportActionBar().show();
the navigation items have a little gap at the top and do not sit under the action bar as when it starts.
This is what it looks like when the app starts up and everything is OK
and this is what it looks like after the full screen
I cannot figure out where and when or what to change. Can you help me out?
Cheers, Tim
Hello there:
Go to fragment_navigation_drawer.xml and remove:
fragment_navigation_drawer.xml
android:fitsSystemWindows="true"
Hope this helps :)
Awesome! Works great. Thank you.
First of all let me say thank you for this code. It works great!
In my app I have the need to set full screen using:
Everything works fine but when I exit full screen
the navigation items have a little gap at the top and do not sit under the action bar as when it starts.
This is what it looks like when the app starts up and everything is OK
and this is what it looks like after the full screen
I cannot figure out where and when or what to change. Can you help me out?
Cheers, Tim