Skip to content
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 @@ -117,11 +117,7 @@ internal class LiveFeedbackFragment : Fragment(R.layout.fragment_live_feedback)
vm.initCapture(mainVm.bioSDK, mainVm.samplesToCapture, mainVm.attemptNumber)
}
}
if (vm.isAutoCapture) {
// Await until capture button is pressed
vm.holdOffAutoCapture()
binding.captureFeedbackBtn.isClickable = true
}
enableCaptureButtonIfAutoCapture()

binding.captureInstructionsBtn.setOnClickListener {
findNavController().navigateSafely(
Expand Down Expand Up @@ -185,9 +181,12 @@ internal class LiveFeedbackFragment : Fragment(R.layout.fragment_live_feedback)

override fun onResume() {
super.onResume()

when {
requireActivity().hasPermission(Manifest.permission.CAMERA) -> setUpCamera()
requireActivity().hasPermission(Manifest.permission.CAMERA) -> {
setUpCamera()
enableCaptureButtonIfAutoCapture()
}

mainVm.shouldCheckCameraPermissions.getAndSet(false) -> {
// Check permission in onResume() so that if user left the app to go to Settings
// and give the permission, it's reflected when they come back to SID
Expand All @@ -202,6 +201,14 @@ internal class LiveFeedbackFragment : Fragment(R.layout.fragment_live_feedback)
}
}

private fun enableCaptureButtonIfAutoCapture() {
if (vm.isAutoCapture) {
// Await until capture button is pressed
vm.holdOffAutoCapture()
binding.captureFeedbackBtn.isClickable = true
}
}

override fun onStop() {
toggleTorche(false)
// Shut down our background executor
Expand Down