title: Why getlocationonscreen returining -180 for x?
body: <p>I am using the google vision library (although this might not matter for the purpose of this question). Here is the xml file</p>
  
  <pre><code>&lt;LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/topLayout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:keepScreenOn="true"&gt;
  
      &lt;com.google.android.gms.samples.vision.ocrreader.ui.camera.CameraSourcePreview
          android:id="@+id/preview"
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
          &lt;com.google.android.gms.samples.vision.ocrreader.ui.camera.GraphicOverlay
              android:id="@+id/graphicOverlay"
              android:layout_width="match_parent"
              android:layout_height="match_parent" /&gt;
  
      &lt;/com.google.android.gms.samples.vision.ocrreader.ui.camera.CameraSourcePreview&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Now if do </p>
  
  <pre><code>@Override
  public void onWindowFocusChanged(boolean hasFocus) {
      super.onWindowFocusChanged(hasFocus);
      int  [] loc = new int[2];
      mPreview.getLocationOnScreen(loc);
      int  [] loc2 = new int[2];
      mGraphicOverlay.getLocationOnScreen(loc2);
  }
  </code></pre>
  
  <p>Then loc1 is {0,0} which is expected but loc2 is{-180,0}.</p>
  
  <p>Why is that? Shouldn't it be also 0,0?
  Thank you</p>
  
  <p>Here is the UI part from dympsys</p>
  
  <pre><code>  View Hierarchy:
            DecorView@55587bd[OcrLiveActivity]
              android.widget.LinearLayout{d743bae V.E...... ........ 0,0-1080,1920}
                android.view.ViewStub{b409d4f G.E...... ......I. 0,0-0,0 #1020471 android:id/action_mode_bar_stub}
                android.widget.FrameLayout{48b3cdc V.E...... ........ 0,0-1080,1920}
                  android.support.v7.widget.FitWindowsLinearLayout{9fc21e5 V.E...... ........ 0,0-1080,1920 #7f08000b app:id/action_bar_root}
                    android.support.v7.widget.ViewStubCompat{ecc64ba G.E...... ......I. 0,0-0,0 #7f080017 app:id/action_mode_bar_stub}
                    android.support.v7.widget.ContentFrameLayout{593bf6b V.E...... ........ 0,0-1080,1920 #1020002 android:id/content}
                      android.support.constraint.ConstraintLayout{bfd4ac8 V.E...... ........ 0,0-1080,1920 #7f0800d6 app:id/topLayout} 
  
  com.google.android.gms.samples.vision.ocrreader.ui.camera.CameraSourcePreview{651f761 V.E...... ........ 0,0-1080,1920 #7f080091 app:id/preview}
                          android.view.SurfaceView{4c1286 V.E...... ........ -180,0-1260,1920}               
  
  com.google.android.gms.samples.vision.ocrreader.ui.camera.GraphicOverlay{7ace747 V.ED..... ........ -180,0-1260,1920 #7f080058 app:id/graphicOverlay}
  </code></pre>