Questions tagged [android-immersive]

For the android sticky `SYSTEM_UI_FLAG_IMMERSIVE_STICKY` and non-sticky `SYSTEM_UI_FLAG_IMMERSIVE` immersive mode. A mode that allows the developer to manage a full screen state of the app, while allowing the user to swipe and view system and nav bars.

To implement immersion mode with the SYSTEM_UI_FLAG_HIDE_NAVIGATION or `SYSTEM_UI_FLAG_FULLSCREEN must be used.

Non-sticky mode is recommended for apps where users need regular access to app system and nav bars.

With non sticky immersion, when the system and/or nav bars are swiped and made visible, the flags for SYSTEM_UI_FLAG_HIDE_NAVIGATION and SYSTEM_UI_FLAG_FULLSCREEN are cleared. To re-implement the immersion mode there needs to be an OnSystemUiVisibilityChangeListener

Sticky immersion is suitable apps where the user does not need access to system or nav bars for a sustained duration, and they may in fact be an impediment to the app, for example game apps.

In this case the flags are not cleared and the view from full screen is only transient, as immersion is reinstated. There is no need for a OnSystemUiVisibilityChangeListener, as this is not regarded as a change in the view state.

Information is taken from https://developer.android.com/training/system-ui/immersive.html

105 questions
5
votes
1 answer

How do I enable full screen immersive mode for a Native Activity NDK app?

Reading the documentation at https://developer.android.com/training/system-ui/immersive.html I can't seem to find any information on how to set full screen immersive mode in a Native Activity NDK app (without using JNI) as it seems full screen…
5
votes
1 answer

Why navigation bar is appearing in fullscreen apps when clicked on popup menu

I have a fullscreen app: MainActivity.java: public class MainActivity extends AppCompatActivity { @TargetApi(Build.VERSION_CODES.KITKAT) private void removeControlBar(){ View decorView = getWindow().getDecorView(); …
Behy
  • 483
  • 7
  • 23
4
votes
3 answers

How to hide the navigation bar in xamarin android?

This question seems to be asked quite often, but looking through the various answers (non Xamarin) non of them work with Xamarin... In my activity I have tried various forms of doing: public override void OnWindowFocusChanged( bool hasFocus ) { …
sprocket12
  • 5,368
  • 18
  • 64
  • 133
4
votes
0 answers

Force opaque status bar in Android sticky immersive mode

When I use Android's sticky immersive mode, some devices (e.g. Nexus tables) show the status bar as translucent when one temporarily swipes the status and nav bars onto the screen. On some other devices (e.g. a Samsung S5), both at Marshmallow, the…
4
votes
1 answer

How do I correctly implement Immersive Full-Screen Mode in Android?

I have an application where I have a single activity that contains layers of fragments. I wanted to Switch between Immersive mode and Normal mode during some states of the app. Everything was fine until I call Hide System UI as per Android…
4
votes
2 answers

Navigation bar becomes transparent when keyboard opened

Here is how it looks. And here are details. I have activity without background. But it's not an issue. Neither setting background drawable or colour in theme or code fixed an issue. Activity has soft input mode adjustPan|stateAlwaysHidden I also…
3
votes
1 answer

Keep immersive mode all over the app on Android, Xamarin.forms

I want to keep immersive mode all over the app on Android using Xamarin.forms. I have read few blogs and posts. This one works but only until I press an input text box or I scroll over the screen. I want to avoid this. This question debate my…
David Zomada
  • 167
  • 1
  • 5
  • 22
3
votes
0 answers

Full Screen Immersive Mode without layout bounce

How can one toggle between immersive to non-immersive mode without layout being re-calculated and thus experience a bounce effect? Here's the relevant code that I'm using to toggle between the states: override fun onCreate(savedInstanceState:…
idish
  • 3,190
  • 12
  • 53
  • 85
3
votes
2 answers

Android P - Immersive mode when simulating a notch leaves empty space

I have an Android app which uses the immersive sticky mode and it works well on previous versions of Android as well as on Android P, but when turning on the option of simulating a display cutout (notch), the content starts right below the status…
fergaral
  • 2,077
  • 6
  • 17
  • 34
3
votes
0 answers

Adjust resize not working in immersive mode

I need my app to be in immersive mode always(Hide nav bar and status bar). The issue is when I show a dialog, even if I set the setSoftInputMode to SOFT_INPUT_ADJUST_RESIZE / SOFT_INPUT_ADJUSTPAN, the dialog window is not adjusted on softkeyboard.…
png
  • 4,368
  • 7
  • 69
  • 118
3
votes
2 answers

Android: Spinner dropdown in full screen

I'm trying to open drop down spinner in full screen (immersive mode), but the issue is that when the drop down opens up it brings out translucent navigation bar at the bottom. The navigation bars hides when an option is selected, but remains visible…
3
votes
2 answers

Full Screen Immersive Mode in Android

I have set full screen immersive mode for my android app in onResume like this: @Override public void onResume() { super.onResume(); final View decorView = getWindow().getDecorView(); decorView.setSystemUiVisibility( …
Love2Code
  • 179
  • 1
  • 10
2
votes
0 answers

How to best change systemBarsBehavior with Jetpack Compose?

I'm using Compose and I want to have a fullscreen composable while also modifying the swipe behavior of the system bars. I'm using the Google Accompanist SystemUiController to hide and show the system bars which works just fine, but does not allow…
2
votes
1 answer

Android Spinner: How to keep status bar hidden in full screen?

I use this code to to hide the navigation bar: View root = findViewById(android.R.id.content); root.setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN); getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); But when a Spinner is…
A.G.
  • 2,037
  • 4
  • 29
  • 40
2
votes
2 answers

Flutter sticky immersive does not handle status bar properly

This happens for me on Android 12 with flutter 2.5.3 When using SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky); The top status bar is hidden but the space that it was in is completly black and unusable. Here is the code I'm…
jari
  • 163
  • 2
  • 10