{ "id": "176044", "key": "TIMOB-28348", "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": [ { "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-16T14:13:08.000+0000", "created": "2021-02-10T20:32:33.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "alignment", "android", "label", "parity" ], "versions": [], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2021-02-16T14:13:18.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": "Currently there is no TEXT_ALIGNMENT_JUSTIFY for Android. This PR will add parity with iOS and allows the text to be justified.\r\n\r\n\r\nIt also adds the possibility to add features like TEXT_ALIGNMENT_JUSTIFY + last line right but I didn't include that in this PR to keep it simple and just add the iOS parity.\r\n\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: 'white',\r\n\tlayout: \"vertical\"\r\n});\r\nvar l = Ti.UI.createLabel({\r\n\tcolor: \"#000\",\r\n\tleft: 20,\r\n\tright: 20,\r\n\tborderWidth: 1,\r\n\tborderColor: \"#000\",\r\n\ttextAlign: Ti.UI.TEXT_ALIGNMENT_LEFT,\r\n\ttext: \"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate\"\r\n});\r\nvar l1 = Ti.UI.createLabel({\r\n\tcolor: \"#000\",\r\n\tleft: 20,\r\n\tright: 20,\r\n\tborderWidth: 1,\r\n\tborderColor: \"#000\",\r\n\ttextAlign: Ti.UI.TEXT_ALIGNMENT_CENTER,\r\n\ttext: \"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate\"\r\n});\r\nvar l2 = Ti.UI.createLabel({\r\n\tcolor: \"#000\",\r\n\tleft: 20,\r\n\tright: 20,\r\n\tborderWidth: 1,\r\n\tborderColor: \"#000\",\r\n\ttextAlign: Ti.UI.TEXT_ALIGNMENT_JUSTIFY,\r\n\ttext: \"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate\"\r\n});\r\nvar l3 = Ti.UI.createLabel({\r\n\tcolor: \"#000\",\r\n\tleft: 20,\r\n\tright: 20,\r\n\tborderWidth: 1,\r\n\tborderColor: \"#000\",\r\n\ttextAlign: Ti.UI.TEXT_ALIGNMENT_RIGHT,\r\n\ttext: \"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate\"\r\n});\r\nvar btn = Ti.UI.createButton({\r\n\ttitle: \"all left\"\r\n})\r\nvar toggle = false;\r\nbtn.addEventListener(\"click\", function() {\r\n\tif (toggle) {\r\n\t\tl.textAlign = Ti.UI.TEXT_ALIGNMENT_LEFT;\r\n\t\tl1.textAlign = Ti.UI.TEXT_ALIGNMENT_CENTER;\r\n\t\tl2.textAlign = Ti.UI.TEXT_ALIGNMENT_JUSTIFY;\r\n\t\tl3.textAlign = Ti.UI.TEXT_ALIGNMENT_RIGHT;\r\n\t} else {\r\n\t\tl.textAlign = Ti.UI.TEXT_ALIGNMENT_LEFT;\r\n\t\tl1.textAlign = Ti.UI.TEXT_ALIGNMENT_LEFT;\r\n\t\tl2.textAlign = Ti.UI.TEXT_ALIGNMENT_LEFT;\r\n\t\tl3.textAlign = Ti.UI.TEXT_ALIGNMENT_LEFT;\r\n\t}\r\n\ttoggle = !toggle;\r\n})\r\nwin.add([l, l1, l2, l3, btn]);\r\nwin.open();\r\nwin.addEventListener(\"open\", function() {\r\n\tconsole.log(l.textAlign);\r\n\tconsole.log(l1.textAlign);\r\n\tconsole.log(l2.textAlign);\r\n\tconsole.log(l3.textAlign);\r\n})\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: Add TEXT_ALIGNMENT_JUSTIFY support", "creator": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "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": "458220", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/12464", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2021-02-10T20:32:56.000+0000", "updated": "2021-02-10T20:32:56.000+0000" }, { "id": "458236", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed, waiting on Jenkins build. ", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-02-12T16:52:28.000+0000", "updated": "2021-02-12T16:52:28.000+0000" }, { "id": "458250", "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-16T14:13:18.000+0000", "updated": "2021-02-16T14:13:18.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }