{ "id": "155785", "key": "TIMOB-20586", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "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": "18414", "description": "", "name": "Release 6.2.0", "archived": false, "released": true, "releaseDate": "2017-09-13" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-08-15T21:36:13.000+0000", "created": "2016-03-16T22:26:36.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "parity" ], "versions": [ { "id": "16997", "name": "Release 5.2.0", "archived": false, "released": true, "releaseDate": "2016-02-23" } ], "issuelinks": [], "assignee": { "name": "fmerzadyan", "key": "fmerzadyan2", "displayName": "Frankie Merzadyan", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-08-18T23:59:22.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": "Behaviors for backgroundColor, image and gradient are different for Android and iOS.\r\nAndroid: 3 layers with color -> gradient -> image. Everything is bundled up and whatever is on top shows.\r\niOS: prioritize image over gradient over color, ultimately only displays one.\r\n\r\n", "attachment": [], "flagged": false, "summary": "Parity: backgroundColor, backgroundImage, backgroundGradient", "creator": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 920, "state": "closed", "name": "2017 Sprint 14 SDK", "startDate": "2017-07-02T16:29:41.455Z", "endDate": "2017-07-16T16:29:00.000Z", "completeDate": "2017-07-17T14:39:47.328Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "398629", "author": { "name": "fmerzadyan-OLD", "key": "fmerzadyan", "displayName": "Farzad Merzadyan", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~smohammed] can you verify?", "updateAuthor": { "name": "fmerzadyan-OLD", "key": "fmerzadyan", "displayName": "Farzad Merzadyan", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-10-11T22:18:01.000+0000", "updated": "2016-10-11T22:18:01.000+0000" }, { "id": "398630", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~fmerzadyan]\r\nNo error occurred with the code above.\r\n\r\nMac Version: 10.11.6\r\nXcode 8.0\r\nBuild version 8A218a\r\nAPPC CLI AND APPC NPM VERSION:\r\n{\"NPM\":\"4.2.7\",\"CLI\":\"5.5.1\"}\r\nAPPC TI CLI VERSION: 5.0.9\r\nAPPC ALLOY VERSION: 1.9.2\r\nNODE VERSION: v4.5.0\r\nSELECTED SDK VERSION:Selected :6.0.0.v20161005072811", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-10-11T22:28:55.000+0000", "updated": "2016-10-11T22:30:26.000+0000" }, { "id": "399415", "author": { "name": "fmerzadyan-OLD", "key": "fmerzadyan", "displayName": "Farzad Merzadyan", "active": false, "timeZone": "America/Los_Angeles" }, "body": "I think this *ticket is invalid* because user probably didn't put image file in a common folder such as studio-project-folder/Resources/assets folder which is located on the same level as android/ and iphone/ folders. Therefore the `backgroundImage` path to image was incorrect for one of the platforms. \r\n\r\nUse this to test:\r\n\r\n{code:JavaScript}\r\nvar window = Ti.UI.createWindow(\r\n { title: 'TIMOB-20586' }\r\n);\r\n//backgroundImage:\"images/back.jpg\" for android.\r\n//backgroundImage: \"back.jpg\" for ios.\r\n//common path is assets/images/back.jpg\r\nvar view = Ti.UI.createView({\r\n backgroundColor: 'yellow',\r\n backgroundGradient: {\r\n type: 'linear',\r\n startPoint:\r\n { x: '0%', y: '50%' }\r\n ,\r\n endPoint:\r\n { x: '100%', y: '50%' }\r\n ,\r\n colors: [\r\n { color: 'red', offset: 0.0}\r\n ,\r\n { color: 'blue', offset: 0.25 }\r\n ,\r\n { color: 'red', offset: 1.0 }\r\n ]\r\n },\r\n backgroundImage: 'assets/images/back.jpg'\r\n});\r\nwindow.add(view);\r\nwindow.open();\r\n//\r\ntry {\r\n\tvar file = Titanium.Filesystem.getFile(\"assets/images/back.jpg\");\r\n\tconsole.log(\"The file assets/images/back.jpg exists: \" + file.exists());\r\n} catch (err) {\r\n\tconsole.log(\"The file was not retrieved\");\r\n}\r\n{code}\r\n\r\nHowever backgroundImage does not load when using live view in Studio (from frequent file changes) which gives the impression that the layer rendering malfunctioned. However as you can see here in the console log underneath loading up a bitmap image is resource intensive and so OOM happens so backgroundImage is not loaded...\r\n\r\n{noformat}\r\n[WARN] : art: Throwing OutOfMemoryError \"Failed to allocate a 14745612 byte allocation with 13655792 free bytes and 13MB until OOM\"\r\n[DEBUG] : skia: --- decoder->decode returned false\r\n[ERROR] : TiUIHelper: (main) [59,746] Unable to load bitmap. Not enough memory: Failed to allocate a 14745612 byte allocation with 13655792 free bytes and 13MB until OOM\r\n[DEBUG] : Window: Checkpoint: postWindowCreated()\r\n[WARN] : EGL_emulation: eglSurfaceAttrib not implemented\r\n[WARN] : OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xe99bfc00, error=EGL_SUCCESS\r\n[ERROR] : Surface: getSlotFromBufferLocked: unknown buffer: 0xe7fb6a40\r\n[DEBUG] : Window: Window is closed normally.\r\n[ERROR] : Surface: getSlotFromBufferLocked: unknown buffer: 0xe7fb8640\r\n[INFO] : APSAnalyticsService: Analytics Service Started\r\n[INFO] : APSAnalyticsService: Stopping Analytics Service\r\n{noformat}\r\n", "updateAuthor": { "name": "fmerzadyan-OLD", "key": "fmerzadyan", "displayName": "Farzad Merzadyan", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-10-19T23:19:46.000+0000", "updated": "2016-10-19T23:36:47.000+0000" }, { "id": "399423", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Then most likely it's because the unit test was written incorrectly on https://github.com/appcelerator/titanium-mobile-mocha-suite/blob/master/Resources/ti.ui.view.test.js\r\nThis ticket was raised because of some failing unit tests here.\r\nWe can fix the unit test here so that it test for parity between android and ios.\r\nCheck out the FIXME comments, likely 1 of those is related to this ticket. Likely this one.\r\nhttps://github.com/appcelerator/titanium-mobile-mocha-suite/blob/master/Resources/ti.ui.view.test.js#L32\r\nright now that particular test is skipping for all 3 platforms. we want it to work for iOS and android, while skipping windows :)", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-10-20T03:08:48.000+0000", "updated": "2016-10-20T03:08:48.000+0000" }, { "id": "408179", "author": { "name": "fmerzadyan", "key": "fmerzadyan2", "displayName": "Frankie Merzadyan", "active": false, "timeZone": "America/Los_Angeles" }, "body": "titanium-mobile-mocha-suite master: https://github.com/appcelerator/titanium-mobile-mocha-suite/pull/16", "updateAuthor": { "name": "fmerzadyan", "key": "fmerzadyan2", "displayName": "Frankie Merzadyan", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-02-28T23:25:31.000+0000", "updated": "2017-02-28T23:25:31.000+0000" }, { "id": "426930", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-08-18T23:59:15.000+0000", "updated": "2017-08-18T23:59:15.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }