Skip to content

Commit

Permalink
implemented setting up camera
Browse files Browse the repository at this point in the history
  • Loading branch information
jaym21 committed Dec 19, 2021
1 parent 08b9d72 commit 8bdfb8e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/src/main/java/dev/jaym21/skanner/ui/TextExtractFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,23 @@ class TextExtractFragment : Fragment() {
}
}
private fun initialize() {
binding?.viewFinder?.post {
setUpCamera()
}
}

private fun setUpCamera() {
val cameraProviderFuture = ProcessCameraProvider.getInstance(requireContext())
cameraProviderFuture.addListener({
cameraProvider = cameraProviderFuture.get()

bindCameraUseCases()
})
}

private fun bindCameraUseCases() {

}

private fun checkCameraPermissions(context: Context, permissions: Array<String>): Boolean = permissions.all {
ActivityCompat.checkSelfPermission(context, it) == PackageManager.PERMISSION_GRANTED
Expand Down

0 comments on commit 8bdfb8e

Please sign in to comment.