opt: sink marker animation
This commit is contained in:
@@ -4,6 +4,7 @@ import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Point;
|
||||
import android.view.View;
|
||||
import android.view.animation.BounceInterpolator;
|
||||
import android.view.animation.Interpolator;
|
||||
|
||||
import com.amap.api.maps.model.BitmapDescriptor;
|
||||
@@ -12,6 +13,7 @@ import com.amap.api.maps.model.LatLng;
|
||||
import com.amap.api.maps.model.Marker;
|
||||
import com.amap.api.maps.model.MarkerOptions;
|
||||
import com.amap.api.maps.model.animation.Animation;
|
||||
import com.amap.api.maps.model.animation.ScaleAnimation;
|
||||
import com.amap.api.maps.model.animation.TranslateAnimation;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.impl.amap.utils.ObjectUtils;
|
||||
@@ -310,4 +312,19 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
public MogoMarkerOptions getMogoMarkerOptions() {
|
||||
return mMogoMarkerOptions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startScaleAnimation( float fromX, float toX, float fromY, float toY, int duration, Interpolator interpolator ) {
|
||||
if ( isDestroyed() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
ScaleAnimation animationScale = new ScaleAnimation(fromX, toX, fromY, toY);
|
||||
animationScale.setDuration(duration);
|
||||
animationScale.setFillMode(Animation.FILL_MODE_FORWARDS);
|
||||
animationScale.setInterpolator(interpolator);
|
||||
|
||||
mMarker.setAnimation( animationScale );
|
||||
mMarker.startAnimation();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user