mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-20 01:31:29 +02:00
Extract ZoomableImageDialog for reuse
This commit is contained in:
@@ -57,29 +57,32 @@ fun ZoomableImageView(word: String) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (dialogOpen) {
|
if (dialogOpen) {
|
||||||
Dialog(
|
ZoomableImageDialog(word, onDismiss = { dialogOpen = false })
|
||||||
onDismissRequest = { dialogOpen = false },
|
}
|
||||||
properties = DialogProperties(usePlatformDefaultWidth = false)
|
}
|
||||||
) {
|
|
||||||
Surface(modifier = Modifier.fillMaxSize(), color = MaterialTheme.colors.background) {
|
@Composable
|
||||||
Column(
|
fun ZoomableImageDialog(imageUrl: String, onDismiss: () -> Unit) {
|
||||||
modifier = Modifier.padding(10.dp)
|
Dialog(
|
||||||
|
onDismissRequest = onDismiss,
|
||||||
|
properties = DialogProperties(usePlatformDefaultWidth = false)
|
||||||
|
) {
|
||||||
|
Surface(modifier = Modifier.fillMaxSize(), color = MaterialTheme.colors.background) {
|
||||||
|
Column(
|
||||||
|
modifier = Modifier.padding(10.dp)
|
||||||
|
) {
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth(),
|
||||||
|
horizontalArrangement = Arrangement.SpaceBetween,
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
Row(
|
CloseButton(onCancel = onDismiss)
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxWidth(),
|
|
||||||
horizontalArrangement = Arrangement.SpaceBetween,
|
|
||||||
verticalAlignment = Alignment.CenterVertically
|
|
||||||
) {
|
|
||||||
CloseButton(onCancel = {
|
|
||||||
dialogOpen = false
|
|
||||||
})
|
|
||||||
|
|
||||||
SaveToGallery(url = word)
|
SaveToGallery(url = imageUrl)
|
||||||
}
|
|
||||||
|
|
||||||
ZoomableAsyncImage(word)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ZoomableAsyncImage(imageUrl)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user