corona
corona copied to clipboard
A glitchy grey background on Launch and Resume, on Android 11
The glitch looks like a rectangle filled with grey (a gradient colour). I think it could be some kind of default background for Solar2D apps.
It appears for a very short time on Launch and Resume.
Or it remains visible for the whole session if you don't handle the resizing after the status bar is hidden.
To reproduce: build anything and run it on Android 11.
We can't be sure it affects Android 11 only and if this is valid for all Android 11 devices, but we tested on different models.
In addition,
if I set the background to white, it behaves like a mask over my phone background.
(hiding all other apps icons)
This turns from transparent to white like a transition on alpha. And it happens very fast. I noticed it only recording and slowing it down.
Maybe this has something to do with my OS apps launcher someway.
An update that may give you some clue: if the main.lua performs heavy operations, you have more chance to see that grey area. If the main.lua is neat and postpone the loading of the game, then there are chances you won't notice it.
Just to point this out, this isn't just an Android 11 issue. I'm experiencing this on my Android 8.x and 9.x test devices as well. If I had to guess, I'd wager this issue is caused by a simple setBackgroundColor
in some .java file. A quick search returns some possible options:
https://github.com/coronalabs/corona/search?q=Color.DKGRAY https://github.com/coronalabs/corona/search?q=Color.GRAY
This issue appears when the app launches or resumes. On launch, even if you have a default project with an empty main.lua, you'll see this for a moment. If you have a main.lua with a lot of code in it, you'll see the dark grey background significantly longer.
Based on this, it's probably safe to assume that the dark grey background color gets overwritten by Solar2D's default background color once the app gets to the next draw cycle. Or, in other words, if the app needs to process a lot of code in main.lua, that may lock the thread for tens or hundreds of milliseconds, which will delay the next draw cycle enough to make the dark grey background clearly visible to the user.