[TIMOB-17440] Android: support setting properties to the tabgroup activity before tabgroup opens
| GitHub Issue | n/a |
|---|---|
| Type | Improvement |
| Priority | None |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2014-08-05T19:42:38.000+0000 |
| Affected Version/s | Release 3.3.0 |
| Fix Version/s | Release 3.4.0 |
| Components | Android |
| Labels | module_tabgroup, qe-manualtest |
| Reporter | Ping Wang |
| Assignee | Ping Wang |
| Created | 2014-07-31T17:51:14.000+0000 |
| Updated | 2014-08-18T17:30:20.000+0000 |
Description
Attachments
| File | Date | Size |
|---|---|---|
| Logs.png | 2014-08-18T17:09:13.000+0000 | 44172 |
For FR: 1. Run the above test case. Should see logs from callbacks and event listeners. 2. Run KS for sanity check.Titanium.UI.setBackgroundColor('#000'); // create tab group var tabGroup = Titanium.UI.createTabGroup(); var win1 = Titanium.UI.createWindow({ title : 'Tab 1', backgroundColor : '#fff' }); var tab1 = Titanium.UI.createTab({ icon : 'KS_nav_views.png', title : 'Tab 1', window : win1 }); var label1 = Titanium.UI.createLabel({ color : '#999', text : 'Click to open window', font : { fontSize : 20, fontFamily : 'Helvetica Neue' }, textAlign : 'center', width : 'auto' }); function openWin() { var childWin = Ti.UI.createWindow({}); childWin.addEventListener('open', function(){ Ti.API.info('childWin open event fired: childWin.activity = ' + childWin.activity); }); childWin.activity.onCreateOptionsMenu = function(e) { Ti.API.info('childWin onCreateOptionsMenu called'); }; childWin.activity.onStart = function() { Ti.API.info('childWin onStart called'); }; childWin.activity.onRestart = function() { Ti.API.info('childWin onRestart called'); }; childWin.activity.onCreate = function() { Ti.API.info('childWin onCreate called'); }; childWin.activity.onResume = function() { Ti.API.info('childWin onResume called'); }; childWin.activity.onPause = function() { Ti.API.info('childWin onPause called'); }; childWin.activity.onStop = function() { Ti.API.info('childWin onStop called'); }; childWin.activity.onDestroy = function() { Ti.API.info('childWin onDestroy called'); }; childWin.open(); } label1.addEventListener('click', openWin); win1.add(label1); 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); tabGroup.addTab(tab1); tabGroup.addTab(tab2); tabGroup.addEventListener('open', function(){ Ti.API.info('tabGroup open event fired: tabGroup.activity = ' + tabGroup.activity); }); tabGroup.activity.onCreateOptionsMenu = function(e) { Ti.API.info('tabGroup onCreateOptionsMenu called'); }; tabGroup.activity.onStart = function() { Ti.API.info('tabGroup onStart called'); }; tabGroup.activity.onRestart = function() { Ti.API.info('tabGroup onRestart called'); }; tabGroup.activity.onCreate = function() { Ti.API.info('tabGroup onCreate called'); }; tabGroup.activity.onResume = function() { Ti.API.info('tabGroup onResume called'); }; tabGroup.activity.onPause = function() { Ti.API.info('tabGroup onPause called'); }; tabGroup.activity.onStop = function() { Ti.API.info('tabGroup onStop called'); }; tabGroup.activity.onDestroy = function() { Ti.API.info('tabGroup onDestroy called'); }; tabGroup.open();PR: https://github.com/appcelerator/titanium_mobile/pull/5945
Verified fix on: Mac OSX 10.9.4 Appcelerator Studio, build: 3.3.0.201407111535 Titanium SDK build: 3.4.0.v20140813022514 Titanium CLI, build: 3.3.0 Alloy: 1.4.1 Android Simulator 4.4.2 Android Device Note 2 (4.3) Ran above code, the console shows logs for both the child window and main window callbacks and event listeners, see attached screenshot for logs. Ran KS as a second check. Closing ticket.