{ "id": "170990", "key": "TIMOB-25730", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "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": "19957", "description": "", "name": "Release 7.1.0", "archived": false, "released": true, "releaseDate": "2018-03-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-01-27T09:12:02.000+0000", "created": "2018-01-26T23:15:17.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "SearchBar", "android" ], "versions": [], "issuelinks": [ { "id": "56276", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "98930", "key": "TIMOB-10368", "fields": { "summary": "iOS: Implement support for custom color/hintTextColor in SearchBar", "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": "Low", "id": "4" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-03-02T00:00:43.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": "*Summary:*\r\nAdd the ability to set the text color and hint text color of a \"Ti.UI.SearchBar\" on Android\r\nThe Android \"Ti.UI.SearchBar\" supports undocumented properties \"color\" and \"hintTextColor\" for changing its text field colors. However, these properties can only be set upon creation. We should allow these properties to be set dynamically.\r\n\r\nThis is especially needed for parity since we're adding this feature on iOS via [TIMOB-10368].\r\n\r\n*Note:*\r\nWe plan on adding a similar feature to Android's \"SearchView\" in 7.1.0. See: [TIMOB-25668]\r\n\r\n*Test Code:*\r\nOnce this feature has been implemented, verify that the SearchBar's hint text color is \"blue\" and the entered text is \"red\".\r\n\r\n{code:javascript}\r\nvar window = Ti.UI.createWindow();\r\nvar searchBar = Ti.UI.createSearchBar(\r\n{\r\n\tbarColor: \"white\",\r\n\thintText: \"Hint Text...\",\r\n});\r\nwindow.addEventListener(\"open\", function(e) {\r\n\tvar dialog = Ti.UI.createAlertDialog(\r\n\t{\r\n\t\tmessage: \"Show SearchBar in...\",\r\n\t\tbuttonNames: [\"Window\", \"ListView\", \"TableView\"],\r\n\t});\r\n\tdialog.addEventListener(\"click\", function(e) {\r\n\t\tsearchBar.color = \"red\";\r\n\t\tsearchBar.hintTextColor = \"blue\";\r\n\t\tswitch (e.index) {\r\n\t\t\tcase 0:\r\n\t\t\t\tsearchBar.top = 0;\r\n\t\t\t\tsearchBar.left = 0;\r\n\t\t\t\tsearchBar.width = Ti.UI.FILL;\r\n\t\t\t\tsearchBar.height = \"50dp\";\r\n\t\t\t\twindow.add(searchBar);\r\n\t\t\t\twindow.add(Ti.UI.createLabel({ text: \"Window\" }));\r\n\t\t\t\tbreak;\r\n\t\t\tcase 1:\r\n\t\t\t\tvar listView = Ti.UI.createListView(\r\n\t\t\t\t{\r\n\t\t\t\t\tsearchView: searchBar,\r\n\t\t\t\t\tsections: [Ti.UI.createListSection({ headerTitle: \"ListView\" })],\r\n\t\t\t\t\twidth: Ti.UI.FILL,\r\n\t\t\t\t\theight: Ti.UI.FILL,\r\n\t\t\t\t});\r\n\t\t\t\twindow.add(listView);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\tvar tableView = Ti.UI.createTableView(\r\n\t\t\t\t{\r\n\t\t\t\t\tsearch: searchBar,\r\n\t\t\t\t\tdata: [Ti.UI.createTableViewRow({ title: \"TableView\" })],\r\n\t\t\t\t\twidth: Ti.UI.FILL,\r\n\t\t\t\t\theight: Ti.UI.FILL,\r\n\t\t\t\t});\r\n\t\t\t\twindow.add(tableView);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\tdialog.show();\r\n});\r\nwindow.open();\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: Allow SearchBar \"color\" and \"hintTextColor\" properties to be set dynamically", "creator": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 1000, "state": "closed", "name": "2018 Sprint 04 SDK", "startDate": "2018-02-12T04:23:01.913Z", "endDate": "2018-02-26T04:23:00.000Z", "completeDate": "2018-02-26T19:36:01.769Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "433746", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "It turns out this feature was already inadvertently implemented on Android. It just wasn't documented.\r\n\r\nTitanium's SearchBar on Android inherits the features supported by TextField as can be seen in the link below. Note that \"TiUISearchBar\" inherits from \"TiUIText\".\r\nhttps://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/widget/searchbar/TiUISearchBar.java#L33\r\n\r\nHowever, these 2 properties cannot be set dynamically. They can only be set upon creation. I'm changing this JIRA case to reflect this.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-01-27T02:21:46.000+0000", "updated": "2018-01-27T02:37:18.000+0000" }, { "id": "433748", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/9775", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-01-27T03:00:21.000+0000", "updated": "2018-01-27T03:00:21.000+0000" }, { "id": "435082", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix in SDK 7.1.0.v20180301114750 & 7.2.0.v20180301081409.\r\n\r\nClosing.\r\n\r\nStudio Ver: 5.0.0.201712081732\r\nOS Ver: 10.13.2\r\nXcode Ver: Xcode 9.2\r\nAppc NPM: 4.2.12\r\nAppc CLI: 7.0.2\r\nDaemon Ver: 1.0.1\r\nTi CLI Ver: 5.0.14\r\nAlloy Ver: 1.11.0\r\nNode Ver: 8.9.1\r\nNPM Ver: 5.5.1\r\nJava Ver: 1.8.0_101\r\nDevices: ⇨ google Nexus 6P — Android 8.0.0\r\n⇨ google Nexus 5 — Android 6.0.1\r\n\r\n", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-03-02T00:00:38.000+0000", "updated": "2018-03-02T00:00:38.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }