0

I need your help. How I can correctly access to "setDecorFitsSystemWindows" and "layoutInDisplayCutoutMode"?

FLAG_KEEP_SCREEN_ON is working, so I assume flags are not my issue. I think subclasses access is the problem.

from kivy.utils import platform
if platform == 'android':
   from jnius import autoclass
   from android.runnable import run_on_ui_thread
   from android import mActivity as mA

   @run_on_ui_thread
   def decors():
      LayoutParams = autoclass('android.view.WindowManager$LayoutParams')
      window = mA.getWindow()
      params = window.getAttributes()
      params.setDecorFitsSystemWindows = False
      params.layoutInDisplayCutoutMode = LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS
      window.setAttributes(params)
      window.setFlags(LayoutParams.FLAG_LAYOUT_IN_SCREEN, LayoutParams.FLAG_LAYOUT_IN_SCREEN)
      window.addFlags(LayoutParams.FLAG_KEEP_SCREEN_ON)

I have a Galaxy S22 Ultra so I have a DisplayCutout because the front camera (I think).

My target is a layout like i.e. whatsapp, with a trasparent status bar filled with the app color in background. But status bar must not remain active during i.e. when i call a popup in the app, because the app screen in background becomes grey as a inactive screen but status and nav bars instead remains lighed as a active screen and this is not a good.

Also I have to understand what I have to set in buildozer.spec. I'm using "fullscreen = 0" because if enabled the status bar disappear.

Please help.

CikoXp
  • 11
  • 4

0 Answers0