{ "id": "85660", "key": "TIMOB-7459", "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": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2012-03-26T15:33:55.000+0000", "created": "2012-01-27T17:07:14.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [ { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" } ], "issuelinks": [ { "id": "14867", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "85704", "key": "TIMOB-7473", "fields": { "summary": "Android: Add Shadow (based on png image pattern) to a View ", "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": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-09T23:08:42.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h4. PROBLEM DESCRIPTION\r\nCustomer wants to get views with a smooth drop shadow. Customer wants to add a png image with a pattern, so that one will appear under the view.\r\n\r\nh4. EXTRA INFO \r\nRight now, they are using a workaround similar to this one:\r\n\r\n{code}\r\n//Create a view container \r\nvar container = Ti.UI.createView({\r\n width:200,\r\n height:200,\r\n top:10,\r\n left:10\r\n});\r\n\r\n//Create a drop shadow view\r\nvar shadow = Ti.UI.createView({\r\n width:195,\r\n height:195,\r\n right:0,\r\n bottom:0,\r\n borderRadius:5,\r\n opacity:0.5,\r\n backgroundColor:\"#787878\"\r\n});\r\ncontainer.add(shadow);\r\n//Create a view for our content\r\nvar content = Ti.UI.createView({\r\n width:195,\r\n height:195,\r\n top:0,\r\n left:0,\r\n borderRadius:5,\r\n backgroundColor:\"#cdcdcd\"\r\n});\r\ncontent.add(Ti.UI.createLabel({\r\n text:\"Here is some content\",\r\n textAlign:\"center\",\r\n color:\"#000\"\r\n}));\r\ncontainer.add(content);\r\n//Open an application window\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor:\"#fff\"\r\n}); \r\nwin.add(container); \r\nwin.open();\r\n{code} \r\n\r\nInstead of adding the container and the shadow, customer wants to have a special view with where you can set the png for the shadow, and a size for it. \r\n\r\nThe goal is having something like the attachment, but with any png. ", "attachment": [ { "id": "25391", "filename": "viewshadow.png", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2012-01-27T17:08:01.000+0000", "size": 148044, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: Add Shadow (based on png image pattern) to a View ", "creator": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "subtasks": [], "reporter": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "environment": "Mobile SDK 1.9CI\r\nMacOSX Lion\r\nTi Studio 1.0.7", "comment": { "comments": [ { "id": "182042", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We should get clarity on what, exactly, the customer needs. Because dynamic shadow-making like this gets expensive (read: Laggy on phones) VERY quickly. If he needs shadows of images he knows he'll be using, he really should prebake them into images instead.\r\n\r\nEven on pure-native solutions are shadows and gradients rarely computed, for exactly the reason of speed, performance, and memory. All of the gelcap-style translucent buttons, table row gradients, and rounded text entry borders Apple uses are prebaked png files, NOT computed at runtime.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-06T10:29:58.000+0000", "updated": "2012-02-06T10:29:58.000+0000" }, { "id": "182247", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Depending on usage, image size, etc, we're talking visible performance lag. In terms of memory, it means the difference between:\r\n\r\n* Load image, which may be memory mapped.\r\n* Create a new bitmap in memory.\r\n* Transfer image in memory, possibly only the alpha channel at best case scenario.\r\n* If they want it to be key-color based, this requires another pass over every pixel\r\n* If they want the shadow to be blurred, this requires significant processing.\r\n* Draw shadow image (probably another layer to maintain) offset.\r\n* Draw original image onscreen.\r\n* Repeat whenever the image changes, possibly.\r\n\r\nVersus pre-baking:\r\n* Load image, which may be memory mapped.\r\n* Draw image onscreen.\r\n\r\nIt is very likely that this will be the difference between a table view that scrolls smooth, and a table view that badly jitters.\r\n\r\n\r\nThe important take-away is that pre-baking gives you things that any implementation here would not provide outright. For example, pre-baking means you can have the shadow however you choose, complete with blurring and soft alphas, with NO performance hit.\r\n", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-07T12:42:10.000+0000", "updated": "2012-02-07T12:42:10.000+0000" }, { "id": "182331", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Moving it out of current sprint as it should be done at the application level.", "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-07T18:17:02.000+0000", "updated": "2012-02-07T18:17:02.000+0000" }, { "id": "188592", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Proposing we mark this invalid. The customer has a better option, thus removing the need.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-26T10:13:45.000+0000", "updated": "2012-03-26T10:13:45.000+0000" }, { "id": "410922", "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-09T23:08:42.000+0000", "updated": "2017-03-09T23:08:42.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }