Skip to content
This repository was archived by the owner on Jun 2, 2021. It is now read-only.

Handle different aspect ratios #1

Open
mateusfccp opened this issue Jan 15, 2020 · 1 comment
Open

Handle different aspect ratios #1

mateusfccp opened this issue Jan 15, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@mateusfccp
Copy link
Owner

mateusfccp commented Jan 15, 2020

Currently, the CameraPreview is aligned to the bottom.

When a device has an higher aspect ratio than the camera's, a black area will appear at the top, in the remaining space.

This is not that bad. However, MagicEye could handle it better, like Android default camera does.

Reference

My device (Xiaomi Mi 2 Lite) has a aspect ratio of 18:9. This is how Android camera handle aspect ratios:

18:9: When the camera matches the device aspect ratio, the preview is fullscreened.

18-9

16:9: When the camera aspect ratio is a little lower, the top control area becomes black, and the bottom remains as in 18:9.

16-9

4:3: When the aspect ratio is considerably lower, both top and bottom control areas become black and the preview is in between them.

4-3

Issue

The main issue on implementing this is the consideration about control layers. I can make the default camera layer behave well without much effort. However, what if someone would want to provide a custom control layer where all the controls should be at the bottom or top, for instance?

Considering this, it's possible to:

  1. Ignore the issue. This is easier and won't break anything.
  2. Provide a way to control the preview positioning with the control layer API. This takes more time and may result on a more complex API, or even API breakage.
@mateusfccp mateusfccp added the enhancement New feature or request label Jan 15, 2020
@mateusfccp mateusfccp modified the milestones: Version 1.1, Version 0.2.X Jan 15, 2020
@sgehrman sgehrman mentioned this issue Jan 25, 2020
@mateusfccp
Copy link
Owner Author

On afcee75, a little more flexibility has been given to control preview alignment.

This is, however, only a mitigation of the problem, as I needed for a personal project.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant