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

Zoom to a certain point with zoom animation #20

Closed
Vad1mo opened this issue May 13, 2012 · 2 comments
Closed

Zoom to a certain point with zoom animation #20

Vad1mo opened this issue May 13, 2012 · 2 comments

Comments

@Vad1mo
Copy link

Vad1mo commented May 13, 2012

Hello Jason.
I tried out your yesterdays commit. And i have question about the image view position change during animation.

What I want to achieve is to zoom in to a certain position so that my newX and newY are on displays top left corner.

this is what I was using in the doubletaplistener

float scale = calcScale(image);
int iH = image.getImageHeight();
int iW = image.getImageWidth();
int newX = Math.round((iW / 2 - 25) * scale);
int newY = Math.round((iH / 2 - 200) * scale);

image.setScale(scale);
image.setPosition(newX, newY);

I cant use this anymore like this and In the ZoomAnimation I cant see how you are setting the position of the imageview.

Cheers,

Vadimo

@jasonpolites
Copy link
Owner

Hi Vad,

The ZoomAnimation doesn't change the view's position directly, rather it calls a listener which resides inside the gesture handler:

https://github.com/jasonpolites/gesture-imageview/blob/master/main/src/com/polites/android/GestureImageViewTouchListener.java#L127

@Vad1mo
Copy link
Author

Vad1mo commented May 14, 2012

thank you I now got it. Just needed to change the vector direction, scale and it worked :)

@Vad1mo Vad1mo closed this as completed May 14, 2012
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