[TIMOB-8192] Android: Open events do not fire for windows on tabs
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Critical |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2012-03-23T10:13:42.000+0000 |
| Affected Version/s | Release 1.8.0.1 |
| Fix Version/s | Release 2.0.0, Sprint 2012-06 |
| Components | Android |
| Labels | parity |
| Reporter | Opie Cyrus |
| Assignee | Opie Cyrus |
| Created | 2012-03-22T12:14:41.000+0000 |
| Updated | 2013-02-21T14:02:03.000+0000 |
Description
Open event for windows on tabs do not fire when opened. This can be seen by adding open event listeners to the main tabs in KS. Currently, only the window associated with the active tab when the tab group is opened will fire a open event.
PR https://github.com/appcelerator/titanium_mobile/pull/1799 opened
Opened timob-8222 to address related bug on Android regarding open event for window on first tab when first tab is not the active tab with the tab group is opened.
Closing as Fixed. SDK: 2.0.0.v20120322231759 Android: V8, Rhino Studio: 2.0.0.201203221554 OS: Snow Leopard Devices Tested: Nexus One 2.2.2, Nexus S 2.3.6 Used stand-alone test code (retroactively verified):
// 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(); // // create base UI tab and root window // var win1 = Titanium.UI.createWindow({ title:'Tab 1', backgroundColor:'#fff' }); win1.addEventListener('open', function(){ alert('win1 open event fired'); }); var tab1 = Titanium.UI.createTab({ 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' }); win2.addEventListener('open', function(){ alert('win2 open event fired'); }); 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); // // add tabs // tabGroup.addTab(tab1); tabGroup.addTab(tab2); // open tab group tabGroup.open();Just tested and it doesnt work :s SDK: 3.0.0.f185172e2 Android: V8, Rhino OS: Moutain Lion Devices Tested: Galaxy S2 4.0.3 can we reopen this one?
Tested with: Titanium Studio, build: 3.0.2.201302191606 Titanium SDK, build: 3.0.0.GA Titanium SDK, build: 3.0.2.GA Device: SamsungS3 Android version 4.0.4 Device log: 02-20 10:27:06.147: I/ALERT(3738): (KrollRuntimeThread) [609,609] win1 open event fired 02-20 10:27:42.476: I/ALERT(3738): (KrollRuntimeThread) [6588,36938] win2 open event fired Emulator: [INFO][ALERT ( 268)] (KrollRuntimeThread) [495,495] win1 open event fired [INFO][ALERT ( 268)] (KrollRuntimeThread) [9956,10451] win2 open event fired
@Martin--we need a piece of code to reproduce the issue.
@Ingo: my bad i didn't give enough information (tend to do that too much those dauys :s). After thinking about it i remembered what the sample was. Actually it was when i was playing with KS.I will test it a lot more, but KS has a lot of problems and that was one of them. May be it's due to the target sdk of KS. Will report on it as soon as possible.
Just remembered also that tabs are loaded through url in KS, which might do a difference. Will test