-
Notifications
You must be signed in to change notification settings - Fork 9
Home
EasyCam focused on two things
- Easy implementation of the camera in the app
- Easy Customization of camera view
This library handles all the logical parts internally and lets you implement a camera view within minutes.
EasyCam has Capture and Preview page. The Capture page is where the user has a preview of the camera preview (you can look at the image below). Each UI component on this page is customizable. The preview page contains a preview of the image taken. You can go through the list of images you had captured and delete them if required.
It stores the images taken in the external directory as files and returns in onActivityResult callback.
- Screen orientation handling
- Output image orientation handling
- Front and Back camera support
- Flash support
- Single and multiple photoshoot mode
- Set minimum and maximum count for multiple shoot mode
- Preview of taken photos
- Manual focus
- Live preview in full screen or fit the aspect ratio
- Delete option in multiple shoot mode
implementation 'in.balakrishnan.easycam:easycam:0.0.3-rc5'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0-rc03'
You can trigger the Camera Activity with the following code
Intent intent = new Intent(this, CameraControllerActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.putExtra("inputData", new CameraBundleBuilder()
.setFullscreenMode(false)
.setDoneButtonString("Add")
.setSinglePhotoMode(false)
.setMax_photo(3)
.setManualFocus(true)
.setBucketName(getClass().getName())
.setPreviewEnableCount(true)
.setPreviewIconVisiblity(true)
.setPreviewPageRedirection(true)
.setEnableDone(false)
.setClearBucket(true)
.createCameraBundle());
startActivityForResult(intent, 214);
You will get the result in the onActivityResult callback
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 214) {
if (resultCode == RESULT_OK) {
assert data != null;
list = data.getStringArrayExtra("resultData");
}
}
}
CameraBundleBuilder is a builder class used to configure the Camera View. With simple parameters, you will get the following screen