{ "id": "172335", "key": "TIMOB-26408", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": null, "resolutiondate": null, "created": "2018-09-22T15:07:40.000+0000", "priority": null, "labels": [ "android", "animation" ], "versions": [], "issuelinks": [], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-09-23T20:53:57.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [], "description": "Android has no possibility to cancel/stop animations like moving an object from left to right before the duration is over. This PR adds a stopAnimation() method to Ti.UI.View\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: 'white'\r\n});\r\n\r\nvar lbl = Ti.UI.createLabel({\r\n\ttext: \"-\",\r\n\tcolor: \"#000\",\r\n\twidth: Ti.UI.SIZE,\r\n\theight: Ti.UI.SIZE\r\n});\r\n\r\nvar view = Ti.UI.createView({\r\n\tbackgroundColor: 'red',\r\n\theight: 100,\r\n\twidth: 100,\r\n\ttop: 0,\r\n\tleft: 0\r\n});\r\n\r\nvar btn1 = Ti.UI.createButton({\r\n\ttitle: 'Animate',\r\n\twidth: 100,\r\n\theight: 40,\r\n\tbottom: 20,\r\n\tleft: 10\r\n});\r\nbtn1.addEventListener('click', function() {\r\n\tview.left = 0;\r\n\tview.animate(ani);\r\n});\r\n\r\nvar btn2 = Ti.UI.createButton({\r\n\ttitle: 'Cancel',\r\n\twidth: 100,\r\n\theight: 40,\r\n\tbottom: 20,\r\n\tright: 10\r\n});\r\nbtn2.addEventListener('click', function() {\r\n\tview.stopAnimation();\r\n\tview.left = 0;\r\n});\r\n\r\nvar ani = Ti.UI.createAnimation({\r\n\tleft: 100,\r\n\tduration: 3000\r\n})\r\n\r\nani.addEventListener(\"start\", function() {\r\n\tconsole.log(\"start\");\r\n\tlbl.text = \"start\";\r\n});\r\n\r\nani.addEventListener(\"complete\", function() {\r\n\tconsole.log(\"complete\");\r\n\tlbl.text = \"complete\";\r\n})\r\n\r\nani.addEventListener(\"cancel\", function() {\r\n\tconsole.log(\"cancel\");\r\n\tlbl.text = \"cancel\";\r\n})\r\n\r\n\r\nwin.add([view, btn1, btn2, lbl]);\r\nwin.open();\r\n{code}\r\n\r\nPR: https://github.com/appcelerator/titanium_mobile/pull/10130", "attachment": [], "flagged": false, "summary": "Android: Add stopAnimation() to View", "creator": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "441929", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello [~michael], This for the request and the PR. This is a valid feature request. Our engineers will look into it. Moving to engineering. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2018-09-23T20:53:03.000+0000", "updated": "2018-09-23T20:53:03.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }