title: How to Rotate an Arrow Drawable about it's Center
body: <p>I have an arrow drawable that I simply want to rotate without it moving either in the x or y direction.
  To explain further, consider a ball spinning about a fixed point or the circular Android progressbar.
  Additionally, the drawable will rotate -180 degree when clicked and 180 degress when clicked again.</p>
  
  <p>Please, is there anyway this can be done programmatically?</p>
  
  <p><strong>Update</strong>
  From Jason Wihardja's answer, I was able to achieve this:</p>
  
  <pre><code>@Override
          public void onClick(View v) {
  
  
              if (v.getId() == imageButton.getId()) {
                  int visibilty =newsBody.getVisibility();
                  if (visibilty == View.VISIBLE) {
                      Animation animation = new RotateAnimation(180.0f, 360.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
                      animation.setInterpolator(new DecelerateInterpolator());
                      animation.setRepeatCount(0);
                      animation.setFillAfter(true);
                      animation.setDuration(300);
                      imageButton.startAnimation(animation);
                      newsBody.setVisibility(View.GONE);
  
                  } else {
                      Animation animation = new RotateAnimation(0.0f, 180.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
                      animation.setInterpolator(new DecelerateInterpolator());
                      animation.setRepeatCount(0);
                      animation.setFillAfter(true);
                      animation.setDuration(300);
                      imageButton.startAnimation(animation);
                      newsBody.setVisibility(View.VISIBLE);
                  }
              }
          }
  </code></pre>
  
  <p>But is there anyway I can avoid repeating the animation building? Like just build it once and toggle the degrees in each click.</p>