mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-10-09 20:33:40 +02:00
Adding the same button style for before and after granted permissions
This commit is contained in:
@@ -44,13 +44,29 @@ fun UploadFromGallery(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
UploadBoxButton(isUploading) {
|
||||||
|
showGallerySelect = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
UploadBoxButton(isUploading) {
|
||||||
|
cameraPermissionState.launchPermissionRequest()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun UploadBoxButton(
|
||||||
|
isUploading: Boolean,
|
||||||
|
onClick: () -> Unit
|
||||||
|
) {
|
||||||
Box() {
|
Box() {
|
||||||
TextButton(
|
TextButton(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.align(Alignment.TopCenter),
|
.align(Alignment.TopCenter),
|
||||||
enabled = !isUploading,
|
enabled = !isUploading,
|
||||||
onClick = {
|
onClick = {
|
||||||
showGallerySelect = true
|
onClick()
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
@@ -70,21 +86,6 @@ fun UploadFromGallery(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
Column {
|
|
||||||
Button(
|
|
||||||
onClick = { cameraPermissionState.launchPermissionRequest() },
|
|
||||||
enabled = !isUploading
|
|
||||||
) {
|
|
||||||
if (!isUploading) {
|
|
||||||
Text(stringResource(R.string.upload_image))
|
|
||||||
} else {
|
|
||||||
Text(stringResource(R.string.uploading))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun GallerySelect(
|
fun GallerySelect(
|
||||||
|
Reference in New Issue
Block a user