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)
|
super.onCreate(savedInstanceState)
|
||||||
requestWindowFeature(Window.FEATURE_NO_TITLE)
|
requestWindowFeature(Window.FEATURE_NO_TITLE)
|
||||||
window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
|
window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
|
||||||
mRes = resources
|
initVariables()
|
||||||
tryInitCamera()
|
tryInitCamera()
|
||||||
supportActionBar?.hide()
|
supportActionBar?.hide()
|
||||||
storeStoragePaths()
|
storeStoragePaths()
|
||||||
|
@ -68,6 +68,19 @@ class MainActivity : SimpleActivity(), PreviewListener, PhotoProcessor.MediaSave
|
||||||
setupOrientationEventListener()
|
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 {
|
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
|
||||||
return if (keyCode == KeyEvent.KEYCODE_CAMERA && !mIsHardwareShutterHandled) {
|
return if (keyCode == KeyEvent.KEYCODE_CAMERA && !mIsHardwareShutterHandled) {
|
||||||
mIsHardwareShutterHandled = true
|
mIsHardwareShutterHandled = true
|
||||||
|
|
Loading…
Reference in New Issue