removing another redundant function

This commit is contained in:
tibbi 2018-05-30 16:40:46 +02:00
parent 250bf176c1
commit 7ff48fc880
3 changed files with 3 additions and 12 deletions

View File

@ -13,8 +13,6 @@ interface MyPreview {
fun setFlashlightState(state: Int)
fun setCamera(cameraId: Int): Boolean
fun getCameraState(): Int
fun showChangeResolutionDialog()

View File

@ -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)

View File

@ -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() {