Details

      Description

      Add support for [Action Items](http://developer.android.com/guide/topics/ui/actionbar.html#ActionItems).
      Action items are an extension of the option menu that appear in the action bar displaying a title or a custom view.

      • 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).
      • May require some build changes to target SDK version 11 or higher. This should still remain compatible (we
        are not bumping the min. API level) and fallback to using the old style option menus.
      • Update the documentation to explain how to take advantage of this feature in Honeycomb or later devices.

      Action bar menu example

      var win = Ti.UI.createWindow({fullscreen: false, backgroundColor: 'red'});
       
      win.activity.onCreateOptionsMenu = function(e) {
        var item = e.menu.add({title: 'Expand'});
        item.showAsAction = Ti.Android.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW;
       
        var collapseActionButton = Ti.UI.createButton({
          title: 'Collapse'
        });
        collapseActionButton.addEventListener('click', function() {
          item.collapseActionView();
        });
        item.actionView = collapseActionButton;
       
        item.on('expand', function() {
          alert('Expanded menu item!');
        });
        item.on('collapse', function() {
          alert('Collapsed menu item!');
        });
        item.on('click', function() {
          alert('clicked!');
        });
      }
       
      win.open();
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                joshroesslein Josh Roesslein
                Reporter:
                joshroesslein Josh Roesslein
              • Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Git Source Code