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

set custom Interpolate for mapController #1834

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ankiimation
Copy link

No description provided.

Copy link
Collaborator

@monsieurtanuki monsieurtanuki left a 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();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
zoomToAnimator.setInterpolator(interpolator);
zoomToAnimator.setInterpolator(mInterpolator);

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

Successfully merging this pull request may close these issues.

None yet

2 participants