调整了餐盘在不同设备提示
This commit is contained in:
@@ -30,7 +30,7 @@ class PermissionHelper private constructor(
|
||||
/**
|
||||
* 检查是否已授予所有权限
|
||||
*/
|
||||
fun areAllPermissionsGranted(context: Context, permissions: Array<String>): Boolean {
|
||||
fun checkPermissions(context: Context, permissions: Array<String>): Boolean {
|
||||
return permissions.all { permission ->
|
||||
ContextCompat.checkSelfPermission(
|
||||
context,
|
||||
@@ -121,7 +121,7 @@ class PermissionHelper private constructor(
|
||||
* 检查并请求权限
|
||||
*/
|
||||
fun checkAndRequest() {
|
||||
if (areAllPermissionsGranted(context, permissions)) {
|
||||
if (checkPermissions(context, permissions)) {
|
||||
onGranted?.invoke()
|
||||
} else {
|
||||
requestPermissions()
|
||||
|
||||
Reference in New Issue
Block a user