Skip to content

Commit

Permalink
Merge pull request ministero-salute#162 from ministero-salute/fix/fla…
Browse files Browse the repository at this point in the history
…sh-fix-front-camera

feat: fix torch button
  • Loading branch information
astagi authored Oct 13, 2021
2 parents 47bbe92 + 765891a commit 71953cb
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,12 @@ class CodeReaderFragment : Fragment(), NavController.OnDestinationChangedListene
binding.barcodeScanner.cameraSettings.requestedCameraId = -1
}

if (!hasFlash() || viewModel.getFrontCameraStatus()) {
if (viewModel.getFrontCameraStatus()) {
binding.torchButton.visibility = View.INVISIBLE
}

if (!hasFlash()) {
binding.torchButton.visibility = View.GONE
} else {
binding.torchButton.setOnClickListener(this)
binding.barcodeScanner.setTorchListener(this)
Expand Down

0 comments on commit 71953cb

Please sign in to comment.