Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
hexindaiyinzhengwei committed Dec 6, 2018
1 parent 13adf46 commit e4f4d83
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Step 2. Add the dependency

dependencies {

implementation 'com.github.yinzhengwei:permissiongranted:13.0'
implementation 'com.github.yinzhengwei:permissiongranted:14.0.0'

}

Expand Down
16 changes: 11 additions & 5 deletions app/src/main/java/com/yzw/permissiongranted/PermissionUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,17 @@ object PermissionUtils {
permissionGrantedCallback: PermissionGrantedCallback?
) {
notify = permissionGrantedCallback
context.startActivity(Intent(context, PermissionFetchUI::class.java).apply {
putExtra("psn", permission)
putExtra("permissionName", permissionName)
putExtra("isAllWaysRequest", isAllWaysRequest)
})

//如果传进来的权限都打开了就直接回调成功的结果,不需要跳转了
if (isOpenPermisson(context, permission)) {
notify?.granted()
} else {
context.startActivity(Intent(context, PermissionFetchUI::class.java).apply {
putExtra("psn", permission)
putExtra("permissionName", permissionName)
putExtra("isAllWaysRequest", isAllWaysRequest)
})
}
}

//打开某个权限
Expand Down

0 comments on commit e4f4d83

Please sign in to comment.