title: Android change position of the bitmap
body: <p>I'd wanted to ask how I can change the position of a bitmap, I am using the following code. I looked at the question below from a guy who seemed to have the same problem, yet I had already tried this and received a different animation location.</p>
  <p><a href="https://stackoverflow.com/questions/9676188/android-positioning-a-drawbitmap-that-uses-rect?answertab=votes#tab-top">android positioning a drawBitmap that uses rect</a></p>
  <pre><code>public class Yodasprite implements Drawable {
      private static final int BMP_COLUMNS = 6;
      private static final int BMP_ROWS = 1;
  
      private GameContent gameContent;
      float fracsect;
      private int x = 0;
      private int y = 0;
      int xSpeed = 5;
      private Bitmap bmp;
      private int currentFrame = 0;
      private int width;
      private int height;
      long current_time;
      long lasttime;
      long delta;
  
  public Yodasprite(GameContent gameContent, Bitmap bmp) {
      this.gameContent = gameContent;
      this.bmp = bmp;
      this.width = bmp.getWidth() / BMP_COLUMNS;
      this.height = bmp.getHeight() / BMP_ROWS;
      this.lasttime = System.currentTimeMillis();
  }
  
  @Override
  public void update(float fracsec) {
  
      if (x &gt; gameContent.getGameWidth() - width + xSpeed) {
          xSpeed = -5;
      }
      if (x + xSpeed &lt; 0) {
          xSpeed = 5;
      }
      if (delta / fracsec &gt;999) {
          x = x + xSpeed;
          currentFrame = ++currentFrame % BMP_COLUMNS;
      }
  }
  
  @Override
  public void draw(Canvas canvas) {
      current_time = System.currentTimeMillis();
      delta = current_time - lasttime;
      fracsect = (float) delta / 1000;
      update(fracsect);
  
      int srcX = currentFrame * (width -4);
      int srcY = height - height;
  
      Rect src = new Rect(srcX, srcY,srcX + width+5,srcY+height); 
      Rect dst = new Rect(x,10,x+width, y+height);
      canvas.drawBitmap(bmp, src, dst, null);
    }
  }
  </code></pre>
  <p>Rect dest according from what I understand from the documentation as well as the post above determines with x,y the location on the canvas. My sprite spawns at 0,0 and I'd like to move the sprite down via y. Any advice and or help with this ? Moving the sprite down like the code below does not seem to work.</p>
  <pre><code>Rect dst = new Rect(x,10,x+width, y+height);
  </code></pre>