Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: How to force navigation bar to be visible on Samsung Galaxy S8

Is is possible to force an app to always show to navigation bar in an Android app? On Samsung Galaxy S8 it is possible for the user to hide the navbar during "runtime" - which cause some unexpected behaviours in the app (if you are interested; I tried to add a setOnSystemUiVisibilityChangeListener and redraw, invalidate, requestLayout and forceLayout on the view with no luck. Restarting the activity is not applicable as the app is a single-activity-app. I've also looked into WindowInsets with no luck there neither.).

Therefor, I just want to avoid the problem by not allowing the user to remove the navbar. All the resources I can find online is for hiding the navbar. Does anybody how any suggestions on how to make it stay?

like image 414
Dambakk Avatar asked Jul 03 '17 11:07

Dambakk


People also ask

How do I unhide my navigation bar on my Samsung?

The navigation bar is pinned by default. If you want to view files or use apps in full screen, double-tap the Show and hide button to hide the navigation bar. To show the navigation bar again, drag upwards from the bottom of the screen.

How do I permanently enable navigation bar?

Step 1: From Settings, tap Display. Step 2: Scroll down and select Navigation Bar. Step 3: Choose your preferred Navigation Type. You can either allow the Navigation buttons to be permanently displayed on the screen or hide them by selecting Full-Screen Gestures.


1 Answers

I am not much sure about Samsung S8, but I had worked on Samsung S7. I had used lean back mode setSystemUiVisibility() and passed these two flags

1.SYSTEM_UI_FLAG_FULLSCREEN
2.SYSTEM_UI_FLAG_HIDE_NAVIGATION
Also for enabling immersive mode, I had used SYSTEM_UI_FLAG_IMMERSIVE in conjunction.

It was referenced from visibility & immersive.

Correct me if I am wrong or I didn't understand the question.

like image 146
Denny Mathew Avatar answered Sep 22 '22 00:09

Denny Mathew