Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3138] View properties not updated after animation

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNeeds more info
Resolution Date2011-10-20T12:38:12.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterJavier Pascual Soriano
AssigneePaul Dowsett
Created2011-08-26T02:03:42.000+0000
Updated2016-03-08T07:48:12.000+0000

Description

When launch an animation of a view than (for example) modify the 'top' property and use this property to calculate the next position of the view, the 'top' value is only valid at first time: myButton.addEventListener("click", function () { myView.animate({ top: myView.top + 10 }); }); If the line 'top: myView.top + 10' is replaced with 'top: Math.random() * 10', view animation runs ok. The bug is that 'animate' method don't update the 'top' property of the view after first complete animation.

Comments

  1. Anthony Decena 2011-10-20

    Thank you for raising this ticket. If this is still an issue, then we need all the information listed in the [Jira Ticket Checklist](http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-Summary%3AJiraTicketChecklist) in order to accept a ticket. In this case, we need a complete code example showing the issue. Thank you.
  2. Tamara Bernad 2011-10-31

    Hi, I am having the same issue. I see this ticket is already closed, but not solved because of lack of information. I am attaching here a code that can be use to see what is happening. Just two buttons and one box, when you click on button 1, the box animates to a position and on click on the second button the box resets its position to current top & left. On reset of the position the box should stay where it is, but it gets back to initial position, so the position values are not getting updated on the animation. The following code should work by just paste & compile: ----------------- CODE ----------------- var platformWidth = Ti.Platform.displayCaps.platformWidth; var platformHeight = Ti.Platform.displayCaps.platformHeight; var win = Ti.UI.createWindow({ modal : true, backgroundColor : '#000', layout : 'absolute', navBarHidden : true }); var b1 = Titanium.UI.createButton({ title : 'Click to animate', width : 200, height : 30, top : 10, left : 10 }); var b2 = Titanium.UI.createButton({ title : 'Click to reposition', width : 200, height : 30, top : b1.height + b1.top + 10, left : 10 }); var box = Ti.UI.createView({ width : 100, height : 30, backgroundColor : "#ff00ff", top : b2.top + b2.height + 20, left : b1.left }); win.add(b1); win.add(b2); win.add(box); b1.addEventListener('click', function(e) { box.animate({ duration : 500, left : platformWidth - box.width, top : platformHeight - box.height - 30 }); }); b2.addEventListener('click', function(e) { box.left = box.left; box.top = box.top; }); win.open(); ---------------------------------------------------- I am running: Titanium SDK version:1.7.3 Platform & version: iOS 4.3 Device Details: iOS simulator Host Operating System: OSX 10.6.7 Titanium Studio version: 1.0.6.201110251616 I hope this info helps, please let me know if this is enough or if I need to open a new ticket for this issue. Thank you.
  3. Paul Dowsett 2012-02-17

    Closing due to inactivity. If this issue still exists, please raise a new ticket, including all the information in the [JIRA Ticket Checklist](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-JIRATicketChecklist) to ensure that we can escalate it quickly. Read [How to Submit a Bug Report](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report) if you have not read it before, and always start a ticket using the [JIRA Ticket Template](https://wiki.appcelerator.org/display/guides/JIRA+Ticket+Template). Thanks in advance

JSON Source