{ "id": "175005", "key": "TIMOB-27895", "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": "20950", "name": "Release 9.1.0", "archived": false, "released": true, "releaseDate": "2020-08-25" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2020-07-07T16:52:17.000+0000", "created": "2020-05-10T07:48:27.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "updated": "2020-07-25T16:17:33.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" }, { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Titanium supports dark mode pretty okay, which is a great achievement! Unfortunately, there is one major issue when using it's API's right now: One has to fetch the colors via {{Ti.UI.fetchSemanticColor}} which does not work in Alloy (neither when styling in XML views nor in TSS styles). Users should create a mapping that fetches the color on the app start and write it to something more accessible like {{Alloy.CFG.styles.myColor}}. That is fine until you have 200+ colors that slow down the app launch by seconds (!) because all colors of the app need to be set before even shown\r\n\r\n*Suggestion*: Be able to pass semantic colors just like normal css colors, e.g.\r\n{code:js}\r\n'#myView': {\r\n backgroundColor: 'contentBackgroundColor'\r\n}\r\n{code}\r\nwhich works with just one line of code inside the color handling of iOS (WebColor.m) / Android (TiColorHelper.java). It will lead to a notable performance boost on both startup and view presentation, since we don't have to do any manual color matching anymore.\r\n", "attachment": [], "flagged": false, "summary": "TiAPI: Handle semantic colors (dark mode) without helper function", "creator": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "closedSprints": [ { "id": 1201, "state": "closed", "name": "2020 Sprint 14", "startDate": "2020-07-06T15:40:00.000Z", "endDate": "2020-07-17T15:40:00.000Z", "completeDate": "2020-07-20T22:16:28.367Z", "originBoardId": 114 }, { "id": 1196, "state": "closed", "name": "2020 Sprint 11", "startDate": "2020-05-26T15:56:00.000Z", "endDate": "2020-06-05T15:56:00.000Z", "completeDate": "2020-06-08T21:05:50.356Z", "originBoardId": 114 }, { "id": 1198, "state": "closed", "name": "2020 Sprint 12", "startDate": "2020-06-08T21:06:41.849Z", "endDate": "2020-06-19T21:06:00.000Z", "completeDate": "2020-06-19T15:54:38.493Z", "originBoardId": 114 }, { "id": 1199, "state": "closed", "name": "2020 Sprint 13", "startDate": "2020-06-19T16:41:04.099Z", "endDate": "2020-07-02T16:41:00.000Z", "completeDate": "2020-07-02T15:37:12.455Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "455423", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/11699\r\n\r\nExample:\r\n1. Create the color {{contentBackgroundColor}} in the semantic.colors.json:\r\n{code:json}\r\n{\r\n \"contentBackgroundColor\": {\r\n \"light\": \"#ff0000\",\r\n \"dark\": \"#0000ff\"\r\n }\r\n}\r\n{code}\r\n2. Add the following code snippet:\r\n{code:js}\r\nTi.UI.createWindow({\r\n backgroundColor: 'contentBackgroundColor'\r\n}).open();\r\n{code}\r\n3. Validate that the window is tinted in red for light mode and blue for dark mode.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-05-10T12:59:14.000+0000", "updated": "2020-05-10T12:59:14.000+0000" }, { "id": "455614", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "https://github.com/appcelerator/titanium_mobile/pull/11699", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2020-06-02T20:00:46.000+0000", "updated": "2020-06-02T20:00:46.000+0000" }, { "id": "456001", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged to master for 9.1.0 target", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2020-07-06T13:05:25.000+0000", "updated": "2020-07-06T13:05:25.000+0000" }, { "id": "456016", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.\r\n\r\nCan see the respective colors for the modes.\r\n\r\nStudio Ver: 6.0.0.202005141803\r\nSDK Ver: 9.1.0.v20200707075523\r\nOS Ver: 10.15.5\r\nXcode Ver: Xcode 11.5\r\nAppc NPM: 5.0.0\r\nAppc CLI: 8.0.0\r\nDaemon Ver: 3.2.0\r\nTi CLI Ver: 5.2.2\r\nAlloy Ver: 1.14.6\r\nNode Ver: 12.13.1\r\nNPM Ver: 6.12.1\r\nJava Ver: 11.0.6\r\nAndroid Devices: ⇨ google Pixel (Android 10)\r\nIOS Simulator: Iphone 11 Pro 13.5", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-07-07T16:51:29.000+0000", "updated": "2020-07-07T16:51:29.000+0000" }, { "id": "456017", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix in SDK 9.1.0.v20200707075523.\r\nClosing.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-07-07T16:52:10.000+0000", "updated": "2020-07-07T16:52:10.000+0000" }, { "id": "456234", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "using three character colors like\r\n\r\n{code}\r\n \"black\": {\r\n \"light\": \"#222\",\r\n \"dark\": \"#AAA\"\r\n }\r\n{code}\r\n\r\nwill be converted to\r\n{code}\r\n\t#000000\r\n{code}\r\ninside the \"/build/android/app/src/main/res/values/ti.semantic.colors.xml\" (and dark version). Rest works fine!", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-07-25T16:17:33.000+0000", "updated": "2020-07-25T16:17:33.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }