PermissionsManager Library
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).
Usage
To have access to the library, add the dependency to your build.gradle:
compile 'com.adammcneilly:permissionsmanager:1.0.0'
Implementation
The basic steps to implement this library are as follows:
- Extend PermissionsActivity or PermissionsFragment.
- Implement (or create a class that implements)
PermissionsManager
. - 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.
PermissionsManager Interface
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.
Version History
1.0.0
- Initial release.
License
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!