{ "id": "165837", "key": "AC-4781", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2017-02-09T09:39:44.000+0000", "created": "2017-02-08T14:45:37.000+0000", "labels": [ "animation", "height" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-02-22T10:07:27.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14544", "name": "Alloy", "description": "Please enter tickets related to the Alloy here." }, { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "Animating to '0dp' and back to '40dp' will not work (tested only on iOS).\r\n\r\nh4. Testcase\r\nCreate a new project using `appc new -n mytestproj` and paste the following snippets:\r\n\r\n*index.js*\r\n{code:javascript}\r\n\r\nfunction fadeIn(element) {\r\n element.animate({\r\n height: 40\r\n });\r\n console.log('FADEIN');\r\n};\r\n\r\nfunction fadeOut(element) {\r\n element.animate({\r\n height: 0\r\n });\r\n console.log('FADEOUT');\r\n};\r\n\r\nsetTimeout(function() {\r\n fadeOut($.my_view_reference);\r\n}, 2000);\r\n\r\nsetTimeout(function() {\r\n fadeIn($.my_view_reference);\r\n}, 4000);\r\n\r\n\r\n$.index.open();\r\n{code}\r\n\r\n*index.xml*\r\n{code:xml}\r\n\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\r\n\r\n{code}", "attachment": [], "flagged": false, "summary": "Animation height 0 doesnt work", "creator": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "environment": "Ti SDK 6.0.1.GA, Alloy 1.9.5, iOS Simulator 10.1", "comment": { "comments": [ { "id": "406601", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Non-view elements should be wrapped into views in order to be animated properly. Example (for labels):\r\n{code:js}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#fff'\r\n});\r\n\r\nvar view = Ti.UI.createView({\r\n height: 40,\r\n backgroundColor: \"red\"\r\n});\r\n\r\nview.add(Ti.UI.createLabel({\r\n text: 'Trigger'\r\n}))\r\n\r\nview.addEventListener('click', function() {\r\n view.animate({\r\n height: 0\r\n });\r\n});\r\n\r\nwin.add(view);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-02-08T18:02:04.000+0000", "updated": "2017-02-08T18:02:04.000+0000" }, { "id": "406710", "author": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "body": "ok that wasnt clear to me, but it appears I have done so in my code.\r\n\r\nPlease test the given bug though: animate to '0dp' and animate back to a '40dp' height.", "updateAuthor": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "created": "2017-02-09T09:31:42.000+0000", "updated": "2017-02-09T09:31:42.000+0000" }, { "id": "406712", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "You use two inline-elements (Switch and Label) and the ticket does not state which element gets animated. But when I'd use {{$.my_view_reference.fadeOut();}} it will disappear:\r\n{code:js}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#fff'\r\n});\r\n \r\nvar view = Ti.UI.createView({\r\n height: '50dp',\r\n backgroundColor: \"red\"\r\n});\r\n\r\nview.add(Ti.UI.createLabel({\r\n text: 'Some text',\r\n right: '50dp'\r\n}))\r\n\r\nview.add(Ti.UI.createSwitch({\r\n text: 'Trigger',\r\n width: 50\r\n}))\r\n \r\nview.addEventListener('click', function() {\r\n view.animate({\r\n height: '0dp'\r\n });\r\n});\r\n \r\nwin.add(view);\r\nwin.open();\r\n{code}\r\n\r\nNote that you also mixed dp and non-dp units. Try to completely avoid dp units if possible and manage the dp for Android in the tiapp.xml ({{ dp}}), which is the default already.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-02-09T09:39:16.000+0000", "updated": "2017-02-09T09:39:16.000+0000" }, { "id": "406714", "author": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "body": "yes I do actually use that in a lot of my code, but I can remember having a bug with animations previously in which it didnt animate properly when using \"0\" (integer) over \"'0dp'\" (string), so i basically sticked to dp units for animations and integers for everything else", "updateAuthor": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "created": "2017-02-09T09:42:03.000+0000", "updated": "2017-02-09T09:42:03.000+0000" }, { "id": "406715", "author": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "body": "also the ticket states *exports.fadeOut($.my_view_reference)* which is the parent view element as can be seen in the xml snippet", "updateAuthor": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "created": "2017-02-09T09:42:52.000+0000", "updated": "2017-02-09T09:42:52.000+0000" }, { "id": "406717", "author": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "body": "i've provided a full testcase, please run it for yourself and I hope you can reproduce what I run into", "updateAuthor": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "created": "2017-02-09T09:54:15.000+0000", "updated": "2017-02-09T09:54:15.000+0000" }, { "id": "406968", "author": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "body": "Hi, can this be re-opened?", "updateAuthor": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "created": "2017-02-14T08:56:50.000+0000", "updated": "2017-02-14T08:56:50.000+0000" }, { "id": "407163", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Sorry, we need a single-environment test-case like the one I provided to track it down. Can you provide that? ", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-02-16T09:13:23.000+0000", "updated": "2017-02-16T09:13:23.000+0000" }, { "id": "407166", "author": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "body": "Use the latest Ti SDK (6.0.1.GA) with Alloy (1.9.5) and create a new app with the given testcase. Run it on an iOS simulator (iOS 10.1 (14B72)) and you will see that the second animation will not commence.\r\n\r\nThe testcase works as expected on Android.", "updateAuthor": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "created": "2017-02-16T09:20:23.000+0000", "updated": "2017-02-16T09:20:23.000+0000" }, { "id": "407568", "author": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "body": "Hi please reopen this ticket. A valid testcase has already been provided", "updateAuthor": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "created": "2017-02-22T10:07:27.000+0000", "updated": "2017-02-22T10:07:27.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }