From 815f044f772a9da67a8fad97d6cae9c93636bb59 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Thu, 12 Jan 2023 22:36:09 -0500 Subject: [PATCH] Better permission handling for images. --- .../amethyst/ui/actions/UploadFromGallery.kt | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/UploadFromGallery.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/UploadFromGallery.kt index 2e0c91ff3..e1a972386 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/UploadFromGallery.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/UploadFromGallery.kt @@ -55,19 +55,8 @@ fun UploadFromGallery(onImageChosen: (Uri) -> Unit) { } } else { Column { - val textToShow = if (cameraPermissionState.status.shouldShowRationale) { - // If the user has denied the permission but the rationale can be shown, - // then gently explain why the app requires this permission - "Grant access to quickly upload pictures before posting" - } else { - // If it's the first time the user lands on this feature, or the user - // doesn't want to be asked again for this permission, explain that the - // permission is required - "Grant access to quickly upload pictures before posting" - } - Text(textToShow) Button(onClick = { cameraPermissionState.launchPermissionRequest() }) { - Text("Request permission") + Text("Add Image from Gallery") } } }