{ "id": "155073", "key": "TIMOB-20449", "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": [], "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2018-04-19T13:43:13.000+0000", "created": "2016-02-23T15:40:42.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "Ti.UI.Animation.anchorPoint" ], "versions": [ { "id": "17072", "name": "Release 5.1.2", "archived": false, "released": true, "releaseDate": "2016-01-12" } ], "issuelinks": [ { "id": "56462", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "127148", "key": "TIMOB-16596", "fields": { "summary": "Android: Animation anchorPoints not working", "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": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": null, "updated": "2018-04-19T13:43:14.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. Steps to Reproduce\r\nUse the code from documentation (http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Animation-property-anchorPoint)\r\n\r\nUsing an anchorPoint (Android and iOS)\r\n{code:javascript}\r\nvar animationType = [\r\n { name: 'Top Left', anchorPoint: {x:0, y:0} },\r\n { name: 'Top Right', anchorPoint: {x:1, y:0} },\r\n { name: 'Bottom Left', anchorPoint: {x:0, y:1} },\r\n { name: 'Bottom Right', anchorPoint: {x:1, y:1} },\r\n { name: 'Center', anchorPoint: {x:0.5, y:0.5} }\r\n];\r\nvar animationTypeLength = animationType.length;\r\nvar animationCount = 0;\r\nvar animationTypePointer = 0;\r\n\r\nvar t = Ti.UI.create2DMatrix();\r\nt = t.rotate(90);\r\n\r\n// animation properties\r\nvar a = {\r\n transform: t,\r\n duration: 2000,\r\n autoreverse: true\r\n};\r\n\r\nTi.UI.backgroundColor = 'white';\r\nvar win = Ti.UI.createWindow();\r\n\r\nvar view = Ti.UI.createView({\r\n backgroundColor:'#336699',\r\n width:100, height:100\r\n});\r\nwin.add(view);\r\n\r\nvar button = Ti.UI.createButton({\r\n title:'Animate ' + animationType[animationTypePointer].name,\r\n height: (Ti.UI.Android) ? 80 : 40,\r\n width: (Ti.UI.Android) ? 300 : 200,\r\n top:30\r\n});\r\nwin.add(button);\r\n\r\nfunction updateButton(name){\r\n button.title = 'Animate ' + name;\r\n}\r\n\r\nbutton.addEventListener('click', function(){\r\n // set new anchorPoint on animation for Android\r\n a.anchorPoint = animationType[animationTypePointer].anchorPoint;\r\n\r\n // set new anchorPoint on view for iOS\r\n view.anchorPoint = animationType[animationTypePointer].anchorPoint;\r\n\r\n animationCount++;\r\n\r\n // determine position of next object in animationType array or return to first item\r\n // using modulus operator\r\n animationTypePointer = animationCount % animationTypeLength;\r\n\r\n // animate view, followed by callback to set next button title\r\n view.animate(a, function(){\r\n updateButton(animationType[animationTypePointer].name);\r\n });\r\n});\r\n\r\nwin.open();\r\n{code}\r\n\r\nh3. Actual Result\r\nOn Android anchorPoint is always in the center of view no matter what value is set. Such situation occurs on real device (Android 5.1.1) and on GenyMotion devices (Android 4.1, 5.2).\r\nOn iOS code works as it should.\r\nThe bug may be old because I encountered it with other project but gave up that time (https://archive.appcelerator.com/topic/3536/anchor-point-is-not-working-on-android/1)\r\n\r\nh3. Expected Result\r\nAnchor point should work and view should rotate around the anchor point no matter if it is iOS or Android.", "attachment": [ { "id": "58301", "filename": ".log", "author": { "name": "CREATIVE KAIZEN", "key": "creative kaizen", "displayName": "CREATIVE KAIZEN", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-02-23T15:41:38.000+0000", "size": 7627791, "mimeType": "text/plain" }, { "id": "58302", "filename": "diagnostic4019658390838144197.log", "author": { "name": "CREATIVE KAIZEN", "key": "creative kaizen", "displayName": "CREATIVE KAIZEN", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-02-23T15:41:51.000+0000", "size": 146105, "mimeType": "text/plain" } ], "flagged": false, "summary": "Ti.UI.Animation.anchorPoint is not working on Android", "creator": { "name": "CREATIVE KAIZEN", "key": "creative kaizen", "displayName": "CREATIVE KAIZEN", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "CREATIVE KAIZEN", "key": "creative kaizen", "displayName": "CREATIVE KAIZEN", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "384084", "author": { "name": "CREATIVE KAIZEN", "key": "creative kaizen", "displayName": "CREATIVE KAIZEN", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hello,\r\nIs there any chance to fix that bug anytime soon? It blocks all rotations on Android, except with centered anchorPoint.\r\n\r\nThansk", "updateAuthor": { "name": "CREATIVE KAIZEN", "key": "creative kaizen", "displayName": "CREATIVE KAIZEN", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-04-27T16:04:12.000+0000", "updated": "2016-04-27T16:04:12.000+0000" }, { "id": "387878", "author": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "body": "This is a parity issue, or perhaps a documentation issue. On Android, you set the anchor point on the view being animated. On iOS, you set the anchor point on the animation object. At least, that's how it used to work back when I wrote this gist https://gist.github.com/skypanther/08a0334f674afb394445", "updateAuthor": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "created": "2016-06-08T21:10:57.000+0000", "updated": "2016-06-08T21:10:57.000+0000" }, { "id": "388158", "author": { "name": "enzoq", "key": "enzoq", "displayName": "VINCENZO QUACQUARELLI", "active": true, "timeZone": "Europe/Rome" }, "body": "I have the same problem. I need a solution, please.", "updateAuthor": { "name": "enzoq", "key": "enzoq", "displayName": "VINCENZO QUACQUARELLI", "active": true, "timeZone": "Europe/Rome" }, "created": "2016-06-12T22:34:49.000+0000", "updated": "2016-06-12T22:34:49.000+0000" }, { "id": "388200", "author": { "name": "CREATIVE KAIZEN", "key": "creative kaizen", "displayName": "CREATIVE KAIZEN", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Tim:\r\n1. I think you mix things. On Android you use anchor point on the animation object, and on the view for iOS.\r\n2. My code fulfills both situations: adding anchor point to view and animation (same as yours).\r\n3. Your code doesn't work properly on Android due same issue.", "updateAuthor": { "name": "CREATIVE KAIZEN", "key": "creative kaizen", "displayName": "CREATIVE KAIZEN", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-06-13T11:42:03.000+0000", "updated": "2016-06-13T11:42:03.000+0000" }, { "id": "388208", "author": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "body": "Like I said, this is old code that I haven't looked at in years. That code used to work; I used it in an app as well as in demonstrations in the Titanium classes I taught. \r\n\r\nSo, this is a regression.", "updateAuthor": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "created": "2016-06-13T14:12:28.000+0000", "updated": "2016-06-13T14:12:28.000+0000" }, { "id": "436997", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "Closing this ticket as duplicate.", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2018-04-19T13:42:42.000+0000", "updated": "2018-04-19T13:42:42.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }