This is working as designed, though what you want will be in the 0.6.0 version.
Quoting an upcoming version of the project README
:
The default behavior of CameraFragment
and CameraView
is to show the entire
preview, as supplied by the underlying Camera
API. Since the aspect ratio of
the preview frames may be different than the aspect ratio of the CameraView
,
this results in a "letterbox" effect, where the background will show through on
one axis on the sides.
If you want the preview to completely fill the CameraView
, at the cost of
cropping off some of the actual preview frame, have your CameraHost
return true
from useFullBleedPreview()
.
Note that the pictures and videos taken by this library are unaffected by
useFullBleedPreview()
. Hence, if useFullBleedPreview()
returns true
, the
picture or video may contain additional content on the edges that was not
visible in the preview.
Support for useFullBleedPreview()
will be in version 0.6.0 of the library, though the source code for it is already pushed to the repo and is available in the master
branch. You are welcome to keep tabs on this issue for further developments.