Jump to content
Sign in to follow this  
TTSander

Enable immersive mode on Android 11

Recommended Posts

I'm trying to run an application in immersive mode, but I'm unsure how to implement this. The use case is an application running on a Raspberry Pi-based scan device. Our previous models, which used an RPi3B, ran on an Android 7-based version of Emteria OS. Android 7 allowed a system wide setting of the immersive mode, but we lost this option now we run an Android 11-based version of Emteria on the RPi4.
I found that immersive mode now has to be configured at the application level (https://developer.android.com/develop/ui/views/layout/immersive), but I'm struggling to implement this in Delphi. I searched ..\Studio\21.0\source, but I can't find any mention of a JWindowInsetsControllerCompat.
I should mention we're still on Delphi 10.4.2. Is this issue resolved by upgrading to 11.2, or is there another way to implement the solution provided at the link above?

Share this post


Link to post

WindowInsetsControllerCompat is part of AndroidX:

 

https://developer.android.com/reference/androidx/core/view/WindowInsetsControllerCompat

 

Being able to use AndroidX with Delphi 10.4.2 would be an immense task - I started down that road, and ended up abandoning the idea. Delphi 11 supports AndroidX, however you would still need to import (e.g. using Java2OP) the WindowInsetsControllerCompat class as it is not in the Android RTL units in Delphi 11. Given the example you linked to, you'd also need to import ViewCompat, and perhaps other classes as well.

 

Share this post


Link to post

Thanks for the quick reply! I'll see if I can find the time to upgrade our development environment then. I'm familiar with Winsoft JavaImport, so I'm confident I'll be able to import the necessary classes.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×