title: imageview resizing while dragging a image in layout in android
body: <p>I am creating an android application in which i need to drag imageview. i tried using layout params and its moving fine but when the image moves nearby right and bottom corner of device then imageview became resizing. i dont know why this happens. my code is below what i tried.</p>
  
  <pre><code> if (me.getAction() == MotionEvent.ACTION_MOVE) {
                      drag=true;
  
                      if(drag){
                          int x=(int) (me.getRawX());
                          int y=(int) (me.getRawY());
  
      innerlayout.setLayoutParams(new RelativeLayout.LayoutParams(innerlayout.getLayoutParams().width, innerlayout.getLayoutParams().height));
                   LayoutParams params = (LayoutParams) innerlayout.getLayoutParams();
                   params.leftMargin = x-25;
                   params.topMargin = y-75;
                  innerlayout.setLayoutParams(params);
                                                          }
  
                  }
  
  
                  else if(me.getAction() == MotionEvent.ACTION_UP)
  
                  {
                      drag=false;
  
  
                  }
                  return true;
              }
          });
  </code></pre>