move preview resuming to a separate function

This commit is contained in:
tibbi 2016-11-24 18:35:16 +01:00
parent 69c269d7c6
commit b7e0285aa4
1 changed files with 14 additions and 10 deletions

View File

@ -301,6 +301,15 @@ public class Preview extends ViewGroup
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
resumePreview();
}
}, PHOTO_PREVIEW_LENGTH);
new PhotoProcessor(mActivity, mTargetUri).execute(data);
}
};
private void resumePreview() {
if (mCamera != null) {
mCamera.startPreview();
}
@ -312,11 +321,6 @@ public class Preview extends ViewGroup
mCamera.setParameters(mParameters);
}
}
}, PHOTO_PREVIEW_LENGTH);
new PhotoProcessor(mActivity, mTargetUri).execute(data);
}
};
private Camera.Size getOptimalPictureSize() {
final int maxResolution = Config.Companion.newInstance(mContext).getMaxPhotoResolution();