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