2

My app has an option to go into fullscreen mode. Users of device Samsung Galaxy S7 Edge report to me that the navigation soft buttons are displayed in this case and do never vanish when the app is in fullscreen.

Here is the code I am using:

getWindow().addFlags(
                    WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
                    | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
                            | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON
            );
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);

mainFrame.setSystemUiVisibility(
                        View.SYSTEM_UI_FLAG_LOW_PROFILE |
                        View.SYSTEM_UI_FLAG_FULLSCREEN |
                        View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
                        View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |
                        View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
                        View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
        );

I have already played around with some of the options but it is hard because I do not own a Samsung device. Can someone with this device tell me the correct settings so navigation soft keys are not displayed in fullscreen mode?

Pavel_K
  • 10,748
  • 13
  • 73
  • 186
Alex
  • 343
  • 2
  • 13

1 Answers1

1

i found something that might be helpfull. It's from Google's Developers site and I think it does exactly what you are looking for. I hope it will be some kind of help.

I think this part in the beginning is what you need but I also provide you a link below for more information:

Android 4.4 (API Level 19) introduces a new SYSTEM_UI_FLAG_IMMERSIVE flag for setSystemUiVisibility() that lets your app go truly "full screen." This flag, when combined with the SYSTEM_UI_FLAG_HIDE_NAVIGATION and SYSTEM_UI_FLAG_FULLSCREEN flags, hides the navigation and status bars and lets your app capture all touch events on the screen.

https://developer.android.com/training/system-ui/immersive.html

EDIT

i found an answer to a similar question with yours and the suggested approach is the following. try adding this to your code. it will do the trick.

int UI_OPTIONS = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | 
   View.SYSTEM_UI_FLAG_FULLSCREEN | 
   View.SYSTEM_UI_FLAG_LAYOUT_STABLE | 
   View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | 
   View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;

getWindow().getDecorView().setSystemUiVisibility(UI_OPTIONS);

Here is the link to the original: https://stackoverflow.com/a/31483291/8434076

Apostolis I.
  • 112
  • 6
  • as I understand the docs the difference is that SYSTEM_UI_FLAG_IMMERSIVE_STICKY is hiding the buttons again after some seconds without interaction. So there should be no difference in the beginning. https://developer.android.com/training/system-ui/immersive.html . Maybe someone can check this? – Alex Aug 09 '17 at 15:18
  • I asked a user to test this and it did not work. Also it does not differ that much from my code. I think its Samsung specific so hopefully someone with this device can help. – Alex Aug 10 '17 at 19:09
  • what exactly happens when the app is being used in this Samsung phone? – Apostolis I. Aug 11 '17 at 09:25
  • The app is a wakeup alarm clock with a night clock. If you tap on the moon icon it goes into fullscreen and then Samsung displays the soft buttons at the bottom. They are disturbing the almost black screen. https://play.google.com/store/apps/details?id=com.changemystyle.gentlewakeup – Alex Aug 12 '17 at 11:31
  • oh i got it. well since even android developer's has the above as a solution I guess you are right and it might be a samsung specific problem. wish I could have helped more. good luck finding the solution! – Apostolis I. Aug 12 '17 at 11:42