title: Android Zxing change orientation to portrait
body: <p>I'm trying to rotate Zxing display after reading a few questions and posts about the issue.
  After following the instructions, the display did rotate, but the rectangle of the scanner
  is not positioned as it should (as can be seen on the image attached).</p>
  
  <p>This is what I have done:</p>
  
  <ol>
  <li><p>in CameraConfigurationManager:</p>
  
  <pre><code>camera.setDisplayOrientation(90);
  </code></pre></li>
  <li><p>in DecodeHandler.java</p>
  
  <pre><code>byte[] rotatedData = new byte[data.length];
      for (int y = 0; y &lt; height; y++) {
          for (int x = 0; x &lt; width; x++)
               rotatedData[x * height + height - y - 1] = data[x + y * width];
       }
  int tmp = width;         
  width = height;
  height = tmp;
  </code></pre></li>
  <li><p>in CameraManager.java:</p>
  
  <pre><code>rect.left = rect.left * cameraResolution.y / screenResolution.x;
  rect.right = rect.right * cameraResolution.y / screenResolution.x;
  rect.top = rect.top * cameraResolution.x / screenResolution.y;
  rect.bottom = rect.bottom * cameraResolution.x / screenResolution.y;
  </code></pre></li>
  </ol>
  
  <p><img src="https://i.stack.imgur.com/chtxF.png" alt="enter image description here"></p>