Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27120] Android: Splash screen flickers on start when setting global Ti.UI.backgroundColor

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 8.1.0, Release 8.2.0, Release 8.3.0
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, backgroundcolor, engSchedule
ReporterHans Knöchel
AssigneeJoshua Quick
Created2019-06-01T03:01:32.000+0000
Updated2019-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

Comments

  1. Joshua Quick 2019-06-04

    [~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 set false (this is the correct behavior). Once that white child window closes, your app then opens the main TabGroup 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?
  2. Hans Knöchel 2019-08-19

    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 a Ti.UI.backgroundColor = 'xxxxx' causing the issues. No idea where that regression came from, but removing it fixes all flickering.
  3. Joshua Quick 2019-08-19

    Thanks for narrowing it down [~hknoechel]. Setting the Ti.UI.backgrounColor property (or Ti.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 Java overridePendingTransition() method, but that only works when called immediately after startActivity(). I don't really have a solution for this particular issue at the moment... other than to avoid it entirely and don't set the Ti.UI.backgroundColor property.

JSON Source