We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello
on the S3 jellybean detection does not work because camera can not focus close enough.
Here I added a checkbox in the main view after Seekbar
<CheckBox android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Macro" android:id="@+id/btnMacro" android:layout_above="@+id/CameraZoomControls" android:layout_centerHorizontal="true" />
Then I added code in CameraView to handle the checkbox
public void setMacroControl(CheckBox macroControl) { _macroControl = macroControl; _macroControl.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { Camera.Parameters params = mCamera.getParameters(); List<String> FocusModes = params.getSupportedFocusModes(); if (isChecked) { if (FocusModes != null && FocusModes.contains(Camera.Parameters.FOCUS_MODE_MACRO)) { params.setFocusMode(Camera.Parameters.FOCUS_MODE_MACRO); } } else { if (FocusModes != null && FocusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)) { params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO); } else if (FocusModes != null && FocusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE)) { params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE); } } mCamera.setParameters(params); } }); }
it is enabled in main activity with:
_resistorCameraView.setMacroControl((CheckBox) findViewById(R.id.btnMacro));
It will be very useful.
The text was updated successfully, but these errors were encountered:
Nice! If you make a pull request, I can merge these changes in.
Sorry, something went wrong.
you can also use some old fashioned copy-paste! I dont want to fork and all for 10 code lines :)
This code just has to be added, there is nothing to remove.
Heh, touché
No branches or pull requests
Hello
on the S3 jellybean detection does not work because camera can not focus close enough.
Here I added a checkbox in the main view after Seekbar
Then I added code in CameraView to handle the checkbox
it is enabled in main activity with:
It will be very useful.
The text was updated successfully, but these errors were encountered: