[TIMOB-10946] Android: TabGroup focus event is not fired when setActiveTab is called on the first tab
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-10-14T23:39:23.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | Release 3.0.0, Sprint 2012-19 API, 2012 Sprint 19, Release 3.2.0 |
Components | Android |
Labels | api, module_tabgroup, qe-review, qe-testadded, regression |
Reporter | Hieu Pham |
Assignee | Hieu Pham |
Created | 2012-09-17T17:52:59.000+0000 |
Updated | 2014-01-23T18:07:57.000+0000 |
Description
1. Run this code:
var win1 = Ti.UI.createWindow({
title: 'Win 1'
});
var tab1 = Ti.UI.createTab({
icon: 'KS_nav_ui.png',
title: 'Tab 1',
window: win1
});
var win2 = Ti.UI.createWindow({
title: 'Win 2'
});
var tab2 = Ti.UI.createTab({
icon: 'KS_nav_views.png',
title: 'Tab 2',
window: win2
});
var tabGroup = Ti.UI.createTabGroup({
});
tabGroup.addTab(tab1);
tabGroup.addTab(tab2);
tabGroup.setActiveTab(tab1);
tabGroup.open();
tabGroup.addEventListener('focus', function(e) {
Ti.API.info('--------------------Focus tab index: ' + e.index);
});
2. Look at the log for the focus tab message.
Expected behavior:
Log message should be printed.
Actual behavior:
Log is not printed.
Tested with: SDK:3.0.0.v20121024144610 Studio: 3.0.0.201210220122 Device:HTC Desire V(Android 4.0.3) TabGroup focus event is not fired when setActivetab is called on the first tab.
TabGroup focus event is fired successfully on android when setActivetab is called on the first tab.
Tested with: SDK: 3.1.3.v20130916153052 Appcelertaor Studio: 3.1.3.201309132456 OS: OSX 10.8.4 Device: iPod touch2(iOS7) Xcode: 5.0 GM seed alloy@1.2.2-cr CLI version : 3.1.2 setActiveTab is not called for the first time on iOS
According to the comment, this fails on iOS not Android. Closing this as resolved.
Test Environment - Appc Studio - 3.2.0.201310181700 SDK - 3.2.0.v20131021142445 acs - 1.0.7 alloy - 1.2.2 titanium - 3.2.0 titanium-code-processor - 1.0.3 Xcode - 5.0 OS - Mountain Lion (10.8.5) Devices - Nexus 7(v4.2.1), Galaxy Note (v2.3.6) Result - TabGroup focus event is fired successfully on android when setActivetab is called on the first tab. Hence closing this issue.
Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/5074