Problem
Closing a lightweight window in android is very slow, you can see how the children are being removed one by one creating a bad user experience.
Code
var win = Ti.UI.createWindow({
backgroundColor: '#eee'
});
var btn = Ti.UI.createButton({
title: 'here'
});
btn.addEventListener('click', function() {
LightWindow().open();
})
win.add(btn);
win.open();
function LightWindow() {
var win = Ti.UI.createWindow({
layout:'vertical',
backgroundColor: '#ccc'
});
var btn = Ti.UI.createButton({
title: 'Close'
});
win.add(btn);
btn.addEventListener('click', function(){
win.close();
});
for(var i = 0; i < 100; i++) {
win.add(Ti.UI.createButton({
title: 'Button: ' + (i + 1)
}))
}
return win;
}
To reproduce:
1. Copy and paste the code into app.js
2. Click on the button that will open the light weight window
3. On lightweight window, click on the first button "Close"
4. You will see how all the other buttons (which do nothing) will dissapear one by one before the window is closed
Workaround:
Hide the window before closing it.
PR: https://github.com/appcelerator/titanium_mobile/pull/4140
3_1_X PR: https://github.com/appcelerator/titanium_mobile/pull/4194
Working as expected, hence closing the issue. Verified on: Tested on: Device: Samsung Galaxy Note, Android version: 2.3.6 SDK: 3.1.1.v20130502180055 CLI version : 3.1.0 OS : MAC OSX 10.7.5 Appcelerator Studio, build: 3.1.0.201305020752 XCode : 4.5.1