Don't break immersive/full-screen mode
fat-tire opened this issue · 1 comments
First off-- this is super cool. Thanks.
Here's the issue: Looks like whenever a snackbar comes up, immersive mode is turned off momentarily. This occurs whether or not I'm displaying to the activity or directly to a viewgroup and it's kind of ruining the full screen experience because every time there's a snackbar display, the whole screen has to re laid out and menus and buttons start appearing.
Any thoughts?
Edit: I see a sample which seems to work. So what could be triggering this... Hmm. If anyone has any suggestions, let me know.
Update #2: This does not work for me (from a fragment):
mDecorView = getActivity().getWindow().getDecorView();
mDecorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_LOW_PROFILE
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
);
When the soft keyboard is out, the notification works great (as it's not in fullscreen mode) but when you drop the keyboard and start a new snackbar notification-- it needlessly pulls in the menu bar and soft buttons, etc. Any advice would be great... the snackbar is being started with:
SnackbarManager.show(
Snackbar.with(getActivity())
though I've tried variations of using a viewgroup and other things and it doesn't seem to work.
After a lot of looking around, I realized the problem was a dialog that was opened simultaneously (and then closed quickly so it never made it on screen). That was enough to trigger the end of immersive mode. So it wasn't snackbar after all :) Closing and thanks again!