title: Redraw view on MotionEvent.ACTION_MOVE
body: <p>I have created on basic View which has Red color in background.I am using that view in my activity.I have setOnTouch listner to same view.
  on touch events i am moving that view.</p>
  
  <p><a href="http://i.stack.imgur.com/M8fA1.png" rel="nofollow">Before touch event it looks like this</a></p>
  
  <p><a href="http://i.stack.imgur.com/gbGcu.png" rel="nofollow">After MotionEvent.ACTION_MOVE it look like this
  </a></p>
  
  <p>After motion event i want view to be redrawn.I don't want white portion to be shown.</p>
  
  <p>it should redraw it like google map does on moving map in any direction.</p>
  
  <p>following code is of my basic custom view</p>
  
  <pre><code>public class CustomVIew extends View {
      public CustomVIew(Context context) {
          super(context);
      }
  
      public CustomVIew(Context context, AttributeSet attrs) {
          super(context, attrs);
      }
  
      public CustomVIew(Context context, AttributeSet attrs, int defStyleAttr) {
          super(context, attrs, defStyleAttr);
      }
  
      @Override
      protected void onDraw(Canvas canvas) {
          super.onDraw(canvas);
          canvas.drawColor(Color.RED);
      }
  }
  </code></pre>
  
  <p>This is my OnTouch method implementation</p>
  
  <pre><code>@Override
      public boolean onTouch(View v, MotionEvent event) {
  
   switch (event.getAction()) {
  
              case MotionEvent.ACTION_DOWN:
  
                  _xDelta = v.getX() - event.getRawX();
                  _yDelta = v.getY() - event.getRawY();
                  Log.d(TAG, "onTouch: X:" + _xDelta + " Y:" + _yDelta);
                  break;
  
              case MotionEvent.ACTION_MOVE:
                  v.animate()
                          .x(event.getRawX() + _xDelta)
                          .y(event.getRawY() + _yDelta)
                          .setDuration(10)
                          .start();
                  break;
              default:
                  return false;
          }
  
          return true;
  }
  </code></pre>
  
  <p>Thanx in advance</p>