title: 1:1 Aspect Ratio in CameraX
body: <p>I've been trying to use CameraX in my android application and wants both preview and output image to be a quality 1:1 Aspect Ratio image.
  I tried the following code for setting the image and preview config</p>
  
  <pre><code>PreviewConfig previewConfig = new PreviewConfig.Builder()
                  .setTargetAspectRatio(new Rational(1, 1))
                  .build();
  </code></pre>
  
  <p>--</p>
  
  <pre><code>        ImageCaptureConfig imageCaptureConfig = new ImageCaptureConfig.Builder()
                  .setTargetAspectRatio(new Rational(1, 1))
                  .setCaptureMode(ImageCapture.CaptureMode.MIN_LATENCY)
                  .build();
  </code></pre>
  
  <p>According to the developer's guide this code would choose the best resolution the hardware could provide in that aspect ratio.
  Though this works well on some devices, on some devices the output image resolution is as low as 280X280 pixels.
  Seeming like that is not the valid aspect ratio for the hardware on that device.</p>
  
  <p>What can I try as a workaround?
  What I had in mind was that I think every device would support 4:3 Aspect Ratio.</p>
  
  <p>I can crop the output image but what about the preview. Can we crop the textureview?</p>
  
  <p>Or can I put a simple black rectangle-shaped view on top of the viewfinder seeming like it is 1:1 image?</p>