title: MotionLayout: how to animate margin
body: <p>I'm using <code>MotionLayout</code> to animate the resizing of a view from full screen to a smaller dimension that has particular margins (as per following).  It mostly works fine but the margins shown are 0 until the very end of animation after which they're applied immediately.  Is there any way to animate those as well?</p>
  
  <pre><code>&lt;ConstraintSet android:id="@+id/start"&gt;
      &lt;Constraint
          android:id="@+id/localVideoView"
          android:layout_width="match_parent"
          android:layout_height="match_parent" /&gt;
  &lt;/ConstraintSet&gt;
  
  &lt;ConstraintSet android:id="@+id/end"&gt;
      &lt;Constraint
          android:id="@+id/localVideoView"
          android:layout_width="68dp"
          android:layout_height="120dp"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintBottom_toBottomOf="parent"
          android:layout_marginEnd="16dp"
          android:layout_marginBottom="92dp"/&gt;
  &lt;/ConstraintSet&gt;
  </code></pre>
  
  <p>I've tried using <code>KeyFrameSet</code> to create intermediate point with different margin values but that had no effect.  </p>
  
  <p>For example</p>
  
  <pre><code>    &lt;KeyFrameSet&gt;
          &lt;KeyAttribute
              app:framePosition="50"
              app:target="@id/localVideoView"&gt;
              &lt;CustomAttribute
                  motion:attributeName="layoutMarginBottom"
                  motion:customDimension="92dp" /&gt;
          &lt;/KeyAttribute&gt;
      &lt;/KeyFrameSet&gt;
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>So, looks like issue is related to fact that I'm using <code>SurfaceView</code>...if I try with an <code>ImageView</code> for example the margin does change gradually.</p>