{ "id": "171287", "key": "TIMOB-25855", "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": "20238", "description": "", "name": "Release 7.5.0", "archived": false, "released": true, "releaseDate": "2018-11-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-06-27T19:09:40.000+0000", "created": "2018-03-11T12:45:54.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "textfield" ], "versions": [ { "id": "20060", "description": "", "name": "Release 7.0.2", "archived": false, "released": true, "releaseDate": "2018-02-09" } ], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-09-06T13:02:37.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": "Add the possibility to set the properties {{lines}} and {{maxLines}} at a TextField.\r\n* https://developer.android.com/reference/android/widget/TextView.html#attr_android:lines\r\n* https://developer.android.com/reference/android/widget/TextView.html#attr_android:maxLines\r\n\r\nThe TextField will start with the {{lines}} amount of lines and will be extended to {{maxLines}} when pressing the Return key.\r\n\r\n{code:java}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: '#fff'\r\n});\r\n\r\nvar tf = Ti.UI.createTextArea({\r\n\tlines: 1,\r\n\tmaxLines: 5,\r\n\tborderColor: \"#000\",\r\n\tborderWidth: 1,\r\n\tcolor: \"#000\",\r\n\twidth: 200,\r\n\ttop: 10,\r\n})\r\n\r\nwin.add(tf);\r\n\r\nvar tf2 = Ti.UI.createTextArea({\r\n\tlines: 2,\r\n\tmaxLines: 2,\r\n\tborderColor: \"#000\",\r\n\tborderWidth: 1,\r\n\tcolor: \"#000\",\r\n\twidth: 200,\r\n\tbottom: 10\r\n})\r\n\r\nwin.add(tf);\r\nwin.add(tf2);\r\nwin.open();\r\n{code}", "attachment": [ { "id": "64953", "filename": "lines_maxLines.mp4", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-03-11T12:52:24.000+0000", "size": 286464, "mimeType": "video/mp4" } ], "flagged": false, "summary": "Android: Add TextArea lines and maxLines 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": 1045, "state": "closed", "name": "2018 Sprint 13 SDK", "startDate": "2018-06-17T20:47:13.621Z", "endDate": "2018-07-01T20:47:00.000Z", "completeDate": "2018-07-02T18:40:05.029Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "435459", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/9927", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-03-11T12:48:19.000+0000", "updated": "2018-03-11T12:48:19.000+0000" }, { "id": "435477", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "We need to add parity for this first. But as its a feature request with low number of general interest so far, I would not consider it for an early next version so far.\r\n\r\n*EDIT*: It seems like iOS does [not support this natively|https://stackoverflow.com/questions/5225763/limit-the-number-of-lines-for-uitextview]. There seems to be a [workaround|https://stackoverflow.com/a/22814446/5537752] which could be tried out, but I feel it mike be error prone for all the use cases we have.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-03-12T11:50:38.000+0000", "updated": "2018-03-12T11:54:55.000+0000" }, { "id": "435491", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "No problem. It was requested by a user on Stackoverflow because it is the default behaviour inside Whatsapp (Android) when you write a message (lines: 1, maxLines: 5).", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-03-12T16:28:56.000+0000", "updated": "2018-03-12T16:28:56.000+0000" }, { "id": "435697", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "Extended example: \r\n{code:java}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: '#fff',\r\n\t\r\n});\r\n\r\nvar sv = Ti.UI.createScrollView({\r\n\tlayout:\"vertical\",\r\n\theight:Ti.UI.FILL\r\n})\r\n\r\nvar tf1 = Ti.UI.createTextArea({\r\n\tborderColor: \"#000\",\r\n\tborderWidth: 1,\r\n\tcolor: \"#000\",\r\n\twidth: 200,\r\n\thintText:\"1 to 5\",\r\n\thintTextColor:\"#999\",\r\n\tlines: 1,\r\n\tmaxLines: 5,\r\n\t\r\n})\r\n\r\nvar tf2 = Ti.UI.createTextArea({\r\n\tlines: 2,\r\n\tmaxLines: 2,\r\n\tborderColor: \"#000\",\r\n\tborderWidth: 1,\r\n\tcolor: \"#000\",\r\n\twidth: 200,\r\n\thintText:\"2 to 2 -> setting lines to 4\",\r\n\thintTextColor:\"#999\"\r\n});\r\ntf2.lines = 4;\r\n\r\n\r\nvar tf3 = Ti.UI.createTextArea({\r\n\tlines: 2,\r\n\tmaxLines: 2,\r\n\tborderColor: \"#000\",\r\n\tborderWidth: 1,\r\n\tcolor: \"#000\",\r\n\twidth: 200,\r\n\thintText:\"2 to 2\",\r\n\thintTextColor:\"#999\"\r\n});\r\ntf3.maxLines = 2;\r\n\r\nvar tf4 = Ti.UI.createTextArea({\r\n\tlines: 2,\r\n\tmaxLines: 2,\r\n\tborderColor: \"#000\",\r\n\tborderWidth: 1,\r\n\tcolor: \"#000\",\r\n\twidth: 200,\r\n\thintText:\"2 to 2 -> setting max to 4\",\r\n\thintTextColor:\"#999\"\r\n});\r\ntf4.maxLines = 4;\r\n\r\nvar textField1 = Ti.UI.createTextField({\r\n\tborderColor: \"#000\",\r\n\tborderWidth: 1,\r\n\tcolor: \"#000\",\r\n\twidth: 200,\r\n\thintText:\"Textfield\",\r\n\thintTextColor:\"#999\"\r\n});\r\n\r\nvar lbl1 = Ti.UI.createLabel({\r\n\tcolor:\"#000\",\r\n\tbottom: 10,\r\n\ttext:\"one line\"\r\n});\r\nvar lbl2 = Ti.UI.createLabel({\r\n\tcolor:\"#000\",\r\n\tbottom: 10,\r\n\ttext:\"two\\nline\"\r\n});\r\nvar lbl3 = Ti.UI.createLabel({\r\n\tcolor:\"#000\",\r\n\tbottom: 10,\r\n\ttext:\"max 3 multi\\n1 multi\\n2 multi\\n3 multi\\n4 multi\\nmulti\\nline\",\r\n\tmaxLines: 3\r\n});\r\nvar lbl4 = Ti.UI.createLabel({\r\n\tcolor:\"#000\",\r\n\tbottom: 10,\r\n\ttext:\"line 2 multi\\n1 multi\\n2 multi\\n3 multi\\n4 multi\\nmulti\\nline\",\r\n\tlines: 2\r\n});\r\nwin.add(sv);\r\nsv.add(tf1);\r\nsv.add(tf2);\r\nsv.add(tf3);\r\nsv.add(tf4);\r\nsv.add(textField1);\r\nsv.add(lbl1);\r\nsv.add(lbl2);\r\nsv.add(lbl3);\r\nsv.add(lbl4);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-03-18T12:35:17.000+0000", "updated": "2018-03-18T12:35:17.000+0000" }, { "id": "435731", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~hknoechel], internally, Google's Android code is calculating based on line height as well, plus decoration and padding size. So, it's probably not all that far off than that iOS work-around code.\r\n\r\nAlso, setting the Android TextArea's height via {{setLines()}} is much more common than setting it to an arbitrary pixel/dp size. The reason is because native Android developers can't make assumptions about the default font size used by the system. Especially with forked Android OSes that don't follow the rules.\r\n\r\nI agree. We want iOS parity. I'm okay with us pushing this feature out and releasing it simultaneously with iOS support.\r\n\r\nAnd I don't know if we \"need\" {{setMaxLines()}} support. That feature is more useful for labels than TextAreas (it'll auto-show ellipsis when going beyond maxLines). It's easy enough to add to Android, but I don't think we need it on iOS. Thoughts?", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-03-19T20:43:23.000+0000", "updated": "2018-03-19T20:43:23.000+0000" }, { "id": "441380", "author": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "body": "*Closing ticket.*\r\n\r\nText area lines and maxLines can now be set, verified using the example above. \r\n\r\nThe feature is present in SDK:\r\n\r\n{noformat}\r\n7.5.0.v20180904155047\r\n{noformat}\r\n\r\n*ENV*\r\n\r\n{noformat}\r\nPixel 2 XL (9.0)\r\nEmulator (8.1, 7.1.1)\r\nAppc NPM: 4.2.13\r\nAppc CLI: 7.0.6\r\nTi CLI: 5.1.1\r\nNode: 8.9.4\r\nNPM: 6.3.0\r\n{noformat}\r\n", "updateAuthor": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "created": "2018-09-06T13:01:52.000+0000", "updated": "2018-09-06T13:02:30.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }