Details

      Description

      Implement the TabGroup.activeTab and Tab.active properties and set/get methods.
      These allow developers to determine if or what tab in a group is currently active.
      Developers may also set this property to true/false to toggle which tab is active.

      Acceptance Test

      var tabGroup = Ti.UI.createTabGroup();
       
      var tab1 = Ti.UI.createTab({
        title: 'A tab.',
        window: Ti.UI.createWindow({backgroundColor: 'blue'})
      });
      tabGroup.addTab(tab1);
       
      var tab2 = Ti.UI.createTab({
        title: 'Another tab.',
        window: Ti.UI.createWindow({backgroundColor: 'red'})
      });
      tabGroup.addTab(tab2);
       
      tabGroup.open();
       
      function logTabInfo() {
        Ti.API.info('active tab: ' + tabGroup.activeTab.title);
        Ti.API.info('1st tab active: ' + tab1.active);
        Ti.API.info('2nd tab active: ' + tab2.active);
      }
       
      logTabInfo();
       
      // Switch to the second tab after a few seconds.
      setTimeout(function() {
        tab2.active = true;
        logTabInfo();
       
        // Switch back to the first tab after another few seconds.
        setTimeout(function() {
          tabGroup.activeTab = tab1;
          logTabInfo();
        }, 3000);
      }, 3000);
      

      1. Run the application and verify the 1st tab (blue background) is visible.
      2. The following should be printed to the log:
        "active tab: A tab."
        "1st tab active: true"
        "2nd tab active: false"
      3. After 3 seconds the second tab (red background) should become active.
      4. Verify the following is printed to the log:
        "active tab: Another tab."
        "1st tab active: false"
        "2nd tab active: true"
      5. After 3 seconds the first tab (blue background) should become active again.
      6. Verify the same logs listed in step #2 is printed.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code