This library contains a base Fragment and Activity class that allow for easier handling of Runtime Permission requests and their various outcomes (granted, denied, blocked).
To have access to the library, add the dependency to your build.gradle:
The basic steps to implement this library are as follows:
- Extend PermissionsActivity or PermissionsFragment.
- Implement (or create a class that implements)
- Add the implementation of your permissions calls! This may very depending on what you want to do with the results. For an example, look at the
permissionsCheck()method in the MainActivity of the sample.
The PermissionsManager interface has three callback methods.
onPermissionGranted- The user granted the app permission for a given feature.
onPermissionDenied- The user denied the app permission for a given feature.
onPermissionBlocked- The user denied and checked "Never ask again." for the given feature.
Credits & Contact
This library was created by Adam McNeilly.
- Initial release.
The PermissionsManager library is available under the MIT License. You are free to modify and enhance it in any way. If you submit a pull request, please add your name into the credits section!