Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
private fun checkPermissions() {
if (allPermissionsGranted()) {
startCamera()
} else {
cameraPermission.launch(Manifest.permission.CAMERA)
}
}
private fun allPermissionsGranted() = REQUIRED_PERMISSIONS.all {
ContextCompat.checkSelfPermission(
requireContext(), it
) == PackageManager.PERMISSION_GRANTED
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment