google / accompanist

A collection of extension libraries for Jetpack Compose
https://google.github.io/accompanist
Apache License 2.0
7.34k stars 593 forks source link

[Permissions] A better way to handle permissions easier. #1694

Closed erfansn closed 11 months ago

erfansn commented 11 months ago

Description

Unfortunately, the current API is not something that makes the work of programmers easier, and everyone should rewrite the logic based on possible scenarios. Based on the topics that were raised in previous issues, I have a new solution to propose, which is based on callback work. and handles the following scenarios correctly, and if approved, I will create the corresponding pull request:

bentrengrove commented 11 months ago

We aren't looking to change how Accompanist permissions works at this time. I would encourage you to release your own library with this idea. Thanks for the submission.

akardas16 commented 11 months ago

Description

Unfortunately, the current API is not something that makes the work of programmers easier, and everyone should rewrite the logic based on possible scenarios. Based on the topics that were raised in previous issues, I have a new solution to propose, which is based on callback work. and handles the following scenarios correctly, and if approved, I will create the corresponding pull request:

I am using similar to your solution in android view system, there are some cases which android remove all permissions if app is not used in long time by user but values stored in shared preferences won't change in that case. How will this affect solution you described?