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

Android: Animation with percentage behavior invert of iOS behavior

    Details

      Description

      Updated Test Case

      var win = Titanium.UI.createWindow();
       
      var view = Titanium.UI.createView({
        backgroundColor:'#fff',
        bottom : '80%',
        height : '10%'
      });
      win.add(view);
       
      var anim = Titanium.UI.createAnimation({bottom:'5%', height:'95%'});
       
      win.addEventListener('postlayout', function pl() {
      this.removeEventListener('postlayout', pl);
      setTimeout(function(){ view.animate(anim); }, 5000);
      });
       
      win.open();
      

      Original Test Case

      For Android, Example:

      var win = Titanium.UI.createWindow();
       
      var view = Titanium.UI.createView({
         bottom:'10%',
         height:'10%'
      });
      win.add(view);
       
      var anim = Titanium.UI.createAnimation(  bottom:'40%',  height:'40%' );
       
      var ready = false;
      win.addEventListener('postlayout', function pl(){
          win.removeEventListener('postlayout', pl);
          ready = true;
      });
       
      function animIn(){
          if(ready){
              view.animate(anim);
          }
      }
       
      // alternate animIn() -----------------------
       
      function animIn(){
          if(ready){
              view.setHeight(100)/ view.height = 100; // tried both
              view.animate(anim);
          }
      }
       
      // animIn() is called later in the project after postlayout.
      

      Actual Result

      animation starts but does not complete.

      Another problem I am encountering is that if I reset the view's values, as shown in 'alternate animIn()', the animation will fail whether percentages are used or not.

      I have replaced all percentages in the project's animations with instances like this, for '40%' .. (Ti.Platform.displayCaps.platformHeight * .4)

      Unfortunately this method has proven to be unreliable as the platformHeight/width is returned incorrectly at times, noticed particularly during installation when device is at rest/sleep.

      Expected Result

      Animation should expand view to assigned height/width percentage and/or move to assigned top/bottom percentage.

        Attachments

        1. .log
          430 kB
        2. diagnostic1170399753915506377.log
          15 kB
        3. screenshot-1.jpg
          screenshot-1.jpg
          38 kB
        4. screenshot-2.jpg
          screenshot-2.jpg
          36 kB

          Issue Links

            Activity

              People

              • Assignee:
                sunila Sunila
                Reporter:
                keylo Keylo E.
                Reviewer:
                Hieu Pham
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Integration