saket / telephoto

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

Feature: Possibility to turn off feature, when image can be panned when cropped #98

Open RadoslawGorczyca opened 3 weeks ago

RadoslawGorczyca commented 3 weeks ago

Hi, is it possible to add some kind of a flag allowing us to turn off following feature?

Unlike Image(), ZoomableImage can pan images even when they're cropped. This can be useful for applications like wallpaper apps that may want to use ContentScale.Crop to ensure that images always fill the screen.

Use case is that I have a horizontal pager and I want to allow user to pan cropped picture when the picture is zoomed in, but not when it's completely zoomed out, because when he try to scroll to the next page, image is panned and getting to next picture is allowed only when we pan to the edge of the picture.

I would really appreciate if you added this feature. Thank you in advance.

saket commented 3 weeks ago

but not when it's completely zoomed out, because when he try to scroll to the next page, image is panned and getting to next picture is allowed only when we pan to the edge of the picture.

I'm sorry, but I'm a bit confused. If the image is completely zoomed out, it shouldn't be possible to pan it any further, right?

Would it be possible for you to share a video of your use case?

RadoslawGorczyca commented 2 weeks ago

You see how I have to scroll picture to the edge to change page? I would like the panning feature available only when the picture is zoomed in. Otherwise I would like to have standard cropped picture with trimmed edges.

https://github.com/user-attachments/assets/3e81ad85-6b25-4fb6-bfc5-b9f956653b93

MHShetty commented 1 week ago

Hi @RadoslawGorczyca,

Could you please share your composable code related to this UI? Maybe that could help us help you out better

RadoslawGorczyca commented 1 week ago

I cannot share any part of the code other than using your lib, but I don't see how my code would help with anything. It's not an error, but lack of possibility to turn off feature that you added to lib. Other person also mentioned it in his issue.

RadoslawGorczyca commented 3 days ago

bump

saket commented 2 days ago

Sorry for the delay, I’ve been dealing with chickenpox. 🤒

RadoslawGorczyca commented 2 days ago

No worries, I hope you're okay 🤗