Skip to content

Commit ed99d45

Browse files
authoredFeb 5, 2025··
feat: added method to stop animation (#1457)
* feat: added method to stop animation * feat: stop animation method in Cluster * feat: stop animation method in Cluster * feat: stop animation method in Cluster * feat: stop animation method in Cluster
1 parent 800e07f commit ed99d45

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
 

‎library/src/main/java/com/google/maps/android/clustering/view/ClusterRendererMultipleItems.java

+6
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,12 @@ public void setAnimationDuration(long animationDurationMs) {
543543
mAnimationDurationMs = animationDurationMs;
544544
}
545545

546+
public void stopAnimation() {
547+
for (AnimationTask animation : ongoingAnimations) {
548+
animation.cancel();
549+
}
550+
}
551+
546552
private static double distanceSquared(Point a, Point b) {
547553
return (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
548554
}

‎library/src/main/java/com/google/maps/android/clustering/view/DefaultClusterRenderer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,7 @@ public void removeOnAnimationComplete(MarkerManager markerManager) {
11561156
mMarkerManager = markerManager;
11571157
mRemoveOnComplete = true;
11581158
}
1159-
1159+
11601160
@Override
11611161
public void onAnimationUpdate(ValueAnimator valueAnimator) {
11621162
if (to == null || from == null || marker == null) {

0 commit comments

Comments
 (0)