Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken back button press #499

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -507,11 +507,6 @@ open class MainActivity : AppCompatActivity(),
}

override fun onKeyUp(keyCode: Int, event: KeyEvent?): Boolean {
if (keyCode == KeyEvent.KEYCODE_BACK) {
finish()
return true
}

// there are no camera controls in qr mode
if (camConfig.isQRMode) {
return super.onKeyUp(keyCode, event)
Expand All @@ -535,15 +530,15 @@ open class MainActivity : AppCompatActivity(),
cameraControl.zoomOut()
}
}
return true
return super.onKeyUp(keyCode, event)
}

override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean {
if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN || keyCode == KeyEvent.KEYCODE_VOLUME_UP) {
// Pretend as if the event was handled by the app (avoid volume bar from appearing)
return true
}
return super.onKeyUp(keyCode, event)
return super.onKeyDown(keyCode, event)
}

override fun onResume() {
Expand Down
Loading