[TIMOB-26715] Android: App starts without animation when launched with data intent as of 8.0.0
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2019-03-26T13:42:27.000+0000 |
Affected Version/s | Release 8.0.0 |
Fix Version/s | Release 8.0.1 |
Components | Android |
Labels | activity, android, animation, engSchedule, engTriage, intent, open, resume |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2019-01-11T03:26:13.000+0000 |
Updated | 2019-03-26T13:42:27.000+0000 |
Description
*Summary:*
As of Titanium 8.0.0, launching/resuming the app using a data intent such as a URL scheme, notification, etc. will cause the app to be opened without any slide-in or fade-in animation. The app will suddenly appear instead.
The app will animate normally when launched from the app list screen (ie: the main launcher intent) or via the
startActivityForResult()
method.
*Cause:*
Titanium's intent and app resume handling was completely rewritten in 8.0.0 (see: [TIMOB-26075]) in order to resolve "newintent" issues while an app activity instance already exists in the background. It solved it by quickly destroying the activity instance created by the Android OS, resuming the existing activity, and passing the new intent to it. However, this code change completely disabled the open animation in this case so that new activity instance that is being quickly created/destroy won't ever appear onscreen. This was an issue that can be seen on a *+Pixel XL+*, although not all devices showed this behavior such as the Pixel 2.
We need to find a better solution where the new activity that is quickly created/destroyed is never shown, but we can preserve the animation for the resumed activity.
*Possible Solution:*
Do the following instead. I don't think there is a good way to know what the default transition animation is per device (ex: slide-up or fade), but a fade effect seems reasonable.
overridePendingTransition(android.R.anim.fade_in, 0);
PR (master): https://github.com/appcelerator/titanium_mobile/pull/10650 PR (8.0.1): https://github.com/appcelerator/titanium_mobile/pull/10651
FR Passed. Waiting for Jenkins build.
*Closing ticket.* Fix verified in SDK version
8.0.1.v20190325125116
and SDK Version8.1.0.v20190325115012
Test and other information can be found at: PR (master): https://github.com/appcelerator/titanium_mobile/pull/10650 PR (8.0.1): https://github.com/appcelerator/titanium_mobile/pull/10651