vmadalin / easypermissions-ktx

🔓 Kotlin version of the popular google/easypermissions wrapper library to simplify basic system permissions logic on Android M or higher.
https://firebaseopensource.com/projects/googlesamples/easypermissions/
Apache License 2.0
380 stars 38 forks source link

Added A Flow to Use Standard or Custom Rationale #9

Open sacastrillon opened 3 years ago

sacastrillon commented 3 years ago

Summary This refactor allows users to use Easy Permissions Rationale (standard rationale) or create a custom rationale to be used in Easy Permissions flow, according to Android Guidelines to ask for Android Permissions. Standard Rationale: It's a very basic AlertDialog (already implemented on the library). Custom Rationale: It's a Lambda function where you can place a custom dialog of your preference.

Motivation This new flow was motivated by the lack of use of custom rational dialogs with the Easy Permission library. The library is powerful and helps a lot since you don't need to handle asking for Android permission on your own, but it lacks a way to use custom Rational Dialogs created following app UI guidelines. So, I’ve proposed a method that allows Easy Permissions users to decide which path to take: Standard Rationale or Custom Rationale.