Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26859] Android: Something broken with tabsBackgroundColor &tabsBackgroundSelectedColor on TabGroup refactoring -regression

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2019-03-11T20:33:40.000+0000
Affected Version/sRelease 8.0.0
Fix Version/sRelease 8.0.0
ComponentsAndroid
Labelsregression
ReporterKeerthi Mahalingam
AssigneeYordan Banev
Created2019-02-25T20:46:40.000+0000
Updated2019-03-11T20:33:40.000+0000

Description

*Test Steps:* 1.Run the app Tab1: background color: yellow background selected color: red Tab2/Tab3: background color: blue background selected color: red 3. Go to Tab 3, click on button 4. Now the following must be true: Tab1: background/background selected color remains UNCHANGED Tab2/Tab3: background color: orange background selected color: white *Actual:* changing the "tabsBackgroundColor" & "tabsBackgroundSelectedColor" with a click eventlistener it does not change.after button clicked on tab3 tab2/tab3 background/background selected color not changed app.js
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
 
// create tab group
var tabGroup = Titanium.UI.createTabGroup({
//Test tabsBackgroundColor and tabsBackgroundSelectedColor here.
 tabsBackgroundSelectedColor:'red',
 tabsBackgroundColor:'blue'
 
});
 
var win1 = Titanium.UI.createWindow({  
    title:'Tab 1',
    backgroundColor:'#fff'
});
var tab1 = Titanium.UI.createTab({  
    backgroundColor: 'yellow',
    backgroundSelectedColor: 'red',
    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 controls tab and root window
//
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 win3 = Titanium.UI.createWindow({  
    title:'Tab 3',
    backgroundColor:'#fff'
});
var tab3 = Titanium.UI.createTab({  
    icon:'KS_nav_views.png',
    title:'Tab 3',
    window:win3
});
 
 
var button3 = Titanium.UI.createButton({
    title: "change background color"
});
 
button3.addEventListener('click', function(e){
//Test tabsBackgroundColor and tabsBackgroundSelectedColor here.
    tabGroup.tabsBackgroundColor='orange';
    tabGroup.tabsBackgroundSelectedColor = 'white';
    
});
 
 
win3.add(button3);
 
//
//  add tabs
//
tabGroup.addTab(tab1);  
tabGroup.addTab(tab2);
tabGroup.addTab(tab3);  
 
// open tab group
tabGroup.open();

Comments

  1. Joshua Quick 2019-02-28

    Setting the colors before the TabGroup is open works. So, this is only an issue when changing the colors dynamically after it's been opened, right?
  2. Keerthi Mahalingam 2019-02-28

    Yes
  3. Yordan Banev 2019-03-06

    PR: https://github.com/appcelerator/titanium_mobile/pull/10756
  4. Yordan Banev 2019-03-11

    PR (8_0_X): https://github.com/appcelerator/titanium_mobile/pull/10763
  5. Samir Mohammed 2019-03-11

    FR Passed, Waiting on Jenkins build
  6. Christopher Williams 2019-03-11

    Merged to 8_0_X and master.
  7. Keerthi Mahalingam 2019-03-11

    Verified the fix on SDK 8.1.0.v20190311082624 and SDK 8.0.0.v20190311082612. Works as expected. Closing.
       Operating System
         Name                        = Mac OS X
         Version                     = 10.13.6
         Architecture                = 64bit
         # CPUs                      = 8
         Memory                      = 17179869184
       Node.js
         Node.js Version             = 8.12.0
         npm Version                 = 6.4.1
       Titanium CLI
         CLI Version                 = 5.1.1
       Titanium SDK
         SDK Version                 = 8.1.0.v20190311082624 and 8.0.0.v20190311082612
       Device                       =Samsung s5 android 6
       Emulator                   =nexus 5 android 5, pixel 2xl android 8 
       

JSON Source