Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-13297

Android: Light weight window close is VERY slow

    Details

      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.

        Attachments

          Activity

            People

            • Assignee:
              pwang Ping Wang
              Reporter:
              penrique Pedro Enrique (Inactive)
              Reviewer:
              Hieu Pham
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-16077
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration