7798-ObjectAnimator-rotation (#7907)
This commit is contained in:
@@ -266,18 +266,9 @@ public class MarkerView extends Marker {
|
||||
* @param rotation the rotation value to animate to.
|
||||
*/
|
||||
public void setRotation(float rotation) {
|
||||
// limit to 0 - 360 degrees
|
||||
float newRotation = rotation;
|
||||
while (newRotation > 360) {
|
||||
newRotation -= 360;
|
||||
}
|
||||
while (newRotation < 0) {
|
||||
newRotation += 360;
|
||||
}
|
||||
|
||||
this.rotation = newRotation;
|
||||
this.rotation = rotation;
|
||||
if (markerViewManager != null) {
|
||||
markerViewManager.animateRotationBy(this, newRotation);
|
||||
markerViewManager.setRotation(this, rotation);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -125,6 +125,14 @@ public class MarkerViewManager implements MapView.OnMapChangedListener {
|
||||
}
|
||||
}
|
||||
|
||||
public void setRotation(@NonNull MarkerView marker, float rotation) {
|
||||
View convertView = markerViewMap.get(marker);
|
||||
if (convertView != null) {
|
||||
convertView.animate().cancel();
|
||||
convertView.setRotation(rotation);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Animate a MarkerView to a given alpha value.
|
||||
* <p>
|
||||
|
||||
Reference in New Issue
Block a user