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

Android: transform animation doesn't work immediately after creating a view [android]

    Details

    • Story Points:
      8
    • Sprint:
      2016 Sprint 25 SDK

      Description

      1. Create a view with an initial transform (it is important that an initial transform matrix is set)
      2. Add the view
      3. Call animate

      The animation will not work and the animation callback is not executed.

      Notes:
      1. This problem is specific to transform animation. If the view is animated with left/right/top/bottom for example, everything works fine.
      2. Deferring the animation, for example by putting it in a setTimeout callback, works if the timeout is long enough.

      Sample code - run this, click the button and view the result.

      var window=Ti.UI.createWindow({backgroundColor:'white'});
       
      mainView=Ti.UI.createView({backgroundColor:'white'});
      window.add(mainView);
       
      button=Ti.UI.createButton({left:0,right:0,height:40,bottom:0,title:'start'});
      button.addEventListener('click',function(e) {
          Ti.API.info("********** start **********")
          var view=Ti.UI.createView({backgroundColor:'red',left:40,right:0,top:0,bottom:40,transform:Ti.UI.create2DMatrix().scale(0.1)});
          mainView.add(view);
          view.animate({left:0,transform:Ti.UI.create2DMatrix().scale(1),duration:500},function() {
              Ti.API.info("********** end **********")
              mainView.remove(view);
              view=null;
          });
      });
      mainView.add(button);
       
      window.open();
      

        Attachments

          Activity

            People

            • Assignee:
              gmathews Gary Mathews
              Reporter:
              buddyguards grebulon
              Reviewer:
              Farzad Merzadyan (Inactive)
              Tester:
              Josh Longton
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code