opt: sink marker animation
This commit is contained in:
@@ -7,10 +7,7 @@ import android.text.TextUtils;
|
||||
import android.view.animation.BounceInterpolator;
|
||||
import android.view.animation.OvershootInterpolator;
|
||||
|
||||
import com.amap.api.maps.model.animation.Animation;
|
||||
import com.amap.api.maps.model.animation.ScaleAnimation;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.impl.amap.marker.AMapMarkerWrapper;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
@@ -229,18 +226,8 @@ public class MapMarkerManager implements IMogoMarkerClickListener, IMogoOnMessag
|
||||
}
|
||||
mogoMarker.setToTop();
|
||||
try {
|
||||
// 使用TranslateAnimation,填写一个需要移动的目标点
|
||||
ScaleAnimation animationScale = new ScaleAnimation(0.6f, 1f, 0.6f, 1f);
|
||||
animationScale.setDuration(1000);
|
||||
animationScale.setFillMode(Animation.FILL_MODE_FORWARDS);
|
||||
animationScale.setInterpolator(new BounceInterpolator());
|
||||
|
||||
// 设置动画
|
||||
if (mogoMarker instanceof AMapMarkerWrapper) {
|
||||
((AMapMarkerWrapper) mogoMarker).getMarker().setAnimation(animationScale);
|
||||
((AMapMarkerWrapper) mogoMarker).getMarker().startAnimation();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
mogoMarker.startScaleAnimation( 0.6f, 1f, 0.6f, 1f,1000, new BounceInterpolator( ) );
|
||||
} catch( Exception e ){
|
||||
Logger.e(TAG, e, "error.");
|
||||
}
|
||||
}
|
||||
@@ -260,17 +247,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener, IMogoOnMessag
|
||||
return;
|
||||
}
|
||||
try {
|
||||
// 使用TranslateAnimation,填写一个需要移动的目标点
|
||||
ScaleAnimation animationScale = new ScaleAnimation(1f, 0.6f, 1f, 0.6f);
|
||||
animationScale.setDuration(300);
|
||||
animationScale.setFillMode(Animation.FILL_MODE_FORWARDS);
|
||||
animationScale.setInterpolator(new OvershootInterpolator());
|
||||
|
||||
// 设置动画
|
||||
if (mogoMarker instanceof AMapMarkerWrapper) {
|
||||
((AMapMarkerWrapper) mogoMarker).getMarker().setAnimation(animationScale);
|
||||
((AMapMarkerWrapper) mogoMarker).getMarker().startAnimation();
|
||||
}
|
||||
mogoMarker.startScaleAnimation( 1f, 0.6f, 1f, 0.6f,300, new OvershootInterpolator( ) );
|
||||
} catch (Exception e) {
|
||||
Logger.e(TAG, e, "error.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user