[TIMOB-26859] Android: Something broken with tabsBackgroundColor &tabsBackgroundSelectedColor on TabGroup refactoring -regression
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2019-03-11T20:33:40.000+0000 |
Affected Version/s | Release 8.0.0 |
Fix Version/s | Release 8.0.0 |
Components | Android |
Labels | regression |
Reporter | Keerthi Mahalingam |
Assignee | Yordan Banev |
Created | 2019-02-25T20:46:40.000+0000 |
Updated | 2019-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();
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?Yes
PR: https://github.com/appcelerator/titanium_mobile/pull/10756
PR (8_0_X): https://github.com/appcelerator/titanium_mobile/pull/10763
FR Passed, Waiting on Jenkins build
Merged to 8_0_X and master.
Verified the fix on SDK 8.1.0.v20190311082624 and SDK 8.0.0.v20190311082612. Works as expected. Closing.