{ "id": "143421", "key": "TIMOB-18433", "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": "16593", "description": "Release 4.0.0", "name": "Release 4.0.0", "archived": false, "released": true, "releaseDate": "2015-05-21" }, { "id": "16723", "description": "Windows Platform Support, ListView updates, Vector overlays in maps", "name": "Release 4.1.0", "archived": false, "released": true, "releaseDate": "2015-07-08" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-03-11T21:23:34.000+0000", "created": "2015-01-23T00:13:58.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "qe-4.0.0", "regression" ], "versions": [ { "id": "16593", "description": "Release 4.0.0", "name": "Release 4.0.0", "archived": false, "released": true, "releaseDate": "2015-05-21" } ], "issuelinks": [ { "id": "47668", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "147644", "key": "TIMOB-18884", "fields": { "summary": "Android: hintText does not display", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "updated": "2015-05-11T20:24:41.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": "h5.Description\r\n\r\nWhen using the code below the hint text of a text field is not shown when the background color is set to white, if another background color such as black is used then it is possible to see the hint text. \r\n\r\nI believe this *is a regression* as this only occurs in 3.6.0 versions of the SDK, 3.5.1 and 3.5.0.GA SDKs do not show this behavior, the hint text can be seen fine using these. \r\n\r\nIt *does not occur* on iOS.\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({backgroundColor: '#fff'});\r\nvar text = \"Can you see me?\";\r\nvar text1 = Ti.UI.createTextField({hintText: 'Can you see me',color:'#000',top: 10,});\r\nvar text2 = Ti.UI.createTextField({hintText: 'Can you see me',color:'#000',top: 50,});\r\nwin.add(text1);\r\nwin.add(text2);\r\nwin.open();\r\n{code}\r\n\r\nh5.Steps To Reproduce\r\n\r\n1. Using the provided code build to a device with a 3.6.0 SDK selected.\r\n\r\nh5.Actual Result\r\n\r\nThe hint text of the text fields will not be displayed\r\n\r\nh5.Expected Result\r\n\r\nThe hint text should be displayed", "attachment": [ { "id": "53777", "filename": "3.5.0HintText.png", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2015-01-23T00:13:58.000+0000", "size": 33585, "mimeType": "image/png" }, { "id": "53778", "filename": "3.6.0HintText.png", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2015-01-23T00:13:58.000+0000", "size": 16371, "mimeType": "image/png" } ], "flagged": false, "summary": "Android: Text field hint text is not visible on a white background", "creator": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "subtasks": [], "reporter": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "environment": "Mac OSX 10.10.1\r\nAppcelerator Studio, build: 3.4.1.201410281743\r\nTitanium SDK build: 3.6.0.v20150121141730\r\nTitanium CLI, build: 3.4.1\r\nAlloy: 1.5.1\r\nAndroid Build tools 21.1.1\r\nNote 2 (4.3), Galaxy s4 (4.4.4), Nexus 4 (4.4.4), Galaxy Ace (4.4.2), Nexus 6 (5.0.1)", "closedSprints": [ { "id": 356, "state": "closed", "name": "2015 Sprint 05 SDK", "startDate": "2015-02-28T15:50:08.527Z", "endDate": "2015-03-14T00:00:00.000Z", "completeDate": "2015-03-14T13:54:50.695Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "344741", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "Seems to be a theme issue.\r\n\r\nIn tiapp.xml, if I replace the android xml portion from:-\r\n\r\n\r\n\r\nto:-\r\n\r\n \r\n \r\n \r\n \r\n \r\n\r\nIt will work.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-03-02T04:27:37.000+0000", "updated": "2015-03-02T04:51:50.000+0000" }, { "id": "344749", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/6676\r\n\r\n-In the mean time, if you do want a fix just edit the tiapp.xml file as mentioned in the previous comment.-\r\n\r\nOpen further investigation, this would actually change the whole theme. This might not be the right answer to this.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-03-02T06:42:03.000+0000", "updated": "2015-03-02T07:26:13.000+0000" }, { "id": "344764", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "This seems to be also how it behaves in a native app when the parent layout of the edittext has \"android:background=\"#ffffff\". \r\n\r\nI think the best solution would be to expose http://developer.android.com/reference/android/widget/TextView.html#setHintTextColor(int) which I will proceed to do.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-03-02T08:40:57.000+0000", "updated": "2015-03-02T08:40:57.000+0000" }, { "id": "345030", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~hpham]: Could I get you thoughts on this?\r\n\r\nHere's what I've found out so far. Using `Ti.UI.createTextArea` and `Ti.UI.createTextField` on a white background will cause the hint text to not be visible. This is due to the default theme being `Theme.AppCompat`. \r\n\r\nThe default behavior on a native app sets the background to something dark. Hence, hint text is visible. When using the same theme in a native app on a white background, the hint text as well as the under line that tells you it is a EditText is not visible. Thus, this seems to be a native behavior.\r\n\r\nIf you edit the tiapp.xml with the following:-\r\n{code}\r\n\r\n \r\n \t\r\n \t\r\n\r\n{code}\r\n\r\nIt will use the light theme which uses a white background and the underline of each EditText as well as hint text is visible. \r\n\r\nConversely is true as well. Using the Theme.AppCompat.Light.DarkActionBar on a black background will cause the hint text and underline to be not visible.\r\n\r\nSolution Suggestion:-\r\n1) If using a white background, advice users to edit the tiapp.xml as above. If using a black background, users can remain using the default theme Theme.AppCompat.\r\n2) https://github.com/appcelerator/titanium_mobile/commit/c739c3b4f712a031e4f55ae4ec9348ae9d2bf0d9 will be available and users can use Attributed Hint Strings to style the hints how they want it to be. The caveat is the underline to show that the edit text is there wont be visible still on a white background.\r\n3) Expose setHint. This actually wont change the underline color. Similar to number 2.\r\n\r\nI think number 1 should be the answer. The downside to doing that is that everything will also follow that style. Eg, creating Buttons and not styling it will result the button to follow the new theme. I don't think this is too much of a downside.\r\n\r\nAnd if anyone else have thoughts on this, please comment on this as well.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-03-04T08:26:40.000+0000", "updated": "2015-03-04T08:26:40.000+0000" }, { "id": "345031", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "Another suggestion:\r\n4)\r\nStyles (Themes) can only be applied to View before it is inflated if it is in the xml. So, we could create 2 layouts for EditText. One using the light theme, another using the dark theme, here: https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/res/layout/titanium_ui_edittext.xml\r\n\r\nThen, in the createTextArea/createTextField, we can create one more new attribute deciding which theme a user wants to use. Then on create, inflate https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIText.java#L96. \r\n\r\nThe only missing puzzle to using this method is that this has to be done in the constructor (in TiUIText) due to the inflating of the View (EditText), and the attributes are only read later (as far as I know right now) in the processProperties method. You can't get it in the constructor. ", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-03-04T08:43:53.000+0000", "updated": "2015-03-04T08:43:53.000+0000" }, { "id": "345244", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~eharris]\r\n\r\nI think I've concluded that the best way is actually to specify the correct theme to use initially.\r\nIf you are planning to use a white background on the windows:-\r\nPlease edit the tiapp.xml with either of this:-\r\n{code}\r\n\r\n\r\n\r\n\r\n\r\n{code}\r\n\r\nor\r\n\r\n{code}\r\n\r\n\r\n\r\n\r\n\r\n{code}\r\n\r\nThe default theme that the app is running is Theme.AppCompat which is for a dark theme with black background.\r\n\r\nIf you do want to change the color of the hint text, you can use https://github.com/appcelerator/titanium_mobile/commit/c739c3b4f712a031e4f55ae4ec9348ae9d2bf0d9 Attributed Hint Text.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-03-06T04:12:03.000+0000", "updated": "2015-03-06T04:12:03.000+0000" }, { "id": "345511", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~hpham] for review: PR https://github.com/appcelerator/titanium_mobile/pull/6676. \r\n\r\nThere are 3 ways to solve this issue:-\r\n1) Change your theme as mentioned above\r\n2) Use the new hint text color property that is exposed in the PR\r\n3) Use attributed text hint that will be available in the future\r\n\r\nTest case for PR:-\r\n{code}\r\nvar win = Ti.UI.createWindow({backgroundColor: '#fff'});\r\nvar text = \"Can you see me?\";\r\nvar text1 = Ti.UI.createTextField({hintText: 'Can you see me', hintTextColor:'#0FF', color:'#000',top: 10,});\r\nvar text2 = Ti.UI.createTextField({hintText: 'Can you see me', hintTextColor:'#FF0', color:'#000',top: 50,});\r\nwin.add(text1);\r\nwin.add(text2);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-03-10T03:21:35.000+0000", "updated": "2015-03-10T03:21:35.000+0000" }, { "id": "345840", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~hpham] could you please backport this?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-03-12T16:37:08.000+0000", "updated": "2015-03-12T16:37:08.000+0000" }, { "id": "346825", "author": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "body": "4_0_X backport: https://github.com/appcelerator/titanium_mobile/pull/6741", "updateAuthor": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-03-21T00:59:47.000+0000", "updated": "2015-03-21T00:59:47.000+0000" }, { "id": "347187", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed using:\r\n\r\nTitanium SDK 4.0.0.v20150323131014\r\nStudio 4.0.0.201503231407\r\nAppc NPM: 0.3.34\r\nAppc CLI 0.2.187\r\n\r\nOn: Nexus 5 emulator, Android 4.4.2", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-03-24T22:33:15.000+0000", "updated": "2015-03-24T22:33:15.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }