[TIMOB-12983] BlackBerry: TabGroup.activeTab and Tab.active
GitHub Issue | n/a |
---|---|
Type | Sub-task |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-03-19T02:04:02.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 3.1.0, 2013 Sprint 06 BB, 2013 Sprint 06 |
Components | BlackBerry |
Labels | n/a |
Reporter | Josh Roesslein |
Assignee | Josh Roesslein |
Created | 2013-03-06T21:40:15.000+0000 |
Updated | 2017-03-08T18:25:22.000+0000 |
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);
Closing ticket as resolved.