mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-04-23 06:54:52 +02:00
Activates singleTap to double zoom in images
This commit is contained in:
parent
87e8948d9a
commit
39d84e33bb
@ -12,7 +12,6 @@ import androidx.compose.animation.fadeOut
|
||||
import androidx.compose.foundation.ExperimentalFoundationApi
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.combinedClickable
|
||||
import androidx.compose.foundation.interaction.MutableInteractionSource
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.BoxWithConstraints
|
||||
@ -812,15 +811,14 @@ private fun RenderImageOrVideo(
|
||||
if (content is ZoomableUrlImage) {
|
||||
val mainModifier = Modifier
|
||||
.fillMaxSize()
|
||||
.zoomable(rememberZoomState())
|
||||
.clickable(
|
||||
interactionSource = remember { MutableInteractionSource() },
|
||||
indication = null // Avoid flashing on click
|
||||
) {
|
||||
if (onToggleControllerVisibility != null) {
|
||||
onToggleControllerVisibility()
|
||||
.zoomable(
|
||||
rememberZoomState(),
|
||||
onTap = {
|
||||
if (onToggleControllerVisibility != null) {
|
||||
onToggleControllerVisibility()
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
UrlImageView(
|
||||
content = content,
|
||||
@ -846,15 +844,14 @@ private fun RenderImageOrVideo(
|
||||
} else if (content is ZoomableLocalImage) {
|
||||
val mainModifier = Modifier
|
||||
.fillMaxSize()
|
||||
.zoomable(rememberZoomState())
|
||||
.clickable(
|
||||
interactionSource = remember { MutableInteractionSource() },
|
||||
indication = null // Avoid flashing on click
|
||||
) {
|
||||
if (onToggleControllerVisibility != null) {
|
||||
onToggleControllerVisibility()
|
||||
.zoomable(
|
||||
rememberZoomState(),
|
||||
onTap = {
|
||||
if (onToggleControllerVisibility != null) {
|
||||
onToggleControllerVisibility()
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
LocalImageView(
|
||||
content = content,
|
||||
|
Loading…
x
Reference in New Issue
Block a user