title: Animation to show ImageView from left to right
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/13860780/animate-imageview-width-without-scaling">Animate ImageView width without scaling</a>  </p>
  </blockquote>
  
  
  
  <p>What I'm trying to do is to create an animation where an ImageView is shown starting from the left to the right (clipping animation?). The image should not be scaled.</p>
  
  <p>I tried changing the scaleType and then applying a ScaleAnimation directly to that ImageView:</p>
  
  <p>Layout:</p>
  
  <pre><code>&lt;ImageView
      android:id="@+id/graphImage"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_alignParentTop="true"
      android:scaleType="centerCrop"
      android:background="@android:color/transparent"
      android:contentDescription="@string/stroom_grafiek"
      /&gt;
  </code></pre>
  
  <p>Java:</p>
  
  <pre><code>scale = new ScaleAnimation((float)0,
          (float)1, (float)1, (float)1,
          Animation.RELATIVE_TO_SELF, (float)0,
          Animation.RELATIVE_TO_SELF, (float)1);
  scale.setDuration(1000);
  
  graphImage.startAnimation(scale);
  </code></pre>
  
  <p>I also tried to put the ImageView inside a RelativeLayout, and then apply the animation to the RelativeLayout:</p>
  
  <p>Layout:</p>
  
  <pre><code>&lt;RelativeLayout 
      android:id="@+id/graphImageInnerWrap"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:background="@android:color/transparent"
      android:layout_alignParentLeft="true"
      android:layout_alignParentTop="true"
      android:clipChildren="true"
      &gt;
      &lt;ImageView
          android:id="@+id/graphImage"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:scaleType="matrix"
          android:background="@android:color/transparent"
          android:contentDescription="@string/stroom_grafiek"
          /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Java:</p>
  
  <pre><code>scale = new ScaleAnimation((float)0,
          (float)1, (float)1, (float)1,
          Animation.RELATIVE_TO_SELF, (float)0,
          Animation.RELATIVE_TO_SELF, (float)1);
  scale.setDuration(1000);
  
  graphImageInnerWrap.startAnimation(scale);
  </code></pre>
  
  <p>In both cases the ImageView is still being scaled.
  I hope someone can point me in the right direction.</p>