Warning on Android App : You cannot use a translucent status bar or navigation bar unless you set the window's 'extendSafeArea' property to true

I got this warning :

You cannot use a translucent status bar or navigation bar unless you set the window's 'extendSafeArea' property to true

Everything works well but I cant find where this come from. I use :

<Window id="win" class="container" exitOnClose="true">
		<ActionBar id="actionbar" />

and

'Window': 
{
	backgroundColor: "#665a59",
	fullscreen: true,
	orientationModes: [Ti.UI.PORTRAIT],
	backgroundImage: "/images/windowBackground.jpg",
	backgroundSize: "cover"
}

I found in SDK source code this :

// Remove translucent StatusBar/NavigationBar flags if window is not set up to extend beneath them.
		// Not doing so will cause window to stretch beneath them anyways, but will fail to render there.
		if (this.layout.getFitsSystemWindows() && !(this instanceof TiLaunchActivity)) {
			int mask = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
			mask |= WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION;
			if ((getWindow().getAttributes().flags & mask) != 0) {
				String message = "You cannot use a translucent status bar or navigation bar unless you "
								 + "set the window's '" + TiC.PROPERTY_EXTEND_SAFE_AREA + "' property to true.";
				Log.w(TAG, message);
				getWindow().clearFlags(mask);
			}
		}

But I dont find the solution to remove the warning.

NB: Setting TiC.PROPERTY_EXTEND_SAFE_AREA is not a solution as my windows goes under the title.

do you use a custom theme?

I ont know anything about theme, but I think no

tiapp.xml

<?xml version="1.0" encoding="UTF-8"?>
<ti:app 
  xmlns:ti="http://ti.appcelerator.org">
  <id>fr.dzzd.tigldemo</id>
  <name>TIGL Demos</name>
  <version>1.0</version>
  <publisher>dzzd</publisher>
  <url/>
  <description/>
  <copyright>2022 by dzzd</copyright>
  <icon>appicon.png</icon>
  <fullscreen>false</fullscreen>
  <navbar-hidden>false</navbar-hidden>
  <analytics>false</analytics>
  <guid>d9bd5f43-724e-4993-9aaa-b3b2cf131b80</guid>
  <property name="ti.ui.defaultunit" type="string">dp</property>
  <property name="run-on-main-thread" type="bool">true</property>
  <ios>
    <enable-launch-screen-storyboard>true</enable-launch-screen-storyboard>
    <use-app-thinning>true</use-app-thinning>
    <plist>
      <dict>
        <key>UISupportedInterfaceOrientations~iphone</key>
        <array>
          <string>UIInterfaceOrientationPortrait</string>
        </array>
        <key>UISupportedInterfaceOrientations~ipad</key>
        <array>
          <string>UIInterfaceOrientationPortrait</string>
          <string>UIInterfaceOrientationPortraitUpsideDown</string>
          <string>UIInterfaceOrientationLandscapeLeft</string>
          <string>UIInterfaceOrientationLandscapeRight</string>
        </array>
        <key>UIRequiresPersistentWiFi</key>
        <false/>
        <key>UIPrerenderedIcon</key>
        <false/>
        <key>UIStatusBarHidden</key>
        <false/>
        <key>UIStatusBarStyle</key>
        <string>UIStatusBarStyleDefault</string>
      </dict>
    </plist>
  </ios>
  <android 
    xmlns:android="http://schemas.android.com/apk/res/android">
    <manifest android:versionCode="1" 
              xmlns:android="http://schemas.android.com/apk/res/android">
      <application android:debuggable="true" />
      <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="30"/>
    </manifest>
  </android>
  <modules>
    <module platform="android">fr.dzzd.tigl</module>
  </modules>
  <deployment-targets>
    <target device="windows">false</target>
    <target device="iphone">false</target>
    <target device="ipad">false</target>
    <target device="android">true</target>
  </deployment-targets>
  <sdk-version>10.1.1.GA</sdk-version>
  <plugins>
    <plugin version="1.0">ti.alloy</plugin>
  </plugins>
  <property name="ti.android.compilejs">true</property>
  <property name="appc-app-id" type="string">5fcd095ce86a692c0ede6280</property>
</ti:app>
  backgroundImage: "/images/windowBackground.jpg",
  backgroundSize: "cover"

that doesn’t work like this :wink: It’s not CSS. But the ImageView supports scalingMode: Ti.Media.IMAGE_SCALING_ASPECT_FILL. So add that in the background, set the image and it will be covered.

I do get that warning too but it still works.
Screenshot_20220502-182041
I think it just informs you because it is not fullscreen since there is still the Actionbar.

you mean “cover” is wrong ?

EDIT: ho I see yes it does not exist :slight_smile: luckily has it was a big image and not really important I did never notice it was not working.

Thanks for the tips

I think I have to remove the FLAG_TRANSLUCENT_NAVIGATION (& FLAG_TRANSLUCENT_STATUS) flags from the windows, but I dont know really how in Alloy, I think I can find how to in JS put I would prefer to do it in Alloy. I mean the attribute fullscreen puts those flags (this is what I read), but how then to remove them ?

check the example at
https://titaniumsdk.com/api/titanium/ui/window.html#safeareapadding

 windowFlags: Ti.UI.Android.FLAG_TRANSLUCENT_NAVIGATION | Ti.UI.Android.FLAG_TRANSLUCENT_STATUS

you should be able to use that in a TSS file too.

here is the property: Titanium.UI.Window | Titanium SDK
Setting fullscreen to true automatically sets the WindowManager.LayoutParams.FLAG_FULLSCREEN flag.

What UI are you going for?

also check the following lines here: titanium_mobile/TiBaseActivity.java at 0205aa7ba321d8fe27cc5b0dcbfcdd759714a0f4 · tidev/titanium_mobile · GitHub
there are some infos about the flags and notch issues

What UI are you going for?

Nothing special, I am just in a learning process, I try to remove every warning from TIGLDemo and learn in the same time.

Then I will start a game, I dont know yet wich one, but it will be very simple, the goal is to take pleasure in programming a small and easy project, if you have any ideas or want to help as a hobby let me know.

this should do the job, I will try

not a big gamer. Think I don’t have any game on my phone besides my wordle clone :rofl:
But I’ll guess card deck building games, endless runner or some tower defense would find some players.
If you’ll add some 2D pointlights/shadows and mutliplayer you can do something in this direction :slight_smile:
ngnsw

And if its a 2d platformer like Mario or somthing like Zelda I’ll play it :wink:

I rarely play game now and I never played like a true gamer, when I was younger I played a bit more but I always more liked to make them than play them, I made my first little game very young, I think in 1989 on an Amstrad CPC 464 :slight_smile:

And usually I never finish them :slight_smile: and begin another…

I would say that programming a game or an application is for me as playing a game, so in some way I am a player