[TIMOB-26586] iOS: Animation curve ease-in/ease-out does not auto-reverse correctly
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-11-29T14:38:53.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 8.0.0 |
Components | iOS |
Labels | animation, ios, repeat, reverse |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2018-11-21T02:11:03.000+0000 |
Updated | 2018-11-30T12:24:47.000+0000 |
Description
*Summary:*
A view animation with "autoreverse" set to
true
and a "repeat" of 0
(the default) will not correctly reverse the animation when using "curve" Ti.UI.ANIMATION_CURVE_EASE_IN
or Ti.UI.ANIMATION_CURVE_EASE_OUT
. The animation incorrectly uses the same curve when performing the reverse animation.
If "repeat" is set to 1
or higher, this issue will only happen on the final/last repeated reverse animation. This issue won't happen on prior repeated animations.
*Expected Behavior:*
When the curve is set to Ti.UI.ANIMATION_CURVE_EASE_IN
, then the reverse animation curve is supposed to be Ti.UI.ANIMATION_CURVE_EASE_OUT
.
When the curve is set to Ti.UI.ANIMATION_CURVE_EASE_OUT
, then the reverse animation curve is supposed to be Ti.UI.ANIMATION_CURVE_EASE_IN
.
The above is how it works in HTML5 "reverse" animation. See...
https://developer.mozilla.org/en-US/docs/Web/CSS/animation-direction#Syntax
*Cause:*
Titanium's iOS code generates its own reverse animation to work-around an Apple bug. The issue is that the reverse animation uses the same "curve" as the forward animation. This is where the reverse curve should be applied instead.
https://github.com/appcelerator/titanium_mobile/blob/master/iphone/TitaniumKit/TitaniumKit/Sources/API/TiAnimation.m#L412
Attachments
File | Date | Size |
---|---|---|
AnimationCurveTest.js | 2018-11-21T02:11:32.000+0000 | 1800 |
PR (master): https://github.com/appcelerator/titanium_mobile/pull/10486
*Closing ticket.* Fix verified in SDK Version
8.0.0.v20181129161342
. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/10486