Resize View in WindowManager in android
<p>I would like to re-size my view which is created using service in Windowmanager on touch I have changed height and width it is working properly. </p>

<p>But I have found that <strong>params.x</strong> and <strong>params.y</strong> is not changing so it is moving at the time of resizing the view.</p>

<p>And for that I found this values for different situation </p>

<ul>
<li><p>when view is <strong>small</strong>
and at <strong>top left</strong> params.x = -310 params.y = -826</p></li>
<li><p>when view is <strong>small</strong> and at <strong>bottom left</strong> params.x = -364 params.y = 958</p></li>
<li><p>when view is <strong>big</strong> and at <strong>top left</strong> params.x = -253 params.y = -657</p></li>
<li><p>when view is <strong>big</strong> and at <strong>bottom left</strong> params.x = -323 params.y = 888</p>

<p>and this is my code of ontouch</p>

<pre><code>                    case MotionEvent.ACTION_DOWN:
                        initialX = params.width;
                        initialY = params.height;
                        initialTouchX = event.getRawX();
                        initialTouchY = event.getRawY();
                        Log.w("DOWN","X="+params.x+" Y="+params.y);
                        return true;

                    case MotionEvent.ACTION_MOVE:
                        params.width = (int) (initialX + (int) (event.getRawX() - initialTouchX));
                        params.height = (int) (initialY + (int) (event.getRawY() - initialTouchY));
                        Log.w("MOVE","X="+params.x+" Y="+params.y);
                        windowManager.updateViewLayout(videoLoder, params);
                        return true;
</code></pre></li>
<li><p>How to get params.x and params.y as change in the height and width ?    </p></li>
<li><p>And how this params.x and params.y is calculated?</p></li>
</ul>

<p>I have found the some sort of <a href="https://stackoverflow.com/questions/20829800/android-resize-view-in-windowmanager">similar question</a> but answered yet. </p>