[TIMOB-27120] Android: Splash screen flickers on start when setting global Ti.UI.backgroundColor
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 8.1.0, Release 8.2.0, Release 8.3.0 |
Fix Version/s | n/a |
Components | Android |
Labels | android, backgroundcolor, engSchedule |
Reporter | Hans Knöchel |
Assignee | Joshua Quick |
Created | 2019-06-01T03:01:32.000+0000 |
Updated | 2019-09-10T15:42:35.000+0000 |
Description
As discussed today, the splash screen seems to flicker in recent versions of the SDK. See the below comment for details during the investigation
[~hknoechel], What's happening in your app is that a white child window is quickly opening and closing on startup. When that child window closes, it's bringing you back to the splash screen which can happen if you call it's
close()
method while its "exitOnClose" property is setfalse
(this is the correct behavior). Once that white child window closes, your app then opens the mainTabGroup
window. None of my other apps have this behavior. Are you sure you're not quickly opening/closing a window on startup somewhere? Such as your login or intro windows?Sorry for the late reply. No we don't - there is only a TabGroup opening. And even for non-logged-in states (e.g. log in) it flickers. Even if I comment out all logic in our index.js and add a
Ti.UI.createWindow().open()
it flickers. *EDIT*: Oh dear...It was aTi.UI.backgroundColor = 'xxxxx'
causing the issues. No idea where that regression came from, but removing it fixes all flickering.Thanks for narrowing it down [~hknoechel]. Setting the
Ti.UI.backgrounColor
property (orTi.UI.backgroundImage
) will replace the root window's splash screen image. I do know that there is a bug on Google's end where opening a child window while the splash is in mid-transition will restart the existing transition on cold start (see: [TIMOB-27328]). This sounds like a similar issue where replacing the root drawable is triggering an invalidation/request-layout which in turn is restarting the activity transition animation. The problem is how to work-around it. How we worked-around it in [TIMOB-27328] was to call the JavaoverridePendingTransition()
method, but that only works when called immediately afterstartActivity()
. I don't really have a solution for this particular issue at the moment... other than to avoid it entirely and don't set theTi.UI.backgroundColor
property.