mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-02-03 00:27:32 +01:00
move preview resuming to a separate function
This commit is contained in:
parent
69c269d7c6
commit
b7e0285aa4
@ -301,16 +301,7 @@ public class Preview extends ViewGroup
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mCamera != null) {
|
||||
mCamera.startPreview();
|
||||
}
|
||||
|
||||
mCanTakePicture = true;
|
||||
|
||||
if (mIsFlashEnabled) {
|
||||
mParameters.setFlashMode(Camera.Parameters.FLASH_MODE_OFF);
|
||||
mCamera.setParameters(mParameters);
|
||||
}
|
||||
resumePreview();
|
||||
}
|
||||
}, PHOTO_PREVIEW_LENGTH);
|
||||
|
||||
@ -318,6 +309,19 @@ public class Preview extends ViewGroup
|
||||
}
|
||||
};
|
||||
|
||||
private void resumePreview() {
|
||||
if (mCamera != null) {
|
||||
mCamera.startPreview();
|
||||
}
|
||||
|
||||
mCanTakePicture = true;
|
||||
|
||||
if (mIsFlashEnabled) {
|
||||
mParameters.setFlashMode(Camera.Parameters.FLASH_MODE_OFF);
|
||||
mCamera.setParameters(mParameters);
|
||||
}
|
||||
}
|
||||
|
||||
private Camera.Size getOptimalPictureSize() {
|
||||
final int maxResolution = Config.Companion.newInstance(mContext).getMaxPhotoResolution();
|
||||
final List<Camera.Size> sizes = mParameters.getSupportedPictureSizes();
|
||||
|
Loading…
x
Reference in New Issue
Block a user