diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/camera/activities/MainActivity.kt index 8eb48732..b06abdb3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/activities/MainActivity.kt @@ -60,7 +60,7 @@ class MainActivity : SimpleActivity(), PreviewListener, PhotoProcessor.MediaSave super.onCreate(savedInstanceState) requestWindowFeature(Window.FEATURE_NO_TITLE) window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN) - mRes = resources + initVariables() tryInitCamera() supportActionBar?.hide() storeStoragePaths() @@ -68,6 +68,19 @@ class MainActivity : SimpleActivity(), PreviewListener, PhotoProcessor.MediaSave setupOrientationEventListener() } + private fun initVariables() { + mRes = resources + mIsInPhotoMode = false + mIsAskingPermissions = false + mIsCameraAvailable = false + mIsImageCaptureIntent = false + mIsVideoCaptureIntent = false + mIsHardwareShutterHandled = false + mCurrVideoRecTimer = 0 + mCurrCameraId = 0 + mLastHandledOrientation = 0 + } + override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean { return if (keyCode == KeyEvent.KEYCODE_CAMERA && !mIsHardwareShutterHandled) { mIsHardwareShutterHandled = true