-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gravity #5
base: master
Are you sure you want to change the base?
Gravity #5
Conversation
Gravity allows to center preview with Fill/Fit effect in case CameraView size/ratio is not the same as supported by camera size/ratio
`adjustViewBounds` doesn't affect gravity behavior when CameraView's width & height = match_parent
I'm also thinking... because this is a fork, there is no way to create issues. And as the original repo is not supported, does it make sense to make a repo clone? Should we contact original repo owner if he doesn't mind? |
Hello @alexshikov , thanks, this looks nice! If you are using Work on the cameraview of the RNCamera would be REALLY useful and help tons of people. Send PR there if you want to impact more people! Thanks! |
@jgfidelis I'm not using Though, some features I need are actually implemented in RNCamera and it would make more sense to transfer them from the RNCamera to the CameraView. I think having CameraView library independent from RNCamera is good idea. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this help some issues on layout and preview size
@sibelius @jgfidelis what's the procedure of PR merge in? I've another improvement coming https://github.com/alexshikov/cameraview/tree/choose_preview_size The new changes find the best ratio to match available space (if |
gravity
attribute for CameraViewDetails
My main goal to have an ability to center preview with
fill
orfit
options.gravity
option doesn't depend onadjustViewBounds
and seems they kind of used for different results. Ensure to setmatch_parent
for CameraView for both width and height.Centration code copied and adjusted from the RNCameraView.java so this might be a good reason to refactor
RNCameraView
and just usecenterFit
orcenterFill
option from the base class.I had to revert attributes loading from the xml, that have been deleted and hardcoded
mAdjustViewBounds = true
. This might break the react-native component. If that's the case, we probably should just set default style totrue
rather then hardcode it in the code.Further plans
I have more plans to improve the library, so it's just a first step to start a discussion on what I should be aware of to not break react-native component.
One of the next steps is to introduce an attribute to choose camera preview size for an available area using some strategy (ratio priority, size priority, etc.)
Another one is to support detectors (Barcode, Face, etc.).
Note: I'm going to use that library in Xamarin project, so I'll create bindings for the library and publish it to NuGet.