removing a redundant function

This commit is contained in:
tibbi 2018-05-30 15:02:26 +02:00
parent 410822bd38
commit 184f87aab1
4 changed files with 4 additions and 9 deletions

View File

@ -97,7 +97,6 @@ class MainActivity : SimpleActivity(), PreviewListener, PhotoProcessor.MediaSave
mFadeHandler.removeCallbacksAndMessages(null)
hideTimer()
mPreview?.releaseCamera()
mOrientationEventListener.disable()
if (mPreview?.getCameraState() == STATE_PICTURE_TAKEN) {
@ -108,7 +107,6 @@ class MainActivity : SimpleActivity(), PreviewListener, PhotoProcessor.MediaSave
override fun onDestroy() {
super.onDestroy()
mPreview?.releaseCamera()
mPreview = null
}

View File

@ -17,8 +17,6 @@ interface MyPreview {
fun getCameraState(): Int
fun releaseCamera()
fun showChangeResolutionDialog()
fun toggleFrontBackCamera()

View File

@ -115,7 +115,9 @@ class PreviewCameraOne : ViewGroup, SurfaceHolder.Callback, MyPreview {
override fun onResumed() {}
override fun onPaused() {}
override fun onPaused() {
releaseCamera()
}
override fun tryInitVideoMode() {
if (mIsSurfaceCreated) {
@ -502,7 +504,7 @@ class PreviewCameraOne : ViewGroup, SurfaceHolder.Callback, MyPreview {
}
}
override fun releaseCamera() {
fun releaseCamera() {
stopRecording()
mCamera?.stopPreview()
mCamera?.release()

View File

@ -403,9 +403,6 @@ class PreviewCameraTwo : ViewGroup, TextureView.SurfaceTextureListener, MyPrevie
override fun getCameraState() = mCameraState
override fun releaseCamera() {
}
override fun showChangeResolutionDialog() {
}