项目配置环境
*gradle-6.6.1-bin.zip
*Kotlin 1.4.0
*AndroidX
*compileSdkVersion 29
*buildToolsVersion "29.0.3"
*1、PermissionResultDialog
Maven
implementation 'com.redcattomato.permissionr.core:PermissionR:1.0.3'
Activity, Fragment, Dialog
PermissionRBuilder(this)
.permission(
Manifest.permission.CAMERA,
Manifest.permission.READ_EXTERNAL_STORAGE,
).setListener(object : PermissionRListener {
override fun onReady(permissionInfoList: List<PermissionRInfo>) {
//Do your thing
}
override fun onFailed(permissionList: List<String>) {
//Do your thing
}
override fun allSuccess() {
//Do your thing
}
})
.useDialog(true)
.must(true)
.build()