{ "id": "171233", "key": "TIMOB-25832", "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": "20432", "name": "Release 8.0.1", "archived": false, "released": true, "releaseDate": "2019-05-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2019-04-25T10:28:10.000+0000", "created": "2018-03-02T19:45:01.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "SearchBar", "android", "hintText", "regression" ], "versions": [ { "id": "17609", "description": "", "name": "Release 7.0.0", "archived": false, "released": true, "releaseDate": "2017-12-07" } ], "issuelinks": [ { "id": "57488", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "173214", "key": "TIMOB-26911", "fields": { "summary": "Crash log analysis when the app goes into the background.", "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": "None", "id": "6" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2019-04-25T10:28:10.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\nAssigning a string to {{Ti.UI.SearchBar}} property \"hintText\" after it has been created will cause a crash on Android as of Titanium 7.0.0.\r\n\r\n*Steps to reproduce:*\r\n# Build and run the below code on Android.\r\n# Notice the app crashes on startup.\r\n\r\n{code:javascript}\r\nvar window = Ti.UI.createWindow();\r\nvar searchBar = Ti.UI.createSearchBar({\r\n\tbarColor: \"white\",\r\n\ttop: 0,\r\n\twidth: Ti.UI.FILL,\r\n\theight: \"50dp\",\r\n});\r\nwindow.add(searchBar);\r\nwindow.add(Ti.UI.createLabel({ text: \"SearchBar Test\" }));\r\nwindow.addEventListener(\"open\", function(e) {\r\n\tsearchBar.hintText = \"Hint Text\";\r\n});\r\nwindow.open();\r\n{code}\r\n\r\n*Recommended Fix:*\r\nWhen Titanium's \"TiUIText.java\" class reads property {{PROPERTY_HINT_TYPE}} via {{TiConvert.toInt()}}, the code needs to set the default value to {{UIModule.HINT_TYPE_STATIC}} in the following places in the code.\r\n[TiUIText.java#L350|https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIText.java#L350]\r\n[TiUIText.java#L924|https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIText.java#L924]\r\n\r\n*Work-Around 1:*\r\nSet the \"hintText\" property when creating the {{SearchBar}}, but never afterwards.\r\n{code:javascript}\r\nvar searchBar = Ti.UI.createSearchBar({\r\n\thintText: \"Hint Text\",\r\n});\r\n{code}\r\n\r\n*Work-Around 2:*\r\nSet {{SearchBar}} property \"hintType\" to {{Ti.UI.HINT_TYPE_STATIC}}. This is an undocumented feature of {{SearchBar}} but it supports on Android since it internally uses {{Ti.UI.TextField}} within the {{SearchBar}}.\r\n{code:javascript}\r\nvar window = Ti.UI.createWindow();\r\nvar searchBar = Ti.UI.createSearchBar({\r\n\thintType: Ti.UI.HINT_TYPE_STATIC, // <- This works-around the issue.\r\n});\r\nwindow.add(searchBar);\r\nwindow.addEventListener(\"open\", function() {\r\n\tsearchBar.hintText = \"Hint Text\";\r\n});\r\nwindow.open();\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: Setting Ti.UI.SearchBar \"hintText\" property after creation causes a crash as of 7.0.0", "creator": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Studio Ver: 5.0.0.201712081732\r\nSDK Ver: 7.1.0.v20180301114750\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", "comment": { "comments": [ { "id": "447679", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/10848\r\nPR (8.0.x): https://github.com/appcelerator/titanium_mobile/pull/10849", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-04-13T01:53:17.000+0000", "updated": "2019-04-13T01:53:17.000+0000" }, { "id": "447920", "author": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "body": "FR Passed. PR merged.", "updateAuthor": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-04-23T20:44:47.000+0000", "updated": "2019-04-23T20:44:47.000+0000" }, { "id": "447941", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket, fix verified in SDK version {{8.1.0.v20190423134840}} and SDK version {{8.0.1.v20190423123234}}. \r\n\r\nTest and other information can be found at: \r\nPR (master): https://github.com/appcelerator/titanium_mobile/pull/10848\r\nPR (8.0.x): https://github.com/appcelerator/titanium_mobile/pull/10849", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-04-25T10:28:05.000+0000", "updated": "2019-04-25T10:28:05.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }