Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10086] Android: Window: Honeycomb - BackgroundColor of new window not shown when new window opened in a tab

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2013-06-21T08:54:04.000+0000
Affected Version/sRelease 2.1.1
Fix Version/sRelease 3.1.0, 2012 Sprint 24, 2012 Sprint 24 API
ComponentsAndroid
Labelsapi, module_window, qe-and070112, qe-testadded
ReporterSatyam Sekhri
AssigneePing Wang
Created2012-07-23T10:56:24.000+0000
Updated2013-06-21T08:54:04.000+0000

Description

The BackgroundColor of new window not shown when new window opened in a tab. This happens only on Android Honeycomb and works fine when tested on Froyo, Gingerbread and ICS. This is not a regression. The issue occurs atleast since 2.0.2 Steps to Reproduce: 1. Create an application with code below 2. Launch the application 3. Under Tab1, Click on 'Open Win3' button Actual: The win3 opens up under tab1 and has no background color Expected: The window win3 should open up with blue background color
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
  
var win1 = Titanium.UI.createWindow({  
    title:'Tab 1',
    backgroundColor:'#fff'
});
 
var button = Ti.UI.createButton({
    title:'open win3',
    width:200,
    height:100
});
 
win1.add(button);
 
var win2 = Titanium.UI.createWindow({  
    title:'Tab 2',
    backgroundColor:'#fff'
}); 
  
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 win3 = Ti.UI.createWindow({
    title:'foobar',
    backgroundColor:'blue',
});
var button2 = Ti.UI.createButton({
    title:'back to win1',
    width:200,
    height:100,
    backgroundColor:'white'
});
 
win3.add(button2);
  
button.addEventListener('click', function(){
    win3.open();
});
 
button2.addEventListener('click', function(){
    win3.close()
});     
  
// create tab group
var tabGroup = Titanium.UI.createTabGroup();
  
var tab1 = Titanium.UI.createTab({  
    icon:'KS_nav_views.png',
    title:'Tab 1',
    window:win1
});
  
 
var tab2 = Titanium.UI.createTab({  
    icon:'KS_nav_ui.png',
    title:'Tab 2',
    window:win2
});
  
tabGroup.addTab(tab1);  
tabGroup.addTab(tab2);  
  
tabGroup.open();

Comments

  1. Ping Wang 2012-11-12

    Another simple test case:
       var win = Ti.UI.createWindow({
       	fullscreen: true,
           backgroundColor:'red',
           title:'test'
       });
        
       var button = Ti.UI.createButton({
           title:'open win2',
           width:200,
           height:100
       });
         
       win.add(button);
       
       var win2 = Ti.UI.createWindow({
       	title:'foobar',
           backgroundColor:'blue'
       });
       
       var v = Ti.UI.createWindow({
       	backgroundColor: 'blue'
       });
       
       var button2 = Ti.UI.createButton({
       	title:'back to win',
           width:200,
           height:50,
           backgroundColor:'white'
       });
         
       win2.add(button2);
          
       button.addEventListener('click', function(){
           win2.open();
       });
         
       button2.addEventListener('click', function(){
           win2.close()
       });
        
       win.open();
       
  2. Ping Wang 2012-11-12

    PR: https://github.com/appcelerator/titanium_mobile/pull/3408 Run the two test cases above. The new windows should open correctly.
  3. Satyam Sekhri 2013-01-21

    Tested with: SDK:3.1.0.v20130114171802 Studio:3.0.1.201212181159 Device: Samsung tab(v 3.2)
  4. Priya Agarwal 2013-06-21

    Reopening just to update label
  5. Priya Agarwal 2013-06-21

    Updated label and verified. Tested on: Device: Nexus tab Android Version 3.2 SDK:3.1.2.v20130619101604 Appcelerator Studio: 3.1.1.201306131423 OS: OSX 10.8 acs:1.0.3 alloy:1.1.3 npm:1.2.14 titanium:3.1.1 titanium-code-processor:1.0.1

JSON Source