Activates singleTap to double zoom in images
This commit is contained in:
@@ -12,7 +12,6 @@ import androidx.compose.animation.fadeOut
|
|||||||
import androidx.compose.foundation.ExperimentalFoundationApi
|
import androidx.compose.foundation.ExperimentalFoundationApi
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.combinedClickable
|
import androidx.compose.foundation.combinedClickable
|
||||||
import androidx.compose.foundation.interaction.MutableInteractionSource
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.BoxWithConstraints
|
import androidx.compose.foundation.layout.BoxWithConstraints
|
||||||
@@ -812,15 +811,14 @@ private fun RenderImageOrVideo(
|
|||||||
if (content is ZoomableUrlImage) {
|
if (content is ZoomableUrlImage) {
|
||||||
val mainModifier = Modifier
|
val mainModifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.zoomable(rememberZoomState())
|
.zoomable(
|
||||||
.clickable(
|
rememberZoomState(),
|
||||||
interactionSource = remember { MutableInteractionSource() },
|
onTap = {
|
||||||
indication = null // Avoid flashing on click
|
if (onToggleControllerVisibility != null) {
|
||||||
) {
|
onToggleControllerVisibility()
|
||||||
if (onToggleControllerVisibility != null) {
|
}
|
||||||
onToggleControllerVisibility()
|
|
||||||
}
|
}
|
||||||
}
|
)
|
||||||
|
|
||||||
UrlImageView(
|
UrlImageView(
|
||||||
content = content,
|
content = content,
|
||||||
@@ -846,15 +844,14 @@ private fun RenderImageOrVideo(
|
|||||||
} else if (content is ZoomableLocalImage) {
|
} else if (content is ZoomableLocalImage) {
|
||||||
val mainModifier = Modifier
|
val mainModifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.zoomable(rememberZoomState())
|
.zoomable(
|
||||||
.clickable(
|
rememberZoomState(),
|
||||||
interactionSource = remember { MutableInteractionSource() },
|
onTap = {
|
||||||
indication = null // Avoid flashing on click
|
if (onToggleControllerVisibility != null) {
|
||||||
) {
|
onToggleControllerVisibility()
|
||||||
if (onToggleControllerVisibility != null) {
|
}
|
||||||
onToggleControllerVisibility()
|
|
||||||
}
|
}
|
||||||
}
|
)
|
||||||
|
|
||||||
LocalImageView(
|
LocalImageView(
|
||||||
content = content,
|
content = content,
|
||||||
|
|||||||
Reference in New Issue
Block a user