{ "id": "170906", "key": "TIMOB-25926", "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": [], "resolution": null, "resolutiondate": null, "created": "2018-01-22T16:39:04.000+0000", "priority": null, "labels": [ "7.0.1", "engReviewed", "padding", "sdk-7.0.0" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2019-05-21T16:57:45.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": [], "description": "\r\n241/5000\r\nThe settings of the \"padding\" property (top, bottom, left, right) in the TextFields are not applied in the SDK 7.0.1. In SDK 6.3.0, the style is applied correctly.\r\n\r\nI enclose two screenshots of the same code in SDK 6.3.0 and SDK 7.0.1.\r\n\r\nThe code for the TextField style into .tss file.\r\n\r\n{code:java}\r\n\"#field_input\": {\r\n\twidth: \"100%\",\r\n\theight: 28,\r\n\ttop: 0,\r\n\ttextAlign: \"center\",\r\n\tbackgroundColor: \"transparent\",\r\n\tcolor: \"#FFFFFF\",\r\n\tfont: {\r\n\t\tfontFamily: \"Roboto\",\r\n\t\tfontSize: 14\r\n\t},\r\n\tpaddingLeft: 0,\r\n\tpaddingRight: 0,\r\n\tpadding: {\r\n\t\ttop: 0,\r\n\t\tbottom: 0,\r\n\t\tleft: 0,\r\n\t\tright: 0\r\n\t},\r\n\tborderWidth: 1, borderColor: \"#F0F\"\r\n}\r\n{code}\r\n", "attachment": [ { "id": "64722", "filename": "SDK_6.3.0.png", "author": { "name": "sandrolain", "key": "sandrolain", "displayName": "Sandro Lain", "active": true, "timeZone": "Europe/Rome" }, "created": "2018-01-22T16:36:48.000+0000", "size": 114032, "mimeType": "image/png" }, { "id": "64721", "filename": "SDK_7.0.1.png", "author": { "name": "sandrolain", "key": "sandrolain", "displayName": "Sandro Lain", "active": true, "timeZone": "Europe/Rome" }, "created": "2018-01-22T16:36:48.000+0000", "size": 106031, "mimeType": "image/png" } ], "flagged": false, "summary": "Android TextField padding not applied with SDK 7.0.1", "creator": { "name": "sandrolain", "key": "sandrolain", "displayName": "Sandro Lain", "active": true, "timeZone": "Europe/Rome" }, "subtasks": [], "reporter": { "name": "sandrolain", "key": "sandrolain", "displayName": "Sandro Lain", "active": true, "timeZone": "Europe/Rome" }, "environment": "Operating System\r\n Name = Mac OS X\r\n Version = 10.12.6\r\n Architecture = 64bit\r\n # CPUs = 8\r\n Memory = 8589934592\r\nNode.js\r\n Node.js Version = 8.9.3\r\n npm Version = 5.5.1\r\nTitanium CLI\r\n CLI Version = 5.0.14\r\nTitanium SDK\r\n SDK Version = 7.0.1.GA", "comment": { "comments": [ { "id": "433498", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2018-01-23T07:10:27.000+0000", "updated": "2018-01-23T07:10:27.000+0000" }, { "id": "433648", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello [~sandrolain], I see your Textfield height is hard-coded to 28. Which isn't a good idea since font size is hard-coded too. This makes a bad assumption about the OS theme that is applied to the TextField and what decoration might be applied.\r\n\r\nTry changing the TextField's \"height\" to Ti.UI.SIZE.\r\n\r\nI have tested this and it's working fine. Thanks. ", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2018-01-25T06:22:46.000+0000", "updated": "2018-01-25T06:22:46.000+0000" }, { "id": "433651", "author": { "name": "sandrolain", "key": "sandrolain", "displayName": "Sandro Lain", "active": true, "timeZone": "Europe/Rome" }, "body": "Thanks, it was one of my tests and in other works I did so, but unfortunately for this application the graphics have been defined by a third company paid by my client, and I have to respect the proportions of the UI that I have been given.", "updateAuthor": { "name": "sandrolain", "key": "sandrolain", "displayName": "Sandro Lain", "active": true, "timeZone": "Europe/Rome" }, "created": "2018-01-25T07:01:00.000+0000", "updated": "2018-01-25T07:01:00.000+0000" }, { "id": "433985", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~sandrolain], I don't consider this a bug. Let me explain...\r\n\r\nIn Titanium 7.0.0, we switched to using Google's newest material themed TextFields and TextAreas. These updated UI views from Google have more space above and below the editable area to make room for a top hint text, bottom underline, and bottom description text. Have a look at Google's \"Input text\" section and note that they've added \"8dp\" of *+internal+* padding above and below the editable field. This is not the same as the outer padding you're setting. (There's a picture showing this in the link below.)\r\nhttps://material.io/guidelines/components/text-fields.html#text-fields-layout\r\n\r\nSo, the issue here is that your code is making a bad assumption about the space needed for the theme and UI decorations around the TextField, which is a portability issue between platforms and even different themes on the same platform (such as Android). You should never set both the TextField height and font size. Ideally, you should always the TextField height to Ti.UI.SIZE and it'll always correctly size to just-fit the field's contents and custom font you give it.\r\n\r\nNote that this is why Titanium offers vertical and horizontal layout features and the ability to auto-size UI. This is needed to display UI correctly between differently platforms and system themes. This is probably not the answer you want to hear, but it is a portable future-proof solution.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-02-02T23:32:10.000+0000", "updated": "2018-02-02T23:32:10.000+0000" }, { "id": "434052", "author": { "name": "sandrolain", "key": "sandrolain", "displayName": "Sandro Lain", "active": true, "timeZone": "Europe/Rome" }, "body": "Hi, I have now done to make the adaptive height of the text field without specifying a fixed, as recommended, but if it were possible to specify a height as on iOS I could meet the rules of UI indicated by my client.\r\n\r\nThe documentation indicates that on Android SDK 6.0.0 is available the property \"padding\" as for iOS, and actually in SDK 6.x.x I have already used it without problems.\r\nIt should be reimplemented into SDK Android to respects it, or update the documentation indicating that with 7.x is no longer supported.\r\n\r\nhttp://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TextField-property-padding", "updateAuthor": { "name": "sandrolain", "key": "sandrolain", "displayName": "Sandro Lain", "active": true, "timeZone": "Europe/Rome" }, "created": "2018-02-05T16:12:33.000+0000", "updated": "2018-02-05T16:12:33.000+0000" }, { "id": "434061", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~sandrolain], the \"padding\" feature does work on Android, but it's an external padding. If you set it to something large such as...\r\n{code:javascript}\r\n{ top: 50, left: 50, bottom: 50, right: 50 }\r\n{code}\r\n\r\n...then you'll see that the above works. The issue is that Google's material themed TextFields also has an internal padding now that is separate from the external padding. If you look at the \"material\" theme guide I showed you, you can see this. That's the change here.\r\n\r\nIf you're not willing to use Ti.UI.SIZE, then I recommend that you set the fontSize smaller on Android.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-02-05T19:19:56.000+0000", "updated": "2018-02-05T19:19:56.000+0000" }, { "id": "434349", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "[~sandrolain], Did you manage to try the recommended steps?", "updateAuthor": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2018-02-12T08:07:00.000+0000", "updated": "2018-02-12T08:07:00.000+0000" }, { "id": "434351", "author": { "name": "sandrolain", "key": "sandrolain", "displayName": "Sandro Lain", "active": true, "timeZone": "Europe/Rome" }, "body": "Hi, I used height = Ti.UI.SIZE on android and it works as expected, but at the moment it does not solve the problem because from my client's graphic studio I have very specific dimensions, padding and font-size directives that I can not ignore", "updateAuthor": { "name": "sandrolain", "key": "sandrolain", "displayName": "Sandro Lain", "active": true, "timeZone": "Europe/Rome" }, "created": "2018-02-12T08:17:47.000+0000", "updated": "2018-02-12T08:17:47.000+0000" }, { "id": "436639", "author": { "name": "bimmel-defective", "key": "bimmel", "displayName": "(deactived) Brian Immel", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~topener], What is that minimum padding number? 50?\r\n\r\nShould I include the following in https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TextField-property-padding\r\n\"Android sets it's own minimum padding automatically. If you attempt to set anything below 50, it will not be reflected in your app.\"", "updateAuthor": { "name": "bimmel-defective", "key": "bimmel", "displayName": "(deactived) Brian Immel", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2018-04-09T15:49:21.000+0000", "updated": "2018-04-09T15:49:21.000+0000" }, { "id": "436695", "author": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~bimmel] 50 is too big. [~jquick] can probably answer that question", "updateAuthor": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-04-10T08:43:39.000+0000", "updated": "2018-04-10T08:43:39.000+0000" }, { "id": "436732", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Let's punt on this.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-10T22:00:27.000+0000", "updated": "2018-04-10T22:00:27.000+0000" }, { "id": "439399", "author": { "name": "Kerbooo", "key": "kerbooo", "displayName": "Kerberos", "active": true, "timeZone": "Europe/Istanbul" }, "body": "Yes I have same problem too. ", "updateAuthor": { "name": "Kerbooo", "key": "kerbooo", "displayName": "Kerberos", "active": true, "timeZone": "Europe/Istanbul" }, "created": "2018-07-22T22:03:17.000+0000", "updated": "2018-07-22T22:03:17.000+0000" } ], "maxResults": 27, "total": 27, "startAt": 0 } } }