Skip to content

Instantly share code, notes, and snippets.

View adesamp's full-sized avatar
🏠

Ade Dyas adesamp

🏠
View GitHub Profile
fun Fragment.isGranted(permission: AppPermission) = run {
context?.let {
(PermissionChecker.checkSelfPermission(it, permission.permissionName
) == PermissionChecker.PERMISSION_GRANTED)
} ?: false
}
fun Fragment.shouldShowRationale(permission: AppPermission) = run {
shouldShowRequestPermissionRationale(permission.permissionName)
}