Skip to content

Instantly share code, notes, and snippets.

@sagar-viradiya
Last active October 2, 2019 12:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sagar-viradiya/69928654f40774efdfeb4320b7bac5f1 to your computer and use it in GitHub Desktop.
Save sagar-viradiya/69928654f40774efdfeb4320b7bac5f1 to your computer and use it in GitHub Desktop.
PermissionResult sealed class
sealed class PermissionResult(val requestCode: Int) {
class PermissionGranted(requestCode: Int) : PermissionResult(requestCode)
class PermissionDenied(
requestCode: Int,
val deniedPermissions: List<String>
) : PermissionResult(requestCode)
class ShowRational(requestCode: Int) : PermissionResult(requestCode)
class PermissionDeniedPermanently(
requestCode: Int,
val permanentlyDeniedPermissions: List<String>
) : PermissionResult(requestCode)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment