title: Android : Animate Rating Bar
body: <p>I'm creating an android app which needs rating bar to denote the progress of each level.
  I've figured how to use rating bars both custom and default now i would like to add animation to the rating bar progress.</p>
  
  <p>Whenever I set the number of stars (mean I've set <code>android:isIndicator="true"</code> using only for displaying to user not editable by him) it should do some animation like rotate and fill the bar.Please help me out with the code fragment  I should use.</p>
  
  <p>I've included code that i used for rating bar creation:</p>
  
  <pre><code>&lt;RatingBar
      android:id="@+id/ratingBar1"
      style="@style/myRatingBar"
      android:layout_width="wrap_content"
      android:layout_height="30dp"
      android:layout_centerHorizontal="true"
      android:layout_centerVertical="true"
      android:numStars="5"
      android:rating="3"
      android:isIndicator="true" /&gt;
  </code></pre>
  
  <p>drawable/ratingstars.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  &lt;item android:id="@+android:id/background"
        android:drawable="@drawable/star_empty" /&gt;
  &lt;item android:id="@+android:id/secondaryProgress"
        android:drawable="@drawable/star_empty" /&gt;
  &lt;item android:id="@+android:id/progress"
        android:drawable="@drawable/star" /&gt;
  &lt;/layer-list&gt;
  </code></pre>
  
  <p>values/styles.xml</p>
  
  <pre><code>&lt;resources&gt;
  
  &lt;style name="myRatingBar" parent="@android:style/Widget.RatingBar"&gt;
      &lt;item name="android:progressDrawable"&gt;@drawable/ratingstars&lt;/item&gt;
      &lt;item name="android:minHeight"&gt;22dip&lt;/item&gt;
      &lt;item name="android:maxHeight"&gt;22dip&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;/resources&gt;
  </code></pre>
  
  <p>please help me to add animation to rating when i use setRating(int) from activity</p>