title: How to animate an icon for expand/collapse view?
body: <p>I have this icon:</p>
  
  <p><a href="https://i.stack.imgur.com/hmiQY.png" rel="noreferrer"><img src="https://i.stack.imgur.com/hmiQY.png" alt="enter image description here"></a></p>
  
  <p>And when i press my item in a listview i want it to rotate 180°. When i click again i want it to rotate another 180° so it get's to it's original position.</p>
  
  <p>First i tried:</p>
  
  <pre><code>view.animate().rotation(180).setDuration(500).start();
  </code></pre>
  
  <p>But it only fires once. After that i tried:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;set xmlns:android="http://schemas.android.com/apk/res/android"
      android:fillAfter="true"
      android:fillEnabled="true"&gt;
  
      &lt;rotate
          android:duration="500"
          android:fromDegrees="0"
          android:pivotX="50%"
          android:pivotY="50%"
          android:toDegrees="180" /&gt;
  &lt;/set&gt;
  </code></pre>
  
  <p>But with that the animation always starts with the arrow showing to the buttom and rotating to the top even if the arrow already shows to the top.</p>
  
  <p>So how can i make that working?</p>