How to Implement Pinch Zoom Gestures in Jetpack Compose - Android Studio Tutorial
HTML-код
- Опубликовано: 17 окт 2023
- In this video you'll learn how you can implement pinch, zoom and rotate gestures on any Composable in Android Studio.
💻 Let me be your mentor and become an industry-ready Android developer in 10 weeks:
pl-coding.com/drop-table-ment...
⭐ Courses with real-life practices
⭐ Save countless hours of time
⭐ 100% money back guarantee for 30 days
⭐ Become a professional Android developer now:
pl-coding.com/premium-courses...
Get my FREE PDF about 20 things you should never do in Jetpack Compose:
pl-coding.com/jetpack-compose...
Follow me on Instagram for insights into my live as an Android developer:
/ _philipplackner_
Get the source code for this video on GitHub:
github.com/philipplackner/Com...
that is the best explanation I've ever watch , it is so clear rather than documentation and any other video
Great content as always
Thanks for the great content.
Amazing Tutorial Buddy :)
Just what I needed! I basically just copy-pasted your code in the video 😅
Exellent resolve!
awesome, thanks
Greate content, Thanks
Great content as always,
This reminds me
There's a really interesting library by Saket Narayan for loading super high resolution images on Android
Cool!!!
Thnx for sharing Philip
Can you please show how to crop an image with compose?
사용하는 이미지가 기기 가로에 꽉 맞춰서 크지 않고 여백이 있는 경우는 여백만큼을 보정해야합니다. 그러므로 쉽게 테스트 하려면 Image 내부에 contentScale = ContentScale.Crop 을 추가해주시면 좋아요.
Thank you for the great tutorial Philipp, I would like to display images in LazyColumn and achieve same behaviour but I am not able to scroll. Any suggestion?
The main difference is I am using aspectRatio(1f / sqrt(2f)) in my box and Image. Would that make any difference?
Im currently working on a pinch to zoom implementation in compose. I searched the web for a long time without finding a 100% perfect implementation. As a user I expect the zoom to happen exactly in the area between my fingers and not in the central part of the image :(
This video featured in android weekly edition 592 explains how to achieve what, I believe, you want. Heve a nice one👋 ruclips.net/video/1tkVjBxdGrk/видео.htmlsi=Ewpjz_9FTi9DtGBN
I'm attempting to retrieve the offset of a tap-point on an image using detectTapGestures. However, I'm encountering a discrepancy in the offset values between when the image is zoomed in and when it's not.How can I accurately determine the offset for a clicked point when the image is zoomed in? Thank you for the great tutorial Philipp
Sooooo much easier than classic android
This works fine for one image but when there are multiple images like a carousal the next image takes the zoomed state of the first image and then it does not get reset while trying to zoom out. Need you inputs please.
👏
does anybody know how to implement this in XML type method
Hi Philipp, Thank you so much for the video. Could you also explain how to add clickable buttons ontop of the image, which keep their position even while zooming? Just like a google maps marker. I am searching for this since many months, but do not find a solution.
Put the image in a box with another box and in that other box you can put all buttons which will be drawn above the image
when i try the "zoom in" it actually expands more than the photo size... i have copied the code as it is... what could it be?
If you remove Surface and other parent layouts, it works.
@@raheemadamboev @Philip but in my use case I have to keep it in other parent layouts, and when I do so it expands beyond the boundaries of Image/Boxwithcontraints
😊
Thanks for video, but the application doesn't zoom, pan and even not clickable (at least, on emulator).
I'm using the same code, but I couldn't do the horizontal pager photos with zooming☹️
Awesome tutorial, but now try to put it inside a HorizontalPager 🙃
as long as I don't zoom once, panning doesn't work. what have I done wrong?
One doesn't end he brings up another, how much should I consume.😋