title: Android Fotoapparat Camera - Flickering under fluorescent lights
body: <p>I've been trying to use Fotoapparat (Java) on my app, but I'm getting random black bars on some devices (flickering, like when you point the camera to a LED display), when the picture is taken under artificial lighting.
  I've tried to use the antiBandingMode (all 4 default options: auto, 50hz, 60hz and off) in the camera configuration, but the problem persists.</p>
  
  <p>Funny thing is, this problem does not occur when I'm using the regular camera app on those devices, only when using Fotoapparat in my app.</p>
  
  <p>Sample:</p>
  
  <p><a href="https://i.stack.imgur.com/9kLku.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9kLku.png" alt="enter image description here"></a></p>
  
  <p>CameraConfiguration code:</p>
  
  <pre><code>private CameraConfiguration cameraConfiguration = CameraConfiguration
              .builder()
              .photoResolution(standardRatio(
                      highestResolution()
              ))
              .focusMode(firstAvailable(
                      continuousFocusPicture(),
                      autoFocus(),
                      fixed()
              ))
              .antiBandingMode(firstAvailable(
                      auto(),
                      hz60(),
                      hz50(),
                      none()
              ))
              .flash(firstAvailable(
                      off()
              ))
              .previewFpsRange(highestFps())
              .sensorSensitivity(highestSensorSensitivity())
              .build();
  </code></pre>
  
  <p>Fotoapparat initializer:</p>
  
  <pre><code>private Fotoapparat createFotoapparat() {
          return Fotoapparat
                  .with(this)
                  .into(cameraView)
                  .previewScaleType(ScaleType.CenterInside)
                  .lensPosition(back())
                  .focusMode(firstAvailable(
                          continuousFocusPicture(),
                          autoFocus(),
                          fixed()
                  ))
                  .logger(loggers(
                          logcat(),
                          fileLogger(this)
                  ))
                  .cameraErrorCallback(new CameraErrorListener() {
                      @Override
                      public void onError(@NotNull CameraException e) {
                          Toast.makeText(PictureActivity.this, getString(R.string.txt_erro_tirar_foto), Toast.LENGTH_SHORT).show();
                      }
                  })
                  .build();
      }
  </code></pre>
  
  <p>Any sugestions to help me handle this problem? I would realy like to keep using Fotoapparat, if possible.</p>
  
  <p>Thanks!</p>