removing a redundant function
This commit is contained in:
parent
410822bd38
commit
184f87aab1
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -17,8 +17,6 @@ interface MyPreview {
|
|||
|
||||
fun getCameraState(): Int
|
||||
|
||||
fun releaseCamera()
|
||||
|
||||
fun showChangeResolutionDialog()
|
||||
|
||||
fun toggleFrontBackCamera()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -403,9 +403,6 @@ class PreviewCameraTwo : ViewGroup, TextureView.SurfaceTextureListener, MyPrevie
|
|||
|
||||
override fun getCameraState() = mCameraState
|
||||
|
||||
override fun releaseCamera() {
|
||||
}
|
||||
|
||||
override fun showChangeResolutionDialog() {
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue