Activates singleTap to double zoom in images

This commit is contained in:
Vitor Pamplona 2023-10-20 13:54:58 -04:00
parent 87e8948d9a
commit 39d84e33bb

View File

@ -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,