The camera is not full screen on Pixel 2
bembem1011 opened this issue · comments
@bembem1011 I don't think the camera was supposed to be full screen. It's also not full screen on my device.
You're probably confused because the demo gifs are showing it full screen, but I believe the gifs were cropped since they only serve for demonstration purposes.
Update: I misunderstood the issue. I thought you were talking about the status and navigation bars being visible. I hadn't noticed the black bar on the side.
Thanks for the report!
Black bar on the right side is because the aspect ratio (h/w) of camera ration is larger than the screen one and we force it to be fitted into screen. Committed a change to make it always match screen width.
3ae5250
Downside of this strategy is a small portion of camera preview will be invisible to user, but it's supposed to a rare case (common one is the opposite, i.e. camera aspect ratio is smaller) and makes UI look prettier and more symmetric.
@zhouyiself can you help me ?
i cant remove the white space in the bottom of camera.
That white space is for result fragment..and i didnt use it.
@lucazin In order to remove the whitespaces you should make a change in CameraSource file not CameraSourcePreview.
In selectedSizePair method you should get the highest resolution preview, not the one which is in the range from MIN_CAMERA_PREVIEW_WIDTH to MAX_CAMERA_PREVIEW_WIDTH.
I change that if method to continue looping when previewsize.width is smallest than selectedPair.preview.width