{ "id": "108450", "key": "TIMOB-12398", "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": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2018-12-12T15:34:48.000+0000", "created": "2013-01-23T20:09:06.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [ { "id": "14164", "description": "Release 3.0.2", "name": "Release 3.0.2", "archived": true, "released": true, "releaseDate": "2013-02-19" }, { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "issuelinks": [ { "id": "25116", "type": { "id": "10000", "name": "Blocks", "inward": "is blocked by", "outward": "blocks" }, "outwardIssue": { "id": "108587", "key": "TIDOC-996", "fields": { "summary": "APIDoc: Update TabGroup docs to list activity as property", "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": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true } } } }, { "id": "56891", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "172171", "key": "TIMOB-26354", "fields": { "summary": "Android: Refactor TabGroup and introduce new style", "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": null, "updated": "2018-12-12T15:34:53.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": "With Windows, it's possible to create menus before opening the window, by assigning Window.activity.onCreateOptionsMenu.\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n fullscreen: true\r\n});\r\n\r\nvar activity = win.activity;\r\n\r\nactivity.onCreateOptionsMenu = function(e){\r\n var menu = e.menu;\r\n var menuItem = menu.add({ title: \"Item 1\" });\r\n menuItem.icon = \"item1.png\";\r\n menuItem.addEventListener(\"click\", function(e) {\r\n Ti.API.debug(\"I was clicked\");\r\n });\r\n};\r\n\r\nwin.open();\r\n{code}\r\n\r\nFor a TabGroup, although TabGroup.activity is now exposed, you cannot assign an onCreateOptionsMenu function until after the TabGroup is opened. The following code demonstrates the issue:\r\n\r\n{code}\r\nvar tabGroup = Titanium.UI.createTabGroup();\r\n\r\nvar win1 = Titanium.UI.createWindow({\r\n\ttitle : 'Tab 1',\r\n\tbackgroundColor : '#fff'\r\n});\r\nvar tab1 = Titanium.UI.createTab({\r\n\ticon : 'KS_nav_views.png',\r\n\ttitle : 'Tab 1',\r\n\twindow : win1\r\n});\r\nvar addMenu = function() {\r\n\ttabGroup.activity.onCreateOptionsMenu = function(e) {\r\n\t\tvar menu = e.menu;\r\n\t\tvar menuItem = menu.add({\r\n\t\t\ttitle : \"Item 1\"\r\n\t\t});\r\n\t\tmenuItem.icon = \"item1.png\";\r\n\t\tmenuItem.addEventListener(\"click\", function(e) {\r\n\t\t\tTi.API.debug(\"I was clicked\");\r\n\t\t});\r\n\t};\r\n}\r\naddMenu(); // To work around issue, comment out this line and \r\n // uncomment the addEventListener call below.\r\n/*\r\ntabGroup.addEventListener(\"open\", function() {\r\n\taddMenu();\r\n\ttabGroup.activity.invalidateOptionsMenu();\r\n});\r\n*/\r\ntabGroup.addTab(tab1);\r\ntabGroup.open();\r\n{code}\r\n\r\nAs written, it doesn't add a menu item. If you comment out the standalone addMenu call and uncomment the addEventListener call, the menu item is added as expected.\r\n\r\nExpected Results:\r\n\r\nMenu item is added as on a Window, without needing to add an open event listener or call invalidateOptionsMenu.\r\n", "attachment": [], "flagged": false, "summary": "Android: TabGroup activity should work like Window activity", "creator": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Ti SDK 3.0.2.v20130123110204.\r\nAndroid 4.0.3 emulator.", "closedSprints": [ { "id": 1103, "state": "closed", "name": "2018 Sprint 25", "startDate": "2018-12-02T16:29:21.531Z", "endDate": "2018-12-16T16:29:00.000Z", "completeDate": "2018-12-15T02:33:24.870Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "242441", "author": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Issue reproduces with\r\n\r\nTitanium Studio, build: 3.0.1.201212181159\r\nTitanium SDK version: 3.1.0 (03/11/13 15:43 0c88429)\r\nTitanium SDK version: 3.0.2 (02/07/13 16:46 a4def81)\r\nDevice: Samsung galaxy s duos Android version: 4.0.4\r\n\r\njithinpv\r\n", "updateAuthor": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-15T12:43:56.000+0000", "updated": "2013-03-15T12:55:30.000+0000" }, { "id": "442353", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "I can't reproduce the issue with 7.0.0.GA.", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2018-10-05T15:32:43.000+0000", "updated": "2018-10-05T15:32:43.000+0000" }, { "id": "444557", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket. Unable to reproduce using SDK version {{8.0.0.v20181212023313}}", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-12-12T15:34:48.000+0000", "updated": "2018-12-12T15:34:48.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }