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

Android: Animations don't work with 'dp' values

    Details

      Description

      Problem

      When trying to run an animation such as this on Android:

      var openAnimation = Ti.UI.createAnimation(

      {left :'35dp',duration : 350}

      );

      An error is thrown:
      Uncaught Error: unable to parse '35dp' as integer

      Steps to Reproduce

      Please run the sample code below to reproduce the issue:

       
      var win = Ti.UI.createWindow({
          backgroundColor:'white'
      });
      win.open();
       
       
      var closingLabel = Titanium.UI.createLabel({
          text:'The End',
          height:'auto',
          width:'auto',
          color:'#fff',
          font:{fontSize:12},
          textAlign:'center',
          opacity: 0
      });
       
      win.add(closingLabel);
       
      closingLabel.animate(Titanium.UI.createAnimation({
          opacity: 100,
          duration: 2500,
          left:'35dp',
          transform: Titanium.UI.create2DMatrix({
              scale: 1.5
          })
      }));
      

      Please see the attached screenshot of the error too.

        Attachments

          Activity

            People

            • Assignee:
              billdawson Bill Dawson
              Reporter:
              vjoshi Varun Joshi
            • Watchers:
              0 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code