Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13297] Android: Light weight window close is VERY slow

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-04-10T22:06:39.000+0000
Affected Version/sRelease 3.0.2
Fix Version/s2013 Sprint 08 API, 2013 Sprint 08, Release 3.1.1, Release 3.2.0
ComponentsAndroid
Labelsn/a
ReporterPedro Enrique
AssigneePing Wang
Created2013-04-01T19:09:32.000+0000
Updated2013-05-03T06:26:04.000+0000

Description

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.

Comments

  1. Ping Wang 2013-04-10

    PR: https://github.com/appcelerator/titanium_mobile/pull/4140
  2. Ping Wang 2013-04-22

    3_1_X PR: https://github.com/appcelerator/titanium_mobile/pull/4194
  3. Paras Mishra 2013-05-03

    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

JSON Source