Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11654] Android: Assigning to to "tabs" property of TabGroup does not work

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-11-13T02:21:49.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sRelease 3.1.0, 2012 Sprint 23 API, 2012 Sprint 23
ComponentsAndroid
Labelsmodule_tabgroup, qe-review, qe-testadded
ReporterPing Wang
AssigneePing Wang
Created2012-11-02T17:42:55.000+0000
Updated2014-06-19T12:43:04.000+0000

Description

See the description in TIMOB-11434.

Comments

  1. Ping Wang 2012-11-05

    Steps for FR: 1. Run the test case in TIMOB-11434 for both old style tabgroup and action bar style tabgroup. Should see a tab group opens with tab1 and tab2. 2. Run the code below for both old style tabgroup and action bar style tabgroup. Should see a tab group opens with tab2 and tab3. After clicking the button "Add tab4", tab4 should be added to the tab group.
       // this sets the background color of the master UIView (when there are no windows/tab groups on it)
       Titanium.UI.setBackgroundColor('#000');
        
        
       //
       // create tab1 and win1
       //
       var win1 = Titanium.UI.createWindow({  
           title:'Tab 1',
           backgroundColor:'#fff'
       });
       var tab1 = Titanium.UI.createTab({  
           icon:'KS_nav_views.png',
           title:'Tab 1',
           window:win1
       });
        
       var label1 = Titanium.UI.createLabel({
           color:'#999',
           text:'I am Window 1',
           font:{fontSize:20,fontFamily:'Helvetica Neue'},
           textAlign:'center',
           width:'auto'
       });
        
       win1.add(label1);
        
       //
       // create tab2 and win2
       //
       var win2 = Titanium.UI.createWindow({  
           title:'Tab 2',
           backgroundColor:'#fff'
       });
       var tab2 = Titanium.UI.createTab({  
           icon:'KS_nav_ui.png',
           title:'Tab 2',
           window:win2
       });
        
       var label2 = Titanium.UI.createLabel({
           color:'#999',
           text:'I am Window 2',
           font:{fontSize:20,fontFamily:'Helvetica Neue'},
           textAlign:'center',
           width:'auto'
       });
        
       win2.add(label2);
       
       var button = Titanium.UI.createButton({
       	top: 10,
       	title: 'Add tab4'
       });
       button.addEventListener('click', function(e) {
       	tabGroup.addTab(tab4);
       });
       win2.add(button);
       
       //
       // create tab3 and win3
       //
       var win3 = Titanium.UI.createWindow({  
           title:'Tab 3',
           backgroundColor:'#fff'
       });
       var tab3 = Titanium.UI.createTab({  
           icon:'KS_nav_ui.png',
           title:'Tab 3',
           window:win3
       });
        
       var label3 = Titanium.UI.createLabel({
           color:'#999',
           text:'I am Window 3',
           font:{fontSize:20,fontFamily:'Helvetica Neue'},
           textAlign:'center',
           width:'auto'
       });
        
       win3.add(label3);
       
       //
       // create tab4 and win4
       //
       var win4 = Titanium.UI.createWindow({  
           title:'Tab 4',
           backgroundColor:'#fff'
       });
       var tab4 = Titanium.UI.createTab({  
           icon:'KS_nav_ui.png',
           title:'Tab 4',
           window:win4
       });
        
       var label4 = Titanium.UI.createLabel({
           color:'#999',
           text:'I am Window 4',
           font:{fontSize:20,fontFamily:'Helvetica Neue'},
           textAlign:'center',
           width:'auto'
       });
        
       win4.add(label4);
        
       // create tab group
       var tabGroup = Titanium.UI.createTabGroup({
           tabs: [tab1]  
       });
       
       tabGroup.setTabs([tab2]);
       tabGroup.addTab(tab3);
        
       // open tab group
       tabGroup.open();
       
    3. Run KS for sanity check.
  2. Ping Wang 2012-11-05

    PR: https://github.com/appcelerator/titanium_mobile/pull/3378
  3. Anshu Mittal 2013-01-11

    Tested with: SDK: 3.1.0.v20130110133402, 3.0.1.v20130109180643 Studio:3.0.1.201212181159 'tabs' property of TabGroup works perfectly.

JSON Source