{ "id": "94017", "key": "TIMOB-9825", "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": "13574", "description": "Sprint 2012-15 Core", "name": "Sprint 2012-15 Core", "archived": true, "released": true, "releaseDate": "2012-07-30" }, { "id": "14096", "description": "Release 2.1.2", "name": "Release 2.1.2", "archived": true, "released": true, "releaseDate": "2012-08-31" }, { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-08-16T14:36:57.000+0000", "created": "2012-06-27T15:06:44.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "SupportTeam", "core", "module_animation", "qe-review", "qe-testadded" ], "versions": [ { "id": "13273", "description": "Release 2.0.2", "name": "Release 2.0.2", "archived": false, "released": true, "releaseDate": "2012-05-31" }, { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" } ], "issuelinks": [], "assignee": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2012-12-21T00:01:35.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h3. Problem\r\nWhen trying to run an animation such as this on Android:\r\n\r\nvar openAnimation = Ti.UI.createAnimation({left :'35dp',duration : 350});\r\n\r\nAn error is thrown:\r\nUncaught Error: unable to parse '35dp' as integer\r\n\r\n\r\nh3. Steps to Reproduce\r\n\r\nPlease run the sample code below to reproduce the issue:\r\n\r\n{noformat}\r\n\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor:'white'\r\n});\r\nwin.open();\r\n\r\n\r\nvar closingLabel = Titanium.UI.createLabel({\r\n text:'The End',\r\n height:'auto',\r\n width:'auto',\r\n color:'#fff',\r\n font:{fontSize:12},\r\n textAlign:'center',\r\n opacity: 0\r\n});\r\n\r\nwin.add(closingLabel);\r\n\r\nclosingLabel.animate(Titanium.UI.createAnimation({\r\n opacity: 100,\r\n duration: 2500,\r\n left:'35dp',\r\n transform: Titanium.UI.create2DMatrix({\r\n scale: 1.5\r\n })\r\n}));\r\n{noformat}\r\n\r\nPlease see the attached screenshot of the error too.", "attachment": [ { "id": "28762", "filename": "Screen Shot 2012-06-27 at 3.02.21 PM.png", "author": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "created": "2012-06-27T15:06:44.000+0000", "size": 590134, "mimeType": "image/png" } ], "flagged": false, "summary": "Android: Animations don't work with 'dp' values", "creator": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "environment": "Platform OS: Android 2.3\r\nPlatform SDK: 2.0.2.GA", "comment": { "comments": [ { "id": "208446", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "we definitely need to fix, but of course a simple workaround would be to set\r\n\r\n{code}\r\ndip\r\n{code}\r\n\r\nin tiapp.xml so to as to avoid needing to ever specify \"dp\" as part of unit properties. TIMOB-9954, which was recently merged, helped to get that to work.", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-07-19T05:57:44.000+0000", "updated": "2012-07-19T05:57:44.000+0000" }, { "id": "208466", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "h3. Test / Fail Case\r\n\r\n* Create an app with this app.js:\r\n\r\n{code:title=app.js}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor : '#444',\r\n\texitOnClose : true\r\n});\r\n\r\nvar v1 = Ti.UI.createView({\r\n\ttop: \"100dip\",\r\n\tleft: \"110dip\",\r\n\theight: \"100dip\",\r\n\twidth: \"100dip\",\r\n\tbackgroundColor: \"blue\"\r\n});\r\nwin.add(v1);\r\n\r\nv1.add(Ti.UI.createLabel({\r\n\tcolor: \"yellow\", text: \"top: '100dp', height: '100dp'\"\r\n}));\r\n\r\nvar v2 = Ti.UI.createView({\r\n\ttop: \"0dp\",\r\n\tleft: \"0dp\",\r\n\theight: \"50dp\",\r\n\twidth: \"50dp\",\r\n\tbackgroundColor: \"red\"\r\n});\r\nwin.add(v2);\r\n\r\nvar btn = Ti.UI.createButton({\r\n\tbottom: \"50dp\", left: \"10dp\", right: \"10dp\",\r\n\ttitle: \"Move red next to blue\"\r\n});\r\nwin.add(btn);\r\nbtn.addEventListener(\"click\", function() {\r\n\tv2.animate({top: \"100dp\", height: \"100dp\", width: \"100dp\", left: \"10dp\", duration: 1000});\r\n});\r\n\r\nwin.open();\r\n{code}\r\n\r\n* The point of the test is to move the Red box down to be next to the Blue box (flush with left side) and make it the same size as the blue box while doing so.\r\n\r\n* Click the button, which starts an animation that uses \"dp\" for top, height, width and left properties. I.e., it's a simultaneous translate+size animation to move the red box down and make it the same size as the blue box.\r\n\r\n* The fail case is that you'll get a runtime error right away because we didn't support \"dp\" (or other unit specifiers). When testing the fix, it should work fine.", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-07-19T10:22:43.000+0000", "updated": "2012-07-19T10:22:43.000+0000" }, { "id": "208467", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "Pull request ready\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/pull/2606", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-07-19T10:24:28.000+0000", "updated": "2012-07-19T10:24:28.000+0000" }, { "id": "213815", "author": { "name": "rumbrasas", "key": "rumbrasas", "displayName": "Rima Umbrasas", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed with \r\nmobile sdk-2.2.0.v20120810080115\r\nTitanium Studio, build: 2.1.1.201207271312\r\nDevice:\r\nAndroid emulator", "updateAuthor": { "name": "rumbrasas", "key": "rumbrasas", "displayName": "Rima Umbrasas", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-10T11:46:13.000+0000", "updated": "2012-08-10T11:46:13.000+0000" }, { "id": "214799", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR for 2_1_X branch created:\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/pull/2761", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-08-16T10:57:54.000+0000", "updated": "2012-08-16T10:57:54.000+0000" }, { "id": "214879", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Re-opening to update labels.", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-16T14:36:20.000+0000", "updated": "2012-08-16T14:36:20.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }