diff --git a/.idea/misc.xml b/.idea/misc.xml index 75b0ad7..f0830ab 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -5,6 +5,7 @@ + diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 0daf2b4..c6d94ce 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,7 +1,7 @@ - + , + grantResults: IntArray + ) { + super.onRequestPermissionsResult(requestCode, permissions, grantResults) + if (requestCode == 0) { + if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { + initView() + } else { + Toast.makeText(this, "camera permission denied", Toast.LENGTH_LONG).show() + } + } + } + + private fun initView() { setContent { CameraComposeWorkshopTheme { // A surface container using the 'background' color from the theme @@ -24,6 +65,7 @@ class MainActivity : ComponentActivity() { } } + @Composable fun Greeting(name: String) { Text(text = "Hello $name!")