[TIMOB-9495] Android: Animation: An animated object does not animate correctly the second time
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-06-15T13:26:43.000+0000 |
Affected Version/s | Release 2.1.0 |
Fix Version/s | Release 2.1.0, Sprint 2012-12 Core |
Components | Android |
Labels | core, module_animation, qe-and060112, qe-testadded, regression |
Reporter | Satyam Sekhri |
Assignee | Bill Dawson |
Created | 2012-06-12T03:19:30.000+0000 |
Updated | 2012-07-03T15:06:56.000+0000 |
Description
An animated view object does not animate properly the second time.
This is a regression. The behavior does not happen on 2.0.2
Steps to Reproduce:
1. Create an application with the Sample code for animation, as given below
2. Run the application
3. Click on Red View. The red view animates.
4. After the animation is completed, again click on the Red view
Actual Result: The red view scales for once and stays
Expected: The red view should animate each time it is clicked
Sample Code
var win = Ti.UI.createWindow({
backgroundColor:'green'
});
var box = Ti.UI.createView({
backgroundColor : 'red',
height : '150',
width : '100'
});
box.addEventListener('click', function() {
var matrix = Ti.UI.create2DMatrix()
matrix = matrix.scale(2, 2);
var a = Ti.UI.createAnimation({
transform : matrix,
duration : 2000,
autoreverse : true,
repeat : 3
});
box.animate(a);
});
win.add(box);
win.open();
Fail Case / Test Case
* Create an app with this app.js:* Run it. * Tap the red box. It should grow and shrink twice. Tap it again: in the fail case, it will fail to do what it's supposed to (it gets stuck). In the fixed branch, it should do just like when you tapped it the first time. * Tap the green box. It should rotate forward and back twice. Tap it again: in the fail case, it will fail to do what it's supposed to (it gets stuck). In the fixed branch, it should do just like when you tapped it the first time.
Pull request ready: https://github.com/appcelerator/titanium_mobile/pull/2392
Closing issue Tested with Ti Studio build 2.1.0.201206172244 Ti Mobile SDK2.1.0.v20120618134156 hash r00905cd0 OSX Lion 10.7.3 iPhone 4S OS 5.1, Nexus S OS 4.0.4 The expected behavior is shown