{ "id": "167867", "key": "TIMOB-24735", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "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": "21050", "name": "Release 10.0.0", "archived": false, "released": true, "releaseDate": "2021-05-17" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2021-02-19T15:02:35.000+0000", "created": "2017-05-23T15:43:33.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "attributedString", "parity" ], "versions": [ { "id": "19333", "description": "Patch release for important items that did not make it into 6.0.3", "name": "Release 6.0.4", "archived": false, "released": true, "releaseDate": "2017-04-27" }, { "id": "19988", "description": "", "name": "Release 7.0.1", "archived": false, "released": true, "releaseDate": "2017-12-21" }, { "id": "20102", "name": "Release 7.1.1", "archived": false, "released": true, "releaseDate": "2018-05-02" } ], "issuelinks": [], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2021-02-19T15:02:45.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": [], "description": "*Problem description*\r\n\r\nWhen trying to change ATTRIBUTE_UNDERLINE_COLOR of a link AttributedString, on Android does not change anything, on iOS it is working.\r\n\r\nThis is a problem if you need to keep the link on a label but without the underline (just like ClickableSpan on native), on iOS just set the underline color to \"transparent\" works.\r\n\r\nThe attachment screenshots show how the second label on iOS has transparent color, while on Android it keeps the same color as the ATTRIBUTE_FOREGROUND_COLOR.\r\n\r\nTrying to not set the underline attribute also causes the same effect.\r\n\r\n*Steps to reproduce*\r\n\r\n1. Create a new mobile project classic titanium\r\n2. Add this code to app.js:\r\n\r\n\r\n{code:java}\r\nvar win = Ti.UI.createWindow({\r\n\tlayout : 'vertical'\r\n});\r\n\r\nwin.add(createLabel());\r\n\r\nvar lbl = createLabel();\r\ncolorLinks(lbl.attributedString);\r\nwin.add(lbl);\r\n\r\nwin.open();\r\n\r\nfunction createLabel() {\r\n\r\n\tvar label = Ti.UI.createLabel({\r\n\t\ttop : 50,\r\n\t\tattributedString : Ti.UI.createAttributedString({\r\n\t\t\ttext : 'Check out the Appcelerator Developer Portal',\r\n\t\t\tattributes : [{\r\n\t\t\t\ttype : Ti.UI.ATTRIBUTE_LINK,\r\n\t\t\t\tvalue : 'https://developer.appcelerator.com',\r\n\t\t\t\trange : [14, 29]\r\n\t\t\t}]\r\n\t\t})\r\n\t});\r\n\r\n\tlabel.addEventListener('link', function(e) {\r\n\t\tTi.Platform.openURL(e.url);\r\n\t});\r\n\r\n\treturn label;\r\n}\r\n\r\nfunction colorLinks(as) {\r\n\tvar colorText = '#CD1625';\r\n\t//var colorUnderline = \"#FFFFFF\";\r\n\tvar colorUnderline = \"transparent\";\r\n\r\n\tas.attributes.forEach(function(attribute) {\r\n\r\n\t\tif (attribute.type === Ti.UI.ATTRIBUTE_LINK) {\r\n\r\n\t\t\tas.addAttribute({\r\n\t\t\t\ttype : Ti.UI.ATTRIBUTE_FOREGROUND_COLOR,\r\n\t\t\t\tvalue : colorText,\r\n\t\t\t\trange : attribute.range\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t// This is not working on Android\r\n\t\t\tas.addAttribute({\r\n\t\t\t\ttype : Ti.UI.ATTRIBUTE_UNDERLINE_COLOR,\r\n\t\t\t\tvalue : colorUnderline,\r\n\t\t\t\trange : attribute.range\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n\r\n\treturn as;\r\n}\r\n\r\n{code}\r\n\r\n\r\n3. Run in a device or simulator\r\n\r\n*Actual results*\r\n\r\nAndroid does not change the color of the link, it just takes the default link color or the ATTRIBUTE_FOREGROUND_COLOR\r\n\r\n*Expected results*\r\n\r\nBeing able to change underline color of the links or just keep the link without any underline, like CSS text-decoration property.", "attachment": [ { "id": "62273", "filename": "screenshot-2017-05-23_17.37.09.918.png", "author": { "name": "pperuga", "key": "pperuga", "displayName": "Patricia Peruga", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-05-23T15:37:54.000+0000", "size": 59047, "mimeType": "image/png" }, { "id": "62274", "filename": "Simulator Screen Shot 23 May 2017, 17.35.45.png", "author": { "name": "pperuga", "key": "pperuga", "displayName": "Patricia Peruga", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-05-23T15:36:13.000+0000", "size": 46697, "mimeType": "image/png" } ], "flagged": false, "summary": "Android: AttributedString link underline color ", "creator": { "name": "pperuga", "key": "pperuga", "displayName": "Patricia Peruga", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "pperuga", "key": "pperuga", "displayName": "Patricia Peruga", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "1. MacOS Sierra 10.12\r\n2. Appcelerator Studio, build: 4.8.1.201612050850\r\n3. Titanium SDK: 6.0.4\r\n4. Titanium CLI version: 5.0.12\r\n5. Xcode 6.1", "closedSprints": [ { "id": 1217, "state": "closed", "name": "2021 Sprint 4", "startDate": "2021-02-16T00:52:00.000Z", "endDate": "2021-02-27T00:52:00.000Z", "completeDate": "2021-02-28T18:56:28.465Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "420456", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "I can reproduce the issue for Android. Tested with SDK 6.0.4.GA.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-05-25T18:29:37.000+0000", "updated": "2017-05-25T18:29:37.000+0000" }, { "id": "433209", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "Same for 7.0.1.GA\r\nHere is a short example on how to add color in an Android app: https://stackoverflow.com/a/43584166/5193915\r\nShould work in Ti too (place to add it: https://github.com/appcelerator/titanium_mobile/blob/b758504ce898d0e93e461849cbb8975283da85bc/android/modules/ui/src/java/ti/modules/titanium/ui/AttributedStringProxy.java#L202)", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-01-16T20:01:42.000+0000", "updated": "2018-01-16T20:01:42.000+0000" }, { "id": "438131", "author": { "name": "icecandyent", "key": "icecandyent", "displayName": "Simon Buckingham", "active": true, "timeZone": "Europe/London" }, "body": "I have the same problem. \r\ntesting in Ti SDK 7.1.1 GA.\r\nWith Android 4.3 and 7.1.", "updateAuthor": { "name": "icecandyent", "key": "icecandyent", "displayName": "Simon Buckingham", "active": true, "timeZone": "Europe/London" }, "created": "2018-06-05T17:26:01.000+0000", "updated": "2018-06-05T17:26:01.000+0000" }, { "id": "458148", "author": { "name": "ssaddique", "key": "ssaddique", "displayName": "Sohail Saddique", "active": true, "timeZone": "Europe/London" }, "body": "Issue still exists today, under 9.3.1.GA.", "updateAuthor": { "name": "ssaddique", "key": "ssaddique", "displayName": "Sohail Saddique", "active": true, "timeZone": "Europe/London" }, "created": "2021-02-03T14:59:46.000+0000", "updated": "2021-02-03T14:59:46.000+0000" }, { "id": "458238", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master: https://github.com/appcelerator/titanium_mobile/pull/12471", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-02-12T18:00:08.000+0000", "updated": "2021-02-12T18:00:08.000+0000" }, { "id": "458258", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.\r\nWaiting for Jenkins build.", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-02-17T20:55:43.000+0000", "updated": "2021-02-17T20:55:43.000+0000" }, { "id": "458279", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged to master for 10.0.0 target", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2021-02-19T15:02:45.000+0000", "updated": "2021-02-19T15:02:45.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }