removing another redundant function
This commit is contained in:
parent
250bf176c1
commit
7ff48fc880
|
@ -13,8 +13,6 @@ interface MyPreview {
|
|||
|
||||
fun setFlashlightState(state: Int)
|
||||
|
||||
fun setCamera(cameraId: Int): Boolean
|
||||
|
||||
fun getCameraState(): Int
|
||||
|
||||
fun showChangeResolutionDialog()
|
||||
|
|
|
@ -124,13 +124,10 @@ class PreviewCameraOne : ViewGroup, SurfaceHolder.Callback, MyPreview {
|
|||
}
|
||||
}
|
||||
|
||||
override fun resumeCamera() = setCamera(mCurrCameraId)
|
||||
|
||||
override fun setCamera(cameraId: Int): Boolean {
|
||||
mCurrCameraId = cameraId
|
||||
override fun resumeCamera(): Boolean {
|
||||
val newCamera: Camera
|
||||
try {
|
||||
newCamera = Camera.open(cameraId)
|
||||
newCamera = Camera.open(mCurrCameraId)
|
||||
mCallback.setIsCameraAvailable(true)
|
||||
} catch (e: Exception) {
|
||||
mActivity!!.showErrorToast(e)
|
||||
|
@ -204,7 +201,7 @@ class PreviewCameraOne : ViewGroup, SurfaceHolder.Callback, MyPreview {
|
|||
|
||||
mConfig.lastUsedCamera = mCurrCameraId
|
||||
releaseCamera()
|
||||
if (setCamera(mCurrCameraId)) {
|
||||
if (resumeCamera()) {
|
||||
setFlashlightState(FLASH_OFF)
|
||||
mActivity?.updateCameraIcon(mCurrCameraId == mCameraImpl!!.getFrontCameraId())
|
||||
mActivity?.toggleTimer(false)
|
||||
|
|
|
@ -401,10 +401,6 @@ class PreviewCameraTwo : ViewGroup, TextureView.SurfaceTextureListener, MyPrevie
|
|||
checkFlashlight()
|
||||
}
|
||||
|
||||
override fun setCamera(cameraId: Int): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun getCameraState() = mCameraState
|
||||
|
||||
override fun showChangeResolutionDialog() {
|
||||
|
|
Loading…
Reference in New Issue