Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-19199

Android: Picker in ActionBar shown expanded on app launch with SDK 4.0.1, 4.1.0.GA

    Details

    • Story Points:
      3
    • Sprint:
      2015 Sprint 16 SDK

      Description

      In our app, we have a picker added to the ActionBar with code like the following. Building with the 3.5.x branch SDKs, the picker is collapsed as expected. Building the same project with SDK 4.1.0.GA (or 4.0.1), the picker is expanded as shown in the attached graphic when the app is launched. Users have to tap outside the picker to collapse it.

      $.tabGroup.addEventListener("open", function () {
        var activity = $.tabGroup.getActivity();
        activity.onCreateOptionsMenu = function (e) {
          var settings, item, picker, menu, data = [];
          menu = e.menu;
          menu.clear();
          picker = Ti.UI.createPicker();
          data.push(
            Ti.UI.createPickerRow({
              title: 'Live',
              value: 'live'
            }));
          data.push(
            Ti.UI.createPickerRow({
              title: 'Ended',
              value: 'buyingended'
            }));
          picker.add(data);
          picker.addEventListener('change', pickLiveEnded);
          item = menu.add({
            title: "Live",
            showAsAction: Ti.Android.SHOW_AS_ACTION_ALWAYS
          });
          item.actionView = picker;
          picker.setSelectedRow(0, Alloy.Globals.selectedAuctionsPickerRow, false); //  column, row, [animated]
          settings = menu.add({
            icon: '/images/gear.png',
            showAsAction: Ti.Android.SHOW_AS_ACTION_ALWAYS
          });
          settings.addEventListener('click', function () {
            Alloy.createController('account').getView().open({
              modal: true
            });
          });
        };
        activity.invalidateOptionsMenu();
      });
      

      Edit: I added a graphic showing how it's supposed to look on launch, with picker collapsed. (I deleted the app name & icon from this new graphic.)

        Attachments

          Activity

            People

            • Assignee:
              msamah Ashraf Abu (Inactive)
              Reporter:
              timpoulsen Tim Poulsen
              Reviewer:
              Hieu Pham
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-20126
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration