Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difficult to zoom inside pager #60

Closed
kmnaseef opened this issue Jan 2, 2024 · 8 comments
Closed

Difficult to zoom inside pager #60

kmnaseef opened this issue Jan 2, 2024 · 8 comments

Comments

@kmnaseef
Copy link

kmnaseef commented Jan 2, 2024

VID-20240102-WA0004.mp4

While trying to pinch zoom ZoomableAsyncImage used inside a HorizontalPager/VerticalPager, most of the time the pager changes the page instead of zooming. How I overcome this issue?

@saket
Copy link
Owner

saket commented Jan 21, 2024

Can this be reproduced in the sample by replacing the HorizontalPager with a VerticalPager?

@kmnaseef
Copy link
Author

yea. have the same issue for verticalPager also. only the direction changes.
is it possible to introduce a threshold to the horizontalPager/verticalPager for detecting drag?

@saket
Copy link
Owner

saket commented Jan 30, 2024

Can you share a video of telephoto's sample app with this problem? I can't seem to reproduce it.

@saket
Copy link
Owner

saket commented Feb 11, 2024

most of the time the pager changes the page instead of zooming

Here's a different theory: is this issue happening only when the placeholder image is visible? You can confirm this by adding a loading indicator while the full image is loading:

if (!imageState.isImageDisplayed) {
  CircularProgressIndicator()
}

@kmnaseef
Copy link
Author

Sorry for late reply. Problem exist for telephoto app also.

VID-20240212-WA0000.mp4

saket added a commit that referenced this issue Feb 14, 2024
@saket
Copy link
Owner

saket commented Feb 17, 2024

Thanks @kmnaseef! I made a small improvement to consume gestures immediately if multiple fingers/pointers are detected in 4c9118e. Can you give 0.8.0-SNAPSHOT a try?

@kmnaseef
Copy link
Author

Perfect bro... thank you very much..

@saket saket closed this as completed Feb 18, 2024
github-merge-queue bot pushed a commit to slackhq/circuit that referenced this issue Feb 18, 2024
…1215)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[me.saket.telephoto:zoomable-image-coil](https://togithub.com/saket/telephoto)
| dependencies | minor | `0.7.1` -> `0.8.0` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>saket/telephoto
(me.saket.telephoto:zoomable-image-coil)</summary>

### [`v0.8.0`](https://togithub.com/saket/telephoto/releases/tag/0.8.0)

[Compare
Source](https://togithub.com/saket/telephoto/compare/0.7.1...0.8.0)

Breaking changes

- Reordered `SubSamplingImage()`'s parameters to move `Modifier` below
all required parameters.

New changes

- Update Compose UI to `1.6.1` and Compose Multiplatform to `1.6.0-rc02`
- Introduced
[ZoomableState#transformedContentBounds](https://togithub.com/saket/telephoto/blob/706cf08cb976c0d9d9c6d0f95e4e64fc4efbf4ef/zoomable/src/commonMain/kotlin/me/saket/telephoto/zoomable/ZoomableState.kt#L88-L96)
for observing transformed content bounds. This can be used for drawing
decorations around the content or performing hit tests.
- Placeholder images now respond to click listeners. Additionally, they
will swallow all other zoom gestures instead of ignoring them.
-
[saket/telephoto#3:
Read color space of bitmaps from Coil and Glide.

Bug fixes

-
[saket/telephoto#60,
[saket/telephoto#65:
Improved detection of pinch-to-zoom gestures.
-
[saket/telephoto#8:
Composables with `Modifier.zoomable()` are now drawn on the first frame.
This fixes their broken layout preview.
-
[saket/telephoto#58:
Fixed a resource leak when an image's EXIF metadata is read.
- `ZoomableState#resetZoom()` now calculates the content's position on
the same UI frame.
- Images no longer flicker on start when they can't zoom-in any further.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xOTQuMyIsInVwZGF0ZWRJblZlciI6IjM3LjE5NC4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
@saket
Copy link
Owner

saket commented Feb 19, 2024

FWIW I filed a bug report against Compose UI because I believe the bug lies inside Modifier.transformable(): https://issuetracker.google.com/issues/325807994.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants