title: Using ViewTreeObserver's addOnGlobalLayoutListener to get XY position, returns 0 for view.getX() on Rotation
body: <p>Below code snippet shows how i am trying access view X and Y cords but it returns <code>Y</code> value accurate but <code>X</code> returns <code>0</code> always.</p>
  
  <p><strong>Code Snippet :</strong>  </p>
  
  <pre><code>ViewGroup vg = (ViewGroup)(blockView.getParent());
  vg.setRotation(-45f);
  vg.setRotationX(55f);
  ViewTreeObserver vto2 = blockView.getViewTreeObserver();
  vto2.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
         @Override
         public void onGlobalLayout()   {                                       
          System.out.println("Block VIEW X &gt; " + blockView.getX()); //returns 0
          System.out.println("Block VIEW Y &gt; " + blockView.getY()); //returns value.
  
         }
   });
  </code></pre>
  
  <p>So can any one tell me what change i should do or suggest some other approach to do the same. </p>