title: Android Drawable mutate() & setLevel()
body: <p>I am trying to store drawables in a static SoftReferenceMap for a ListView containing progress-bars in every row. Every row has a different progress, but when I set it through setProgress(int) all rows get affected.</p>
  
  <p>I tried doing mDrawable.mutate().setLevel(progress*10000/max), but it still doesn't work.</p>
  
  <pre><code>public void setProgres(int status, int progress, int max) {
  
          Drawable d = getDrawable(status);
  
          switch (status) {
          case RED_INDETERMINATE:
              setIndeterminateDrawable(d);
              setIndeterminate(true);
              break;
          case YELLOW:
              d.mutate().setLevel((int) (progress * 10000 / max));
          case GREEN:
          case BLUE:
              setProgressDrawable(d);
              break;
  
          default:
              throw new IllegalArgumentException(
                      "Invalid Status setting for ArtooProgressBar: " + status);
          }
  
          getProgressDrawable().invalidateSelf();
          super.invalidate();
      }
  
      private Drawable getDrawable(int status) {
  
          SoftReference&lt;Drawable&gt; ref = sDrawableMaps.get("" + status);
  
          if (ref != null &amp;&amp; ref.get() != null)
              return ref.get();
  
          Drawable d;
  
          switch (status) {
          case RED_INDETERMINATE:
              d = getResources().getDrawable(
                      R.drawable.progress_bar_indeterminate);
              d = tileifyIndeterminate(d);
              break;
          case YELLOW:
              // d = yellow;
              d = getResources().getDrawable(
                      R.drawable.progress_bar_determinate_yellow);
              break;
          case GREEN:
              d = getResources().getDrawable(
                      R.drawable.progress_bar_determinate_green);
              d.setLevel(10000);
              break;
          case BLUE:
              d = getResources().getDrawable(
                      R.drawable.progress_bar_determinate_blue);
              d.setLevel(10000);
              break;
  
          default:
              throw new IllegalArgumentException(
                      "Invalid Status setting for ArtooProgressBar: " + status);
          }
  
          if (d != null)
              sDrawableMaps.put("" + status, new SoftReference&lt;Drawable&gt;(d));
  
          d.invalidateSelf();
          return d;
  
      }
  </code></pre>
  
  <p>What am I missing?</p>
  
  <p>Thanks</p>