{ "id": "80525", "key": "TIMOB-5340", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2016-08-22T17:13:24.000+0000", "created": "2011-09-22T15:45:58.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "android", "animate", "eventlistener" ], "versions": [ { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-16T21:37:00.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": "1) Use the app.js below in a new project\r\n2) Launch application\r\n\r\nExpected results: View animates from red to orange to black.\r\nActual results: View remains red.\r\n\r\nNotes:\r\nLogcat keeps returning \"listener not found for eventName 'complete'\"\r\nIssue was discovered when testing iOS fix for TIMOB-3160\r\nCode sample is essentially the example from: http://developer.appcelerator.com/apidoc/mobile/1.0/Titanium.UI.Animation\r\n\r\n{code:title=app.js|borderStyle=solid}\r\nvar win = Ti.UI.createWindow({ backgroundColor: 'purple' });\r\n\r\nvar view = Titanium.UI.createView({\r\n backgroundColor:'red'\r\n});\r\nvar animation = Titanium.UI.createAnimation();\r\nanimation.backgroundColor = 'black';\r\nanimation.duration = 4000;\r\nanimation.addEventListener('complete',function()\r\n{\r\n animation.removeEventListener('complete',this);\r\n animation.backgroundColor = 'orange';\r\n view.animate(animation);\r\n});\r\nview.animate(animation);\r\n\r\nwin.add(view);\r\n\r\nwin.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: event listener is not found when passed 'this'", "creator": { "name": "avaghti", "key": "avaghti", "displayName": "Alan Vaghti", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "avaghti", "key": "avaghti", "displayName": "Alan Vaghti", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Nexus One 2.2.2, SDK 1.8.0.v20110922105247, Titanium Studio build: 1.0.5.201109091616", "comment": { "comments": [ { "id": "176383", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Bug persists on:\r\n\r\nSDK build: 1.8.0.1.v20111216124633\r\nDevices: LG Slate (3.1) on V8, Droid 1 (2.2.2) on Rhino", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-12-16T14:33:45.000+0000", "updated": "2011-12-16T14:33:45.000+0000" }, { "id": "393793", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "{{this}} does not refer to the reference to callback function, but rather the global scope. {{removeEventListener()}} expects the second argument to be a function, not an object. You need to name the function and pass in the reference to the function like this:\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({ backgroundColor: 'purple' });\r\n\r\nvar view = Titanium.UI.createView({\r\n backgroundColor:'red'\r\n});\r\n\r\nfunction callback() {\r\n animation.removeEventListener('complete', callback);\r\n animation.backgroundColor = 'orange';\r\n view.animate(animation);\r\n}\r\n\r\nvar animation = Titanium.UI.createAnimation();\r\nanimation.backgroundColor = 'black';\r\nanimation.duration = 4000;\r\nanimation.addEventListener('complete', callback);\r\nview.animate(animation);\r\n\r\nwin.add(view);\r\n\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2016-08-22T17:13:24.000+0000", "updated": "2016-08-22T17:13:24.000+0000" }, { "id": "413137", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-16T21:37:00.000+0000", "updated": "2017-03-16T21:37:00.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }