{ "id": "105501", "key": "AC-2366", "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": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-03-20T22:38:15.000+0000", "created": "2012-11-26T14:46:55.000+0000", "labels": [ "android", "animation", "backgroundImage", "opacity", "view" ], "versions": [], "issuelinks": [], "assignee": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "updated": "2016-03-08T07:41:23.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "*Problem description*\r\nI have a window with two views one under the other. Each has a background image. I have a simple animation that has the top view disappear (changing opacity) to reveal the bottom view. The app crashes on this animation. It doesn't crash if only one of them has a background image.\r\n\r\n*Workaround*\r\nAssign the bottom background image to the containing view.\r\n\r\n*Test case*\r\n{code}\r\nvar mainWindow = Ti.UI.createWindow({\r\n\theight : Ti.UI.FILL,\r\n\twidth : Ti.UI.FILL,\r\n\tfullscreen : true,\r\n\texitOnClose : true,\r\n\tnavBarHidden : true,\r\n\tbackgroundColor : '#000',\r\n});\r\n\r\nvar card = Ti.UI.createView({\r\n\theight : Ti.UI.FILL,\r\n\twidth : Ti.UI.FILL,\r\n\ttop : 0,\r\n\tleft : 0,\r\n\tbackgroundImage : 'KS_nav_ui.png'\r\n});\r\nmainWindow.add(card);\r\n\r\nvar splash = Ti.UI.createView({\r\n\theight : Ti.UI.Fill,\r\n\twidth : Ti.UI.FILL,\r\n\tbackgroundImage : 'KS_nav_views.png',\r\n\tzIndex : 100,\r\n\ttop : 0,\r\n\tleft : 0\r\n});\r\nmainWindow.add(splash);\r\n\r\nvar closeSplash = function() {\r\n\tsplash.animate({\r\n\t\topacity : 0,\r\n\t\tduration : 750\r\n\t}, function() {\r\n\t\tmainWindow.remove(splash);\r\n\t\tsplash = null;\r\n\t});\r\n\tclearTimeout(timer);\r\n\ttimer = null;\r\n};\r\n\r\nvar timer = setTimeout(closeSplash, 5000);\r\nmainWindow.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "Android App Crashes On Animation Involving Two Views With Background Images", "creator": { "name": "itayavtalyon", "key": "itayavtalyon", "displayName": "Itay Avtalyon", "active": true, "timeZone": "Asia/Jerusalem" }, "subtasks": [], "reporter": { "name": "itayavtalyon", "key": "itayavtalyon", "displayName": "Itay Avtalyon", "active": true, "timeZone": "Asia/Jerusalem" }, "environment": null, "comment": { "comments": [ { "id": "228791", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Itay, can you please provide sample code?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-28T03:19:40.000+0000", "updated": "2012-11-28T03:19:40.000+0000" }, { "id": "228807", "author": { "name": "itayavtalyon", "key": "itayavtalyon", "displayName": "Itay Avtalyon", "active": true, "timeZone": "Asia/Jerusalem" }, "body": "var mainWindow = Ti.UI.createWindow({\n\t\theight: Ti.UI.FILL,\n\t\twidth: Ti.UI.FILL,\n\t\tfullscreen: true,\n\t\texitOnClose: true,\n\t\tnavBarHidden: true,\n\t\tbackgroundColor: '#000',\n\t\t\n\t});\n\nvar card = Ti.UI.createView({\n\t\theight: Ti.UI.FILL,\n\t\twidth: Ti.UI.FILL,\n\t\ttop: 0,\n\t\tleft: 0,\nbackgroundImage: '/images/card/background.png' \n\t});\nmainWindow.add(card);\n\nvar splash = Ti.UI.createView({\n\t\theight: Ti.UI.Fill,\n\t\twidth: Ti.UI.FILL,\n\t\tbackgroundImage: '/images/card/splash.png',\n\t\tzIndex: 100,\n\t\ttop: 0,\n\t\tleft: 0\n\t});\nmainWindow.add(splash);\n\nvar closeSplash = function () {\n\t\tself.animate({\n\t\t\topacity: 0,\n\t\t\tduration: 750\n\t\t}, function () {\n\t\t\tself.fireEvent('splash:close');\n\t\t});\n\t\tclearTimeout(timer);\n\t\ttimer = null;\n\t};\n\t\n\tvar timer = setTimeout(closeSplash, 5000);\n\n--------------------------------------------------\nThat's pretty much the code I used. The more I work on this project, I think it could have something to do with the emulator. I tried the same code with the iPhone simulator so I know there are no major errors there.\n\nThe app on the emulator keeps on crashing for some reason, so it may have something to do with the emulator on my machine (different variation of the code above where one the images is gone doesn't crash the app).\n", "updateAuthor": { "name": "itayavtalyon", "key": "itayavtalyon", "displayName": "Itay Avtalyon", "active": true, "timeZone": "Asia/Jerusalem" }, "created": "2012-11-28T08:57:37.000+0000", "updated": "2012-11-28T08:57:37.000+0000" }, { "id": "228810", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Almost there... What do you have defined as \"self\"?", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-28T10:41:17.000+0000", "updated": "2012-11-28T10:41:17.000+0000" }, { "id": "228812", "author": { "name": "itayavtalyon", "key": "itayavtalyon", "displayName": "Itay Avtalyon", "active": true, "timeZone": "Asia/Jerusalem" }, "body": "Ooops.... Sorry!\n\nself refers to the splash view. In the original code both views are Common.js modules, but only the splash view animates.\n\nThe event handler at the end of the animation executes the following commands:\nvar closeSplash = function () {\n\t\tmainWindow.remove(splash);\n\t\tsplash.removeEventListener('splash:close', closeSplash);\n\t\tsplash = null;\n\t\t\n\t};\n\t\n", "updateAuthor": { "name": "itayavtalyon", "key": "itayavtalyon", "displayName": "Itay Avtalyon", "active": true, "timeZone": "Asia/Jerusalem" }, "created": "2012-11-28T11:10:55.000+0000", "updated": "2012-11-28T11:10:55.000+0000" }, { "id": "228842", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I cannot reproduce this on Samsung Galaxy S2 2.3.6 TiSDK 2.1.2 GA, 2.1.3 GA, 2.1.4 GA or 3.0 CI.\n\nPlease state your TiSDK version, Android version and whether it's the device and/or simulator.\n\nCan you try the code I added under test case?", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-28T17:56:54.000+0000", "updated": "2012-11-28T17:56:54.000+0000" }, { "id": "229036", "author": { "name": "itayavtalyon", "key": "itayavtalyon", "displayName": "Itay Avtalyon", "active": true, "timeZone": "Asia/Jerusalem" }, "body": "I tried the test case in a new project and tested in the emulator and it worked (Titanuim SDK 3.1 build from source (a while back).\n\nThe errors I got were in the emulator. Only later when I relaize that the app on the emulator crashes a lot and for no apparent reason, I got a Samsung Galaxy 1 and to test on it and things started to work and not crash.\n\nPerhaps something is wrong the the project/emulator itself?", "updateAuthor": { "name": "itayavtalyon", "key": "itayavtalyon", "displayName": "Itay Avtalyon", "active": true, "timeZone": "Asia/Jerusalem" }, "created": "2012-11-29T12:06:06.000+0000", "updated": "2012-11-29T12:06:06.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }