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...

Комментарии • 32

  • @yusufjonaxmed4488
    @yusufjonaxmed4488 Месяц назад +1

    that is the best explanation I've ever watch , it is so clear rather than documentation and any other video

  • @achmadichzan
    @achmadichzan 9 месяцев назад +3

    Great content as always

  • @developer.emad.mehrez
    @developer.emad.mehrez 9 месяцев назад

    Thanks for the great content.

  • @gamingpanther2583
    @gamingpanther2583 2 месяца назад

    Amazing Tutorial Buddy :)

  • @RexTorres
    @RexTorres 4 месяца назад +1

    Just what I needed! I basically just copy-pasted your code in the video 😅

  • @oleksiikravchenko5506
    @oleksiikravchenko5506 9 месяцев назад

    Exellent resolve!

  • @Vitaly-xu3ly
    @Vitaly-xu3ly 9 месяцев назад

    awesome, thanks

  • @ultraknown1270
    @ultraknown1270 2 месяца назад

    Greate content, Thanks

  • @gauravthakkar802
    @gauravthakkar802 9 месяцев назад +1

    Great content as always,
    This reminds me
    There's a really interesting library by Saket Narayan for loading super high resolution images on Android

  • @mr-re1ax
    @mr-re1ax 9 месяцев назад

    Cool!!!

  • @jovianswank300
    @jovianswank300 9 месяцев назад

    Thnx for sharing Philip
    Can you please show how to crop an image with compose?

  • @paehwang1
    @paehwang1 9 месяцев назад +1

    사용하는 이미지가 기기 가로에 꽉 맞춰서 크지 않고 여백이 있는 경우는 여백만큼을 보정해야합니다. 그러므로 쉽게 테스트 하려면 Image 내부에 contentScale = ContentScale.Crop 을 추가해주시면 좋아요.

  • @rpitpatel1004
    @rpitpatel1004 6 месяцев назад

    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?

  • @ioncatalindragomir3033
    @ioncatalindragomir3033 9 месяцев назад +5

    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 :(

    • @dujesrhoj5279
      @dujesrhoj5279 9 месяцев назад

      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

  • @PhilippSch148
    @PhilippSch148 4 месяца назад +1

    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

  • @ChrisAthanas
    @ChrisAthanas 9 месяцев назад +1

    Sooooo much easier than classic android

  • @SuperSapna007
    @SuperSapna007 Месяц назад

    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.

  • @argahutama
    @argahutama 9 месяцев назад

    👏

  • @naveenshah8032
    @naveenshah8032 5 месяцев назад

    does anybody know how to implement this in XML type method

  • @GamerBlind
    @GamerBlind 8 месяцев назад

    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.

    • @PhilippLackner
      @PhilippLackner  8 месяцев назад

      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

  • @pepepalotes1436
    @pepepalotes1436 9 месяцев назад +2

    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?

    • @raheemadamboev
      @raheemadamboev 8 месяцев назад

      If you remove Surface and other parent layouts, it works.

    • @ChaitanyaAggarwal243
      @ChaitanyaAggarwal243 3 месяца назад

      @@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

  • @RajuYadav-qm4ic
    @RajuYadav-qm4ic 9 месяцев назад

    😊

  • @alexandernifanin7366
    @alexandernifanin7366 5 месяцев назад

    Thanks for video, but the application doesn't zoom, pan and even not clickable (at least, on emulator).

  • @tipoanonim
    @tipoanonim 9 месяцев назад

    I'm using the same code, but I couldn't do the horizontal pager photos with zooming☹️

  • @LaBoots
    @LaBoots 9 месяцев назад

    Awesome tutorial, but now try to put it inside a HorizontalPager 🙃

  • @vege1396
    @vege1396 8 месяцев назад

    as long as I don't zoom once, panning doesn't work. what have I done wrong?

  • @Nikhil-Gupta
    @Nikhil-Gupta 9 месяцев назад

    One doesn't end he brings up another, how much should I consume.😋