{ "id": "104947", "key": "TIMOB-11766", "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": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" }, { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "14619", "description": "2012 Sprint 23 Core", "name": "2012 Sprint 23 Core", "archived": true, "released": true, "releaseDate": "2012-11-19" }, { "id": "14623", "description": "2012 Sprint 23 JS", "name": "2012 Sprint 23", "archived": true, "released": true, "releaseDate": "2012-11-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-08-15T22:25:07.000+0000", "created": "2012-11-14T14:10:12.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "3.0", "SDK", "module_actionbar", "qe-automation", "qe-port", "triage" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [ { "id": "22902", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "105105", "key": "TIMOB-11796", "fields": { "summary": "Android: ActionBar not getting set on Tab windows", "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": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "22892", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "105115", "key": "TIDOC-900", "fields": { "summary": "Add activity property to tabgroup for android", "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": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-08-15T22:25:07.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": "I found two issues with the latest ActionGroup code changes:\r\n\r\n1. Documentation: Ti.UI.TabGroup needs to reflect that you can get the \"activity\" property. I had to dig in the source to find out that TabGroupProxy extends WindowProxy under the covers to figure that out.\r\n\r\n2. \"title\" property for ActionBar does not do anything when the ActionBar is displayed with a TabGroup. Create a new project with the proper min-sdk setting, and use this code in app.js:\r\n\r\n{code}\r\nvar tabs = Ti.UI.createTabGroup();\r\n\r\nvar win1 = Ti.UI.createWindow({\r\n\ttitle:\"Window 1\",\r\n\tbackgroundColor:'#f00',\r\n});\r\nvar tab1 = Ti.UI.createTab({\r\n\ttitle:\"Win 1\",\r\n\twindow:win1,\r\n});\r\n\r\ntabs.addTab(tab1);\r\n\r\nvar win2 = Ti.UI.createWindow({\r\n\ttitle:\"Window Dos\",\r\n\tbackgroundColor:'#fff',\r\n});\r\nvar tab2 = Ti.UI.createTab({\r\n\ttitle:\"Win 2\",\r\n\twindow:win2,\r\n});\r\n\r\ntabs.addTab(tab2);\r\n\r\ntabs.addEventListener('focus', function(e) {\r\n\tvar actionBar = tabs.getActivity().actionBar; // \"activity\" is an undocumented Android property for TabGroup\r\n\tif (actionBar) {\r\n\t\tactionBar.setDisplayHomeAsUp(true); // works\r\n\t\tactionBar.onHomeIconItemSelected = function() { // works\r\n\t\t\talert('actionBar hides for 5 seconds');\r\n\t\t\tactionBar.hide(); // works\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tactionBar.show(); // works\r\n\t\t\t},5000);\r\n\t\t}\r\n//\t\tactionBar.setTitle(e.tab.window.title); // title never appears\r\n\t\tactionBar.setTitle('TEST'); // hard-coded text just to be sure\r\n\t}\r\n});\r\n\r\ntabs.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "ActionBar issues with TabGroup", "creator": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "environment": "Android 4.2, TiSDK 3.0CI", "comment": { "comments": [ { "id": "227426", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The docs probably need to be updated, since this mostly likely changed as a result of the new action bar stuff with tabgroups.\n\nAs for the title not working, we might need to handle the tabgroups differently since it's a split action bar.", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-15T01:21:07.000+0000", "updated": "2012-11-15T01:21:07.000+0000" }, { "id": "227648", "author": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "body": "Allen,\r\n\r\nI think you used the wrong term. The split action bar puts action buttons on the bottom instead of the upper-right: http://developer.android.com/guide/topics/ui/actionbar.html#SplitBar", "updateAuthor": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "created": "2012-11-16T05:10:03.000+0000", "updated": "2012-11-16T05:10:03.000+0000" }, { "id": "227650", "author": { "name": "igorsantos07", "key": "igorsantos07", "displayName": "Igor Santos", "active": true, "timeZone": "America/Sao_Paulo" }, "body": "I've noticed that tabGroup.getActivity() and tabGroup.activeTab.window.getActivity() return different items. The first one was not triggering onCreateOptionsMenu, while the second works fine for creating menu entries.", "updateAuthor": { "name": "igorsantos07", "key": "igorsantos07", "displayName": "Igor Santos", "active": true, "timeZone": "America/Sao_Paulo" }, "created": "2012-11-16T05:58:11.000+0000", "updated": "2012-11-16T05:58:11.000+0000" }, { "id": "227657", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Yeah, I meant stacked action bar. Anyways, it looks like the showTitle display option was false for some reason, so I resolved it in this PR:\n\nhttps://github.com/appcelerator/titanium_mobile/pull/3434", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-16T08:06:35.000+0000", "updated": "2012-11-16T08:06:35.000+0000" }, { "id": "227658", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Igor tabGroup.activeTab.window actually points to the window proxy that you passed into the creation args. So in the example above, if you did tabGroup.activeTab.window, it will actually point to either win1 or win2 depending on which tab is active. Since the win1/win2 is a lightweight window, the window is most likely bound to the root activity of the app.\n\nThe tabgroup itself is a different proxy and will create another activity. As a result the two activities will be different. It's probably a good idea to just use tabGroup.getActivity().", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-16T08:16:34.000+0000", "updated": "2012-11-16T08:16:34.000+0000" }, { "id": "227659", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-16T08:25:22.000+0000", "updated": "2012-11-16T08:25:22.000+0000" }, { "id": "227707", "author": { "name": "igorsantos07", "key": "igorsantos07", "displayName": "Igor Santos", "active": true, "timeZone": "America/Sao_Paulo" }, "body": "Thanks for the explanation, Allen!", "updateAuthor": { "name": "igorsantos07", "key": "igorsantos07", "displayName": "Igor Santos", "active": true, "timeZone": "America/Sao_Paulo" }, "created": "2012-11-16T18:01:06.000+0000", "updated": "2012-11-16T18:01:06.000+0000" }, { "id": "227736", "author": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Allen,\n\nAs noted, we need to resolve the discrepancy because Josh's original changes used the _window's_ activity for attaching the options menu. I think he did this because we'd never documented an activity property on TabGroup.\n\nHaving to use one activity to access the action bar and a different one to access the action items doesn't make any sense. So it's not just a documentation problem.\n", "updateAuthor": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-16T21:05:08.000+0000", "updated": "2012-11-16T21:05:08.000+0000" }, { "id": "227748", "author": { "name": "igorsantos07", "key": "igorsantos07", "displayName": "Igor Santos", "active": true, "timeZone": "America/Sao_Paulo" }, "body": " sorry if I'm just messing around here, but wouldn't it make sense if tab.window.activity refer to tabGroup.getActivity() too? so we can access the same object from inside each window (and is probably what the dev would be looking for)", "updateAuthor": { "name": "igorsantos07", "key": "igorsantos07", "displayName": "Igor Santos", "active": true, "timeZone": "America/Sao_Paulo" }, "created": "2012-11-16T21:56:04.000+0000", "updated": "2012-11-16T21:56:04.000+0000" }, { "id": "227784", "author": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "body": "Igor,\r\n\r\nI see your point of view about tab.window.activity/tabgroup.activity, but the issue is that each is a mapping to the actual Android Activity object that it's really tied to. That needs to remain accurate for many reasons that have nothing to do with the ActionBar.", "updateAuthor": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "created": "2012-11-17T00:05:19.000+0000", "updated": "2012-11-17T00:05:19.000+0000" }, { "id": "227807", "author": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "body": "Since this was such a simple change to a new feature, shouldn't it be backported to 3.0?", "updateAuthor": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "created": "2012-11-17T01:24:37.000+0000", "updated": "2012-11-17T01:24:37.000+0000" }, { "id": "227814", "author": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Shannon,\n\nThe merge-3.0.0 tag in the labels field means exactly that--it's due to be backported. This missed the 3.0 beta 2 cutoff, so it'll probably be backported next week. ", "updateAuthor": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-17T02:02:36.000+0000", "updated": "2012-11-17T02:02:36.000+0000" }, { "id": "228318", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "3_0_X PR https://github.com/appcelerator/titanium_mobile/pull/3469", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-21T23:24:47.000+0000", "updated": "2012-11-21T23:24:47.000+0000" }, { "id": "229877", "author": { "name": "tsmolich", "key": "tsmolich", "displayName": "Tamila Smolich", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as fixed. Tested on: \r\nTitanium Studio, build: 3.0.0.201211301903\r\nTitanium SDK, builds: 3.0.0.v20121130200208; 3.1.0.v20121203181001\r\nDevices: Samsung Galaxy S III (4.0.4)", "updateAuthor": { "name": "tsmolich", "key": "tsmolich", "displayName": "Tamila Smolich", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-04T18:43:48.000+0000", "updated": "2012-12-04T18:43:48.000+0000" }, { "id": "231014", "author": { "name": "igorsantos07", "key": "igorsantos07", "displayName": "Igor Santos", "active": true, "timeZone": "America/Sao_Paulo" }, "body": "I have two questions from a newbie about this:\r\n\r\n1. Should I be able to get the activity using {{myTabGroup.activity}}? I can only access it through {{myTabGroup.getActivity()}}\r\n2. Would it be reasonable to ask for a {{title}} property for the TabGroup? It makes little sense for me to change the title of the TabGroup through the activity, while normal windows don't need it.", "updateAuthor": { "name": "igorsantos07", "key": "igorsantos07", "displayName": "Igor Santos", "active": true, "timeZone": "America/Sao_Paulo" }, "created": "2012-12-12T08:41:30.000+0000", "updated": "2012-12-12T08:41:30.000+0000" }, { "id": "231041", "author": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Igor,\n\nUnfortunately, the fix to expose TabGroup.activity has not been merged yet, so I think it's missed the cut for 3.0 GA but it should be in 3.0.1. So use getActivity for now.\n\nBe sure to watch the related ticket, TIMOB-11796, if you want to be updated when the fix gets in.\n", "updateAuthor": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-12T17:53:24.000+0000", "updated": "2012-12-12T17:53:24.000+0000" }, { "id": "231093", "author": { "name": "igorsantos07", "key": "igorsantos07", "displayName": "Igor Santos", "active": true, "timeZone": "America/Sao_Paulo" }, "body": "I'm watching it already, thanks!\r\n\r\nAnd how about the title issue?\r\n\r\n{quote}\r\nWould it be reasonable to ask for a title property for the TabGroup? It makes little sense for me to change the title of the TabGroup through the activity, while normal windows don't need it.\r\n{quote}", "updateAuthor": { "name": "igorsantos07", "key": "igorsantos07", "displayName": "Igor Santos", "active": true, "timeZone": "America/Sao_Paulo" }, "created": "2012-12-12T21:04:29.000+0000", "updated": "2012-12-12T21:04:29.000+0000" }, { "id": "231134", "author": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Igor,\n\nPlease open a feature request for the title property. I think there are two competing schools of though here (at least):\n\n1) We should expose a title on the tab group.\n2) The action bar title should take the title of the current tab's window.\n\nI've spent some time reviewing the Android docs, and it's not clear to me which of these is preferable. \n", "updateAuthor": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-12T22:35:20.000+0000", "updated": "2012-12-12T22:35:20.000+0000" }, { "id": "231158", "author": { "name": "igorsantos07", "key": "igorsantos07", "displayName": "Igor Santos", "active": true, "timeZone": "America/Sao_Paulo" }, "updateAuthor": { "name": "igorsantos07", "key": "igorsantos07", "displayName": "Igor Santos", "active": true, "timeZone": "America/Sao_Paulo" }, "created": "2012-12-13T00:13:42.000+0000", "updated": "2012-12-13T00:13:42.000+0000" } ], "maxResults": 19, "total": 19, "startAt": 0 } } }