title: Change absolute position with FrameLayout
body: <p>I has a View that should be displayed at a specific position over some images, I already did that using AbsoluteLayout, but I don't want to use it and I'm trying to get the same result with a FrameLayout.</p>
  
  <p>But I can't get this working, this is my two attempts:</p>
  
  <pre><code>public void showVideo(RectF bounds) {
      FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) video.getLayoutParams();
      params.width = (int) bounds.width();
      params.height = (int) bounds.height();
      int x = (int) viewer.getPageXOffset();
      int y = (int) viewer.getPageYOffset();
  
      video.setPadding((int) (x + bounds.left), (int) (y + bounds.top), (int) (x + bounds.right),
              (int) (y + bounds.bottom));
  
      video.setLayoutParams(params);
      video.invalidate();
  
      video.setVisibility(View.VISIBLE);
      video.setFocusable(true);
      video.setFocusableInTouchMode(true);
      video.requestFocus();
  }
  </code></pre>
  
  <p>And:</p>
  
  <pre><code>public void showVideo(RectF bounds, final String videoUrl) {
      FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) video.getLayoutParams();
      params.width = (int) bounds.width();
      params.height = (int) bounds.height();
      int x = (int) (viewer.getPageXOffset() + bounds.left);
      int y = (int) (viewer.getPageYOffset() + bounds.top);
  
      params.leftMargin = x;
      params.topMargin = y;
  
      video.setLayoutParams(params);
      video.invalidate();
  
      video.setVisibility(View.VISIBLE);
      video.setFocusable(true);
      video.setFocusableInTouchMode(true);
      video.requestFocus();
  }
  </code></pre>
  
  <p>But in both cases, the VideoView are displayed at v(0,0) (left-top corner).</p>