reinit the static variables at app launch
This commit is contained in:
parent
e721f43274
commit
e56e1f15d1
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue