{ "id": "94644", "key": "TIMOB-9910", "fields": { "issuetype": { "id": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true }, "parent": { "id": "63003", "key": "TIMOB-2371", "fields": { "summary": "Android: Action bar", "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 } } }, "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": "13503", "description": "Sprint 2012-14 Core", "name": "Sprint 2012-14 API", "archived": true, "released": true, "releaseDate": "2012-07-13" }, { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-07-13T17:05:16.000+0000", "created": "2012-07-09T15:04:58.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "api" ], "versions": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" } ], "issuelinks": [ { "id": "22108", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "103647", "key": "TIMOB-11539", "fields": { "summary": "Android: Action bar logo changes when action item is expanded", "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 } } } } ], "assignee": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-11-19T12:40:11.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": "Add support for [Action Items](http://developer.android.com/guide/topics/ui/actionbar.html#ActionItems).\r\nAction items are an extension of the option menu that appear in the action bar displaying a title or a custom view.\r\n\r\n- Implement the new MenuItem methods for setting the action view, how the action item is displayed (ex: always, if room), and new events (ex: expanded).\r\n- May require some build changes to target SDK version 11 or higher. This should still remain compatible (we\r\n are not bumping the min. API level) and fallback to using the old style option menus.\r\n- Update the documentation to explain how to take advantage of this feature in Honeycomb or later devices.\r\n\r\nh3. Action bar menu example\r\n\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow({fullscreen: false, backgroundColor: 'red'});\r\n\r\nwin.activity.onCreateOptionsMenu = function(e) {\r\n var item = e.menu.add({title: 'Expand'});\r\n item.showAsAction = Ti.Android.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW;\r\n\r\n var collapseActionButton = Ti.UI.createButton({\r\n title: 'Collapse'\r\n });\r\n collapseActionButton.addEventListener('click', function() {\r\n item.collapseActionView();\r\n });\r\n item.actionView = collapseActionButton;\r\n\r\n item.on('expand', function() {\r\n alert('Expanded menu item!');\r\n });\r\n item.on('collapse', function() {\r\n alert('Collapsed menu item!');\r\n });\r\n item.on('click', function() {\r\n alert('clicked!');\r\n });\r\n}\r\n\r\nwin.open();\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: Action Items", "creator": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "202741", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "To test run the example above. Be sure to test on both a pre-Honeycomb, Honeycomb, and ICS devices.\r\n\r\n1. Click the 'Expand' menu item. On pre-Honeycomb devices\r\n this will show up in the menu list which is shown via the menu button.\r\n On Honeycomb or later you will find this item in the overflow options menu\r\n on the action bar (the three vertical dots).\r\n2. After clicking you should see an alert saying \"click\". On ICS or later\r\n you will also see an \"expanded\" alert dialog. You will also notice on ICS\r\n the menu item has expanded into a button view saying \"Collapse\".\r\n3. On ICS click the \"Collapse\" action button that was expanded in step 2.\r\n It should collapse back into an item in the overflow menu and show an alert\r\n saying \"collapsed'.\r\n", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-11T13:49:34.000+0000", "updated": "2012-07-11T13:49:34.000+0000" }, { "id": "202821", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Make sure you adjust the \"targetSdkVersion\" in your Android manifest for the application.\r\nThis needs to be API level 11 or higher to support the action bar. Also bump it to API level 14\r\nto verify the expand/collapse works for menu items.", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-11T17:59:05.000+0000", "updated": "2012-07-11T17:59:05.000+0000" }, { "id": "202844", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Neeraj\r\n\r\nMy PR includes some documentation updates. I will be creating a ticket with Arthur\r\nto review the menu documentation and add some additional information.", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-11T20:38:38.000+0000", "updated": "2012-07-11T20:38:38.000+0000" }, { "id": "217237", "author": { "name": "andreykonn", "key": "andreykonn", "displayName": "Andrey Kon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I'm new to titanium so maybe my question will look silly but...\r\n1. I wanted to ask if it's possible to remove and add new action items to action bar or to show contextual action bars.\r\n2. Is it possible to add custom views to the left side of action bar zone?\r\n3. What do I have to do to be able to test action items now?", "updateAuthor": { "name": "andreykonn", "key": "andreykonn", "displayName": "Andrey Kon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-31T14:17:33.000+0000", "updated": "2012-08-31T14:17:33.000+0000" }, { "id": "227841", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "body": "To test,run the sample app given and observed the below details.(Tested on both a pre-Honeycomb, Honeycomb, and ICS device).\r\n\r\n1. Click the 'Expand' menu item. On pre-Honeycomb devices\r\nthis will show up in the menu list which is shown via the menu button.\r\nOn Honeycomb or later you will find this item in the overflow options menu\r\non the action bar (the three vertical dots).\r\n2. After clicking you should see an alert saying \"click\". On ICS or later\r\nyou will also see an \"expanded\" alert dialog. You will also notice on ICS\r\nthe menu item has expanded into a button view saying \"Collapse\".\r\n3. On ICS click the \"Collapse\" action button that was expanded in step 2.\r\nIt should collapse back into an item in the overflow menu and show an alert\r\nsaying \"collapsed'.\r\n\r\nDevices tested\r\nSamsung Galaxy Nexus - Android 4.0.2\r\nSamung GALAXY Tab 620 - Android 3.2\r\nLG-P970 - Android 2.2.2 \r\n\r\nTitanium SDK:3.0.0.v20121113170203\r\nTitanium  Studio:3.0.0.201211131839", "updateAuthor": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-19T12:40:11.000+0000", "updated": "2012-11-19T12:40:11.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }