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
set custom Interpolate for mapController #1834
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ankiimation!
Thank you for your PR. My remarks:
- we should have the same behavior as before by default, therefore as if there was no interpolator
- obviously we need a setter - maybe a getter
- not sure: should it be the same interpolator for map and zoom?
@@ -48,6 +52,7 @@ public class MapController implements IMapController, OnFirstLayoutListener { | |||
private double mTargetZoomLevel = 0; | |||
|
|||
private Animator mCurrentAnimator; | |||
public TimeInterpolator interpolator = new AccelerateDecelerateInterpolator(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public TimeInterpolator interpolator = new AccelerateDecelerateInterpolator(); | |
private TimeInterpolator mInterpolator; |
@@ -166,6 +171,7 @@ public void animateTo(final IGeoPoint point, final Double pZoom, final Long pSpe | |||
if (mCurrentAnimator != null) { | |||
mapAnimatorListener.onAnimationCancel(mCurrentAnimator); | |||
} | |||
mapAnimator.setInterpolator(interpolator); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mapAnimator.setInterpolator(interpolator); | |
mapAnimator.setInterpolator(mInterpolator); |
@@ -400,8 +406,9 @@ public boolean zoomToFixing(double zoomLevel, int xPixel, int yPixel, Long zoomA | |||
} else { | |||
zoomToAnimator.setDuration(zoomAnimationSpeed); | |||
} | |||
|
|||
zoomToAnimator.setInterpolator(interpolator); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zoomToAnimator.setInterpolator(interpolator); | |
zoomToAnimator.setInterpolator(mInterpolator); |
No description provided.