-
Notifications
You must be signed in to change notification settings - Fork 113
What the ...., thousands of lines of code? #84
Comments
@ChiragMDave ok, but why haven't you done this and shared with us yet? |
import React from 'react'; const IMAGEWIDTH = 250; const IMAGEHEIGHT = 400;
} |
@ChiragMDave I tried your code - nice work! Here are a few little things I noticed:
I'm sure these can be achieved in less code than used in this repo, but I wanted to point out that there are a few other features implemented here. |
@elliottkember can we write code with the same brevity that addresses your concerns? Update: checkout this code https://github.com/enzomanuelmangano/animate-with-reanimated/blob/main/04-pinch-gesture-handler-basics/App.tsx |
@10000multiplier That example's great! The Would you like to draft up a PR to @openspacelabs/react-native-zoomable-view and we can work on the implementation? It will be quite a big refactor, but I think it would be great to work towards it. |
@elliottkember indeed, v2 of You may want to get familiar with some of the examples: https://github.com/software-mansion/react-native-gesture-handler/tree/master/example/src/new_api. I'm not in a position right now where I can put much time in this, but in the future I'd be glad to help out with a PR if needed! |
Superb. I'll have a look at the new API soon, thank you for the link. It would be neat to aim for a simpler implementation of this component - it works well enough that there is no real rush, but it seems doable and a fun project. My colleague Thomas did all the real work fixing bugs for our fork, I am just helping out with the handover. |
@elliottkember might want to check out this gist https://gist.githubusercontent.com/intergalacticspacehighway/9e931614199915cb4694209f12bf6f11/raw/dc67da12841d2e7e34b2e4f50a03953cffa86d76/PinchToZoom.tsx It works great. Hats off to @intergalacticspacehighway |
@10000multiplier This is awesome. Super impressive work @intergalacticspacehighway! As it turns out, we may have a need to implement this in a new version of the library. There are many benefits to I'll update this thread when I have something more concrete to share, but if you are interested in helping with this, let me know! |
@elliottkember here's my updated version with the new API. Works like a charm on iOS, haven't tested it on Android. https://gist.github.com/10000multiplier/264779c850e083ec3cb92eb8413559c0 |
@10000multiplier This is great! Unfortunately this doesn't solve the use-case where a user can zoom and pan the image like a map, which is how we use it. We're working through it but it's a difficult transform. It's important to be able to zoom the image in at the location the user is pinching. |
@10000multiplier We've spent the last couple of days working this into a new version of the plugin. You can check it out in the V3 branch in our repo. The new version has dependencies on Big shout-out to @thomasttvo for doing all the math, I nearly broke my brain trying! |
@elliottkember @thomasttvo awesome job guys. Looks great. |
Hi all, I've made zoom package on reanimated & gesture-handler 1.mp4 |
@kesha-antonov that's amazing. I have added it to the readme disclaimer. As for the question in the title of this issue: Funny enough: To be honest, that was also what made me stop working on this package, because I was frustrated of losing all this progress of a complete rewrite and did not want to start again. I am glad though, that now with your 2 packages there are alternatives out there. |
Thanks man! Yeah, sad story with that hard drive) I also wrote my package internally almost a year ago I think. But was busy with other stuff, and now I've found time to open source that finally) |
These guys have written thousands of lines of code for what can be achieved by writing just 50 lines. Including zooming in/out from lastScale and pan moving from lastOffsets using PanGestureHandler, PinchGestureHandler, State.
The text was updated successfully, but these errors were encountered: