How do you scale down an ImageView with ObjectAnimator, but have it retain its position in layout?
<p>I am trying to scale an ImageView down in an animation, but whenever I do so it appears to shift down and to left in the layout. Here is a screenshot before I animate:</p>

<p><img src="http://i.stack.imgur.com/W71NW.png" alt="before animation"></p>

<p>And here what it looks like after the animation:</p>

<p><img src="http://i.stack.imgur.com/SW1Yw.png" alt="after animation"></p>

<p>Is it possible to have the ImageView scale down, but have its top-left corner remain in the top-left corner of the layout?</p>

<p>Here is the code I am using:</p>

<pre><code>// ScaleTestActivity.java

import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ImageView;

public class ScaleTestActivity extends Activity {

    ImageView mImageView;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        mImageView = (ImageView)findViewById(R.id.image_view);
    }

    @Override
    protected void onResume() {
        super.onResume();

        ObjectAnimator scaleDownX = ObjectAnimator.ofFloat(mImageView, "scaleX", 0.5f);
        ObjectAnimator scaleDownY = ObjectAnimator.ofFloat(mImageView, "scaleY", 0.5f);

        scaleDownX.setDuration(1000);
        scaleDownY.setDuration(1000);

        AnimatorSet scaleDown = new AnimatorSet();

        scaleDown.play(scaleDownX).with(scaleDownY);
        scaleDown.start();
    }
}
</code></pre>

<p>The layout:</p>

<pre><code>&lt;!-- main.xml --&gt;
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"&gt;

    &lt;ImageView
        android:id="@+id/image_view"
        android:src="@drawable/droid"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true" /&gt;

&lt;/RelativeLayout&gt;
</code></pre>

<p>The drawable resource:</p>

<p><img src="http://i.stack.imgur.com/Uf5Xr.gif" alt="Large Android Logo"></p>
