Skip to content

Commit

Permalink
Update Android CameraNew
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshLipan committed Jan 9, 2019
1 parent aa9f28f commit 90c3c92
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ public boolean getShowSelectAlbum() {
}

public float getCameraQuality() {
return this.cameraQuality;
return this.cameraQuality <= 0.01f ? 0.01f : this.cameraQuality;
}

public void setCameraQuality(float cameraQuality) {
this.cameraQuality = cameraQuality;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1530,4 +1530,9 @@ public FrameLayout getMenuContainer(){
return this.mMenuContainer;
}

public void setCameraQuality(float cameraQuality){
mStyle.setCameraQuality(cameraQuality);
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -784,12 +784,22 @@ private void unlockFocus() {
mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AF_TRIGGER,
CameraMetadata.CONTROL_AF_TRIGGER_CANCEL);
setAutoFlash(mPreviewRequestBuilder);
mCaptureSession.capture(mPreviewRequestBuilder.build(), mCaptureCallback,
mBackgroundHandler);
// After this, the camera will go back to the normal state of preview.
mState = STATE_PREVIEW;
mCaptureSession.setRepeatingRequest(mPreviewRequest, mCaptureCallback,
mBackgroundHandler);
if(mCaptureSession != null ){
boolean reprocessable = true;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
reprocessable = mCaptureSession.isReprocessable();
}
if(!reprocessable){
return;
}
mCaptureSession.capture(mPreviewRequestBuilder.build(), mCaptureCallback,
mBackgroundHandler);
// After this, the camera will go back to the normal state of preview.
mState = STATE_PREVIEW;
mCaptureSession.setRepeatingRequest(mPreviewRequest, mCaptureCallback,
mBackgroundHandler);
}

} catch (CameraAccessException e) {
e.printStackTrace();
}
Expand Down

0 comments on commit 90c3c92

Please sign in to comment.