{ "id": "168842", "key": "TIMOB-24940", "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": "18414", "description": "", "name": "Release 6.2.0", "archived": false, "released": true, "releaseDate": "2017-09-13" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-08-25T22:34:53.000+0000", "created": "2017-07-06T12:02:48.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "merge-6.2.0" ], "versions": [], "issuelinks": [], "assignee": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "updated": "2017-08-28T17:51:36.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": [], "description": "Happens on x86 emulators with Android API 16 or 17.\r\nWhen calling a timed out methods of Toolbar the application restarts after a native 'corrupted stack' error is logged.\r\n\r\nApplication's theme must be set to Theme.Titanium for this example to work.\r\nAdd the following in the tag in tiapp.xml:\r\n\r\n{code:xml}\r\n \r\n \r\n \r\n \r\n \r\n{code}\r\n\r\n*Steps to reproduce:*\r\n1. Run the application.\r\n2. Click on the \"Button\" button once.\r\n3. Wait 3-4 seconds after the overflow menu is shown.\r\n\r\nh2. Test case:\r\n\r\n{code:java}\r\nvar window = Ti.UI.createWindow();\r\n\r\nvar toolbar = Ti.UI.createToolbar({\r\n extendBackground: false,\r\n barColor: 'blue',\r\n width: Ti.UI.FILL,\r\n top: 0,\r\n logo: 'logo.png',\r\n overflowIcon: 'git.png',\r\n navigationIcon: 'logo2.jpg'\r\n});\r\n\r\nvar button = Ti.UI.createButton({\r\n title: 'Button',\r\n right: 10,\r\n top: 0\r\n});\r\n\r\nbutton.addEventListener('click', function(e) {\r\n Ti.API.info('BackgroundColor is ' + toolbar.getBackgroundColor());\r\n Ti.API.info('Title is ' + toolbar.getTitle());\r\n Ti.API.info('Subtitle is ' + toolbar.getSubtitle());\r\n Ti.API.info('Logo is ' + JSON.stringify(toolbar.getLogo()));\r\n Ti.API.info('Overflow icon is ' + JSON.stringify(toolbar.getOverflowIcon()));\r\n Ti.API.info('Navigation icon is ' + JSON.stringify(toolbar.getNavigationIcon()));\r\n \r\n toolbar.showOverflowMenu();\r\n \r\n setTimeout(function() {\r\n Ti.API.info('Is overflow menu showed? - ' + toolbar.isOverflowMenuShowing());\r\n \r\n toolbar.hideOverflowMenu();\r\n toolbar.setLogo('logo2.jpg');\r\n toolbar.setNavigationIcon('git.png');\r\n toolbar.setOverflowIcon('logo.png');\r\n toolbar.collapseActionView();\r\n toolbar.dismissPopupMenus();\r\n toolbar.setBarColor('red');\r\n toolbar.setTitle('New Title');\r\n toolbar.setTitleTextColor('orange');\r\n toolbar.setSubtitle('New Subtitle');\r\n toolbar.setSubtitleTextColor('blue');\r\n \r\n Ti.API.info('Content inset end is ' + toolbar.getContentInsetEnd());\r\n Ti.API.info('Content inset end with actions is ' + toolbar.getContentInsetEndWithActions());\r\n Ti.API.info('Content inset left is ' + toolbar.getContentInsetLeft());\r\n Ti.API.info('Content inset right is ' + toolbar.getContentInsetRight());\r\n Ti.API.info('Content inset start is ' + toolbar.getContentInsetStart());\r\n Ti.API.info('Content inset start with navigation is ' + toolbar.getContentInsetStartWithNavigation());\r\n }, 3000);\r\n});\r\n\r\nwindow.add(toolbar);\r\n\r\nwindow.activity.onCreateOptionsMenu = function(e) {\r\n var menu = e.menu;\r\n \r\n var menuItem = menu.add({\r\n title: 'Item 1',\r\n showAsAction: Ti.Android.SHOW_AS_ACTION_NEVER\r\n });\r\n \r\n menuItem.addEventListener('click', function(e) {\r\n Ti.API.debug('Item 1 was clicked');\r\n });\r\n \r\n var menuItem2 = menu.add({\r\n title: 'Item 2',\r\n showAsAction: Ti.Android.SHOW_AS_ACTION_NEVER\r\n });\r\n \r\n var menuItem3 = menu.add({\r\n title: 'Item 3',\r\n showAsAction: Ti.Android.SHOW_AS_ACTION_NEVER\r\n });\r\n \r\n var menuItem4 = menu.add({\r\n title: 'Item 4',\r\n showAsAction: Ti.Android.SHOW_AS_ACTION_NEVER\r\n });\r\n};\r\n\r\nwindow.activity.supportToolbar = toolbar;\r\n\r\nvar picker = Ti.UI.createPicker();\r\n\r\nvar data = [];\r\ndata[0]=Ti.UI.createPickerRow({title:'Bananas'});\r\ndata[1]=Ti.UI.createPickerRow({title:'Strawberries'});\r\ndata[2]=Ti.UI.createPickerRow({title:'Mangos'});\r\ndata[3]=Ti.UI.createPickerRow({title:'Grapes'});\r\n\r\npicker.add(data);\r\ntoolbar.setItems([picker,button]);\r\nwindow.addEventListener('open', function() {\r\n window.activity.setSupportActionBar(toolbar);\r\n toolbar.setBarColor('blue');\r\n toolbar.setTitle('Title');\r\n toolbar.setTitleTextColor('red');\r\n toolbar.setSubtitle('Subtitle');\r\n toolbar.setSubtitleTextColor('green'); \r\n toolbar.setContentInsetEndWithActions(10);\r\n toolbar.setContentInsetStartWithNavigation(11);\r\n toolbar.setContentInsetsAbsolute(12,12);\r\n toolbar.setContentInsetsRelative(13, 13);\r\n});\r\n\r\nwindow.open();\r\n{code}\r\n\r\n\r\n", "attachment": [], "flagged": false, "summary": "Android: Problem with setTimeout and Toolbar on API 16/17", "creator": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "subtasks": [], "reporter": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "environment": "OS: Windows 10\r\nEmulators: Nexus 5 API 16 x86, Nexus 5 API 17 x86", "comment": { "comments": [ { "id": "423573", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/9196", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2017-07-06T13:01:21.000+0000", "updated": "2017-07-06T13:01:21.000+0000" }, { "id": "427191", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~ybanev] Can you please provide backport to 6.2.0 for this ticket?", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-08-24T17:56:58.000+0000", "updated": "2017-08-24T17:56:58.000+0000" }, { "id": "427238", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "6_2_X: https://github.com/appcelerator/titanium_mobile/pull/9358", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2017-08-25T08:09:40.000+0000", "updated": "2017-08-25T08:09:40.000+0000" }, { "id": "427269", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR passed. PR merged. Changes are seen in SDK's:\r\n6.2.0.v20170827172423\r\n7.0.0.v20170828071347", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-08-25T22:34:47.000+0000", "updated": "2017-08-28T17:51:25.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }