@@ -107,6 +107,7 @@ public enum AnimationType {
107107 }
108108
109109 public void setAnimationType (AnimationType type ) {
110+
110111 animationInterp = switch (type ) {
111112 case LINEAR -> new LinearInterpolator ();
112113 case EASE_IN , ACCELERATE -> new AccelerateInterpolator ();
@@ -173,7 +174,7 @@ public void setAnimationInterpolator(TimeInterpolator interpolator) {
173174 public ClusterRendererMultipleItems (Context context , GoogleMap map , ClusterManager <T > clusterManager ) {
174175 mMap = map ;
175176 mAnimate = true ;
176- mAnimationDurationMs = 300 ;
177+ mAnimationDurationMs = 5000 ;
177178 mDensity = context .getResources ().getDisplayMetrics ().density ;
178179 mIconGenerator = new IconGenerator (context );
179180 mIconGenerator .setContentView (makeSquareTextView (context ));
@@ -529,8 +530,7 @@ public void run() {
529530 final Point point = mSphericalMercatorProjection .toPoint (marker .position );
530531 final Point closest = findClosestCluster (newClustersOnScreen , point );
531532 if (closest != null ) {
532- LatLng animateTo = mSphericalMercatorProjection .toLatLng (closest );
533- markerModifier .animateThenRemove (marker , marker .position , animateTo );
533+ markerModifier .remove (true , marker .marker );
534534 RendererLogger .d ("ClusterRenderer" , "Animating then removing marker at position: " + marker .position );
535535 } else if (mClusterMarkerCache .mCache .keySet ().iterator ().hasNext () && mClusterMarkerCache .mCache .keySet ().iterator ().next ().getItems ().contains (marker .clusterItem )) {
536536 T foundItem = null ;
@@ -1153,7 +1153,7 @@ private void perform(MarkerModifier markerModifier) {
11531153 if (animateFrom != null ) {
11541154 markerModifier .animate (markerWithPosition , animateFrom , item .getPosition ());
11551155 RendererLogger .d ("ClusterRenderer" , "Animating marker from " + animateFrom + " to " + item .getPosition ());
1156- } else if ( currentLocation != null ) {
1156+ } else {
11571157 markerModifier .animate (markerWithPosition , currentLocation , item .getPosition ());
11581158 RendererLogger .d ("ClusterRenderer" , "Animating marker from " + currentLocation + " to " + item .getPosition ());
11591159 }
0 commit comments