应该如何实现从 Jetpack Compose View 请求许可?我正在尝试使用 Jetpack Compose 实现访问相机的应用程序。我尝试了如何在 Jetpack Compose 中获取当前状态或上下文的示例 不幸的是,示例不再适用于 dev06。
fun hasPermissions(context: Context) = PERMISSIONS_REQUIRED.all {
ContextCompat.checkSelfPermission(context, it) == PackageManager.PERMISSION_GRANTED
}
}
}
Run Code Online (Sandbox Code Playgroud) 如何在 Gradle 中将这段代码从 Groovy 转换为 Kotlin DSL?
testOptions.unitTests.all {
testLogging {
exceptionFormat = "full"
events "passed", "failed", "standardError"
showCauses true
showExceptions true
}
}
Run Code Online (Sandbox Code Playgroud)