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

Android: Animating a child view in vertical layout no longer works correctly

    Details

      Description

      Animating a child view contained in a view with a vertical layout no longer adjusts the other children as it used to. Now the views just stay stationary while the animation happens.

      the following snippet shows the issue, the second square should be moving up and down to compensate for the animation but it doesn't now.

      Sample Code:

      index.xml

      <Alloy>
      	<Window class="container">
      	</Window>
      </Alloy>
      

      index.js

      var bBig = false;
       
      var btn = Ti.UI.createButton( {
      	width : '90%',
      	height : '40dp',
      	title : 'Start Test',
      	top: 0
      } );
       
      var parent = Ti.UI.createView({
      	height: 100,
      	width: 100,
      	layout: 'vertical'
      });
       
      var v1 = Ti.UI.createView({
      	height: 50,
      	width: 50,
      	top: 5,
      	backgroundColor: 'red'
      });
       
      var v2 = Ti.UI.createView({
      	height: 50,
      	width: 50,
      	top: 20,
      	backgroundColor: 'blue'
      });
       
      btn.addEventListener( 'click', function( e ) {
      	if( !bBig ){
      		bBig = true;
      		v1.animate( Ti.UI.createAnimation({
      			height:100,
      			duration: 300
      		}));
      	} else {
      		bBig = false;
      		v1.animate( Ti.UI.createAnimation({
      			height:50,
      			duration: 300
      		}));
      	}
      } );
      $.index.add( btn );
      $.index.add( parent );
       
      parent.add( v1 );
      parent.add( v2 );
       
      $.index.open();
      

      Steps to reproduce:

      1. Create a new alloy project with the above code
      2. Run the app on an Android device, building with TiSDK 3.2.0
      3. Click the "Start Test" button
      4. Notice that the red box moves down and overlaps the blue box

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                pwang Ping Wang
                Reporter:
                jliddell John Liddell
                Reviewer:
                Hieu Pham
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code