saket / telephoto

Building blocks for designing media experiences in Compose UI
https://saket.github.io/telephoto/
Apache License 2.0
935 stars 29 forks source link

[Bug] onClick does not work after a double tap zoom gesture #18

Closed ammargitham closed 1 year ago

ammargitham commented 1 year ago

When using Modifier.zoomable(), the onClick is not called if zoomed using double tap.

Sample code:

Image(
    modifier = Modifier
        .fillMaxSize()
        .zoomable(
            state = zoomableState,
            onClick = { _ ->
                Log.d(TAG, "click")
            },
        ),
    painter = it,
    contentDescription = null,
)

The above onClick log is printed initially, but after doing a double tap it stop logging a single tap. On debugging it seems the variable isQuickZooming remains true even after the zoom animation is completed.

https://github.com/saket/telephoto/blob/5f0ed247d55394832fedc4813e0e53e82f6d6439/zoomable/src/main/kotlin/me/saket/telephoto/zoomable/Zoomable.kt#L92

Samuel-Unknown commented 1 year ago

I have the same issue 😢

saket commented 1 year ago

I'll make a release with this fix soon. In the meantime y'all can unblock yourself by using 0.4.0-SNAPSHOT.