Skip to content

Commit f629522

Browse files
authored
Update README.md
1 parent 91d1d0b commit f629522

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1+
[![](https://jitpack.io/v/KingsMentor/Rationale.svg)](https://jitpack.io/#KingsMentor/Rationale)
12
# Rationale
23
Android permission Rationale Helper.
34
Similar to WhatsApp Permission Rationale Dialog that manages permission request .
45

56
![advisible flow to use on handling permissions](http://share.gifyoutube.com/g5K0Y9.gif "The New Flow")
7+
8+
#### How it Works.
9+
10+
1. Init with a list of Permission called SmoothPermissions
11+
2. Rationale runs a check on all SmoothPermissions to determine which Permission to show a message for
12+
3. if the list is empty, it returns success with empty list
13+
4. if there is any permission to be granted, it shows the appropraite rationale to the user
14+
5. returns permissions to be requested for based on user interaction
15+
616
# Adding Rationale to your Project
717

818
**Step 1** Add it in your root build.gradle at the end of repositories:
@@ -45,3 +55,17 @@ final PermissionDetails smsPermissionDetails = new PermissionDetails().getPermis
4555
.addSmoothPermission(new SmoothPermission(smsPermissionDetails))
4656
.includeStyle(R.style.Beliv_RationaleStyle).build(true);
4757
```
58+
59+
- requestCode - request code to track response from onActivityResult
60+
- includeStyle - styling the Rationale Dialog. more details on styling is found below
61+
- SmoothPermissions - List of Permission to run Rationale Dialog on
62+
- build - takes `true` for Rationale Dialog to show Permission that has not been granted. `false` to only show rationale for permission permanently denied.
63+
##### PermissionDetails
64+
Build permission with :
65+
- Permission name
66+
- Permission Icon
67+
- rationaleMessage
68+
- deniedMessage - message to display when Permission is permanently denied by the user
69+
- description - System Permission Description
70+
- protectionLevel - Protection level of permission
71+

0 commit comments

Comments
 (0)