{ "id": "171234", "key": "TIMOB-25833", "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": [], "resolution": null, "resolutiondate": null, "created": "2018-03-02T19:54:27.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-03-03T02:23:17.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": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "1. Use the code below in your app.js:\r\n{code}\r\nvar win1 = Titanium.UI.createWindow({\r\n title:'Tab 1',\r\n backgroundColor:'#fff',\r\n layout: 'vertical'\r\n});\r\nvar radialGradient = Ti.UI.createView({\r\n top: 10,\r\n width: 100,\r\n height: 100,\r\n backgroundGradient: {\r\n type: 'radial',\r\n startPoint: { x: 50, y: 50 },\r\n endPoint: { x: 50, y: 50 },\r\n colors: [ 'red', 'blue'],\r\n startRadius: '50%',\r\n endRadius: 0,\r\n backfillStart: true\r\n }\r\n});\r\nwin1.add(radialGradient);\r\nwin1.open();\r\n{code}\r\n\r\n2. Build for android device.\r\n3. After the app launches you do not see the backgroundGradient.\r\n4. Change the startRadius to a number.\r\n5. Rebuild the app for the device.\r\n6. You see the backgroundGradient.\r\n\r\nWe need to support percent based radius for backgroundGradient.", "attachment": [], "flagged": false, "summary": "Android: Support percent based radius for android backgroundGradient", "creator": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Studio Ver: 5.0.0.201712081732\r\nSDK Ver: 7.1.0.v20180301114750\r\nOS Ver: 10.13.2\r\nXcode Ver: Xcode 9.2\r\nAppc NPM: 4.2.12\r\nAppc CLI: 7.0.2\r\nDaemon Ver: 1.0.1\r\nTi CLI Ver: 5.0.14\r\nAlloy Ver: 1.11.0\r\nNode Ver: 8.9.1\r\nNPM Ver: 5.5.1\r\nJava Ver: 1.8.0_101\r\nDevices: ⇨ google Nexus 6P --- Android 8.0.0\r\n ⇨ google Nexus 5 --- Android 6.0.1\r\n", "comment": { "comments": [ { "id": "435133", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Note that this is an undocumented feature in Titanium. Currently, {{startRadius}} and {{endRadius}} are documented to only support the {{Number}} type.\r\nhttp://docs.appcelerator.com/platform/latest/#!/api/Gradient-property-startRadius\r\n\r\nThe docs would need to be updated to indicate support for {{Number/String}}. We also need to clearly indicate what the percentage is relative to or make it settable.\r\n\r\n_*Edit:* The sample code documented here shows that {{startRadius}} supports a percentage string. This is the only documentation discrepancy I've found._\r\nhttp://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.View-property-backgroundGradient\r\n\r\nOn iOS, this percentage is relative to the distance from the center of the view to the corner. The way iOS is doing it (setting the radius to the view's corner) makes it impossible to draw a circle because it'll be clipped by the view's sides.\r\nhttps://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/TiGradient.m#L225\r\n\r\nThere are 2 major use-cases here:\r\n# Completely fill the view with a radial gradient effect. In this case, the percent should be relative to one of the corners like iOS is doing it now. {quote}sqrt(width^2, height^2) / 2{quote}\r\n# Draw a circle/ring that fills the view with transparency outside the circle. In this case, the percent should be relative to the shortest dimension. {quote}min(width, height) / 2{quote}\r\n\r\nWe may want to make this settable so that we can satisfy both cases above.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-03-02T20:32:14.000+0000", "updated": "2018-03-02T20:34:53.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }