The PermissionsApp demonstrates how to handle runtime permissions in android compose. Camera permission is used here, hence the name. Google accompanist library is used here.
The app works like this: https://user-images.githubusercontent.com/82358330/188303697-a8c69c6a-8d78-49df-b688-8dec91cbca11.mp4
Permission dialog is prompted as:
The screen that appears first, has a place holder at its focus, where currently lies an icon, for the clicked image to be displayed later. Down below is a button to open the camera, followed by the text which shows the state of the camera permission.
- The user is asked to enable camera permission, since it is not allowed initially.
- If the user denies the first time, and tries to reopen, the permission dialog is prompted again.
- If the permission is denied the second time, then the user will have to change the permissions in settings manually.
