{ "id": "98396", "key": "TIMOB-10318", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "14065", "description": "Sprint 2012-17 API", "name": "Sprint 2012-17 API", "archived": true, "released": true, "releaseDate": "2012-08-27" } ], "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2013-09-18T20:36:42.000+0000", "created": "2012-07-31T02:13:40.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "api", "module_animation", "qe-review", "qe-testadded" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" }, { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "issuelinks": [ { "id": "31999", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "111824", "key": "TIMOB-13237", "fields": { "summary": "iOS: View - View.left does not work second time when animation is implemented on button click", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "23441", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "80575", "key": "TIMOB-5354", "fields": { "summary": "iOS: Text area animation buggy", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-20T16:26:58.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "when running the same animation twice, the second call doesnt work well.\r\nI should mention that i reset the position before starting the animation\r\n{code}\r\nvar win = Ti.UI.createWindow({ fullscreen: true, backgroundColor: 'white'});\r\n \r\n \r\n//label using localization-ready strings from /i18n/en/strings.xml\r\nvar view = Ti.UI.createView({\r\n backgroundColor:'red',\r\n height:100,\r\n width:100,\r\n top:0,\r\n left:0\r\n});\r\nwin.add(view);\r\n\r\nvar button = Titanium.UI.createButton({\r\n title:'Animate',\r\n width:200,\r\n height:40,\r\n bottom:20,\r\n left: 10\r\n});\r\n\r\nbutton.addEventListener('click', function()\r\n{\r\n view.left = 0;\r\n //view.updateLayout({left:0}); //tried that too, still doesnt work\r\n view.animate({left:(win.rect.width - view.rect.width), duration:1000});\r\n});\r\nwin.add(button);\r\n\r\nwin.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: animation redraw problem", "creator": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "environment": "Ti 2.2.0 (master)", "comment": { "comments": [ { "id": "211496", "author": { "name": "btran", "key": "btran", "displayName": "Betty Tran", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Martin,\r\n\r\nIf we reset the position of the view after the animation has finished, the animation is working every time the button is clicked. For example:\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({ fullscreen: true, backgroundColor: 'white'});\r\n \r\n \r\n//label using localization-ready strings from /i18n/en/strings.xml\r\nvar view = Ti.UI.createView({\r\n backgroundColor:'red',\r\n height:100,\r\n width:100,\r\n top:0,\r\n left:0\r\n});\r\nwin.add(view);\r\n \r\nvar button = Titanium.UI.createButton({\r\n title:'Animate',\r\n width:200,\r\n height:40,\r\n bottom:20,\r\n left: 10\r\n});\r\n \r\nbutton.addEventListener('click', function()\r\n{\r\n view.left = 0;\r\n //view.updateLayout({left:0}); //tried that too, still doesnt work\r\n view.animate({left:(win.rect.width - view.rect.width), duration:1000});\r\n setTimeout(function(){\r\n \tview.left = 0;\r\n}, 1001);\r\n});\r\nwin.add(button);\r\n \r\nwin.open();\r\n{code}\r\n\r\nThe sample code that was provided is not working because the view is already in the finishing position of the animation. We need to reset the view position first.", "updateAuthor": { "name": "btran", "key": "btran", "displayName": "Betty Tran", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-06T04:59:25.000+0000", "updated": "2012-08-06T04:59:25.000+0000" }, { "id": "211497", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "body": "You went a little fast in saying invalid ;)\r\nYour code doesnt fix the bug.\r\nMy bug is run the sample code, start the animation, wait to it to finish(square on the right).\r\nRun it again, nothing happens(it is happening but not redrawing).\r\n\r\nMoreover i dont get your comment about the view already being in the finishing position. Start is left of the screen, finish is right of the screen.", "updateAuthor": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2012-08-06T05:05:48.000+0000", "updated": "2012-08-06T05:05:48.000+0000" }, { "id": "211500", "author": { "name": "btran", "key": "btran", "displayName": "Betty Tran", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Martin,\r\n\r\nWhen we start the animation, the view is in position 0 (we can check this using view.rect.x). The view finishes the animation in position 220. If we click the button again, the view animates until it has reached position 220. No animation is visible because the view is already at position 220.\r\n\r\nThe code provided resets the view so it is back on the left. The animation works after resetting the view position back to the left.", "updateAuthor": { "name": "btran", "key": "btran", "displayName": "Betty Tran", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-06T05:23:00.000+0000", "updated": "2012-08-06T05:23:39.000+0000" }, { "id": "211502", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "body": "I get what you say but `view.left = 0;` should reset the position right away\r\nThat's why i am doing it before starting my animation\r\nThis is a trick that i have been using to get around that bug\r\n{code}\r\n\r\nvar win = Ti.UI.createWindow({ fullscreen: true, backgroundColor: 'white'});\r\n \r\n \r\n//label using localization-ready strings from /i18n/en/strings.xml\r\nvar view = Ti.UI.createView({\r\n backgroundColor:'red',\r\n height:100,\r\n width:100,\r\n top:0,\r\n left:0\r\n});\r\nwin.add(view);\r\n \r\nvar button = Titanium.UI.createButton({\r\n title:'Animate',\r\n width:200,\r\n height:40,\r\n bottom:20,\r\n left: 10\r\n});\r\n \r\nbutton.addEventListener('click', function()\r\n{\r\n view.animate({left:0, duration:1}, function(){\r\n view.animate({left:(win.rect.width - view.rect.width), duration:1000});\r\n });\r\n\r\n});\r\nwin.add(button);\r\n \r\nwin.open();\r\n{code}\r\nSo my point is that view.left = 0; should change the value right away (even if the redraw event comes later in the event queue) so that a following animation works as expected.", "updateAuthor": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2012-08-06T05:47:37.000+0000", "updated": "2012-08-06T05:47:37.000+0000" }, { "id": "212070", "author": { "name": "btran", "key": "btran", "displayName": "Betty Tran", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The view.left=0 does not reposition the view to the left. However, it works if we allow some time before calling the animation: \r\n\r\n{code}\r\nbutton.addEventListener('click', function(e)\r\n{\r\n view.left = 0;\r\n\r\n setTimeout(function(){\r\n \t view.animate({left:(win.rect.width - view.rect.width), duration:1000});\r\n \t\r\n}, 100);\r\n});\r\n{code}\r\n\r\nThe bug does not occur in 2.1.1GA.", "updateAuthor": { "name": "btran", "key": "btran", "displayName": "Betty Tran", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-06T09:54:52.000+0000", "updated": "2012-08-06T09:54:52.000+0000" }, { "id": "213073", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "body": "When you say the \"The view.left=0 does not reposition the view to the left.\" do you mean it as it is a bug, or as it is so?\r\nTo me we shouldnt need to wait a little. We set the property, it is available right away if we \"get\" it so we can assume that a following animation would use that value.", "updateAuthor": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2012-08-07T00:39:16.000+0000", "updated": "2012-08-07T00:39:16.000+0000" }, { "id": "213083", "author": { "name": "btran", "key": "btran", "displayName": "Betty Tran", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Martin, yes it appears to be a bug.", "updateAuthor": { "name": "btran", "key": "btran", "displayName": "Betty Tran", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-07T03:08:59.000+0000", "updated": "2012-08-07T03:08:59.000+0000" }, { "id": "213094", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "body": "thanks Betty", "updateAuthor": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2012-08-07T05:44:45.000+0000", "updated": "2012-08-07T05:44:45.000+0000" }, { "id": "214986", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR merged https://github.com/appcelerator/titanium_mobile/pull/2763", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-17T11:52:59.000+0000", "updated": "2012-08-17T11:52:59.000+0000" }, { "id": "216263", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fix with:\r\nTitanium Studio, build: 2.1.2.201208201549\r\nTitanium SDK:2.2.0.v20120824175712\r\nTitanium SDK:2.1.2.v20120824144611\r\n\r\nDevices:\r\nSimulator 5.1\r\niPhone 4.3.5", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-27T12:57:36.000+0000", "updated": "2012-08-27T12:57:36.000+0000" }, { "id": "217367", "author": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "reopening to update labels", "updateAuthor": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-04T02:28:49.000+0000", "updated": "2012-09-04T02:28:49.000+0000" }, { "id": "231231", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "The fix for this issue has been reverted in the master branch and will be removed in the 3.0.1 release as well.", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-12-13T17:57:43.000+0000", "updated": "2012-12-13T17:57:43.000+0000" }, { "id": "231232", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Reverted by PR https://github.com/appcelerator/titanium_mobile/pull/3568", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-12-13T17:58:02.000+0000", "updated": "2012-12-13T17:58:02.000+0000" }, { "id": "250511", "author": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "body": "issue reproduces\n\nTested with\nTitanium Studio, build: 3.0.1.201212181159\nTitanium SDK version: 3.1.0\niOS iPhone Simulator: iOS SDK version: 6.0\n", "updateAuthor": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-05-07T06:55:12.000+0000", "updated": "2013-05-07T06:55:12.000+0000" }, { "id": "413682", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as duplicate.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-20T16:26:58.000+0000", "updated": "2017-03-20T16:26:58.000+0000" } ], "maxResults": 15, "total": 15, "startAt": 0 } } }