解决动画执行中偶现npe的问题
This commit is contained in:
@@ -581,7 +581,11 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
// mMyLocationMarker.startAnimation();
|
||||
// }
|
||||
// });
|
||||
mMyLocationMarker.startAnimation();
|
||||
try {
|
||||
mMyLocationMarker.startAnimation();
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -342,10 +342,16 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
ScaleAnimation animationScale = new ScaleAnimation( fromX, toX, fromY, toY );
|
||||
animationScale.setDuration( duration );
|
||||
animationScale.setFillMode( Animation.FILL_MODE_FORWARDS );
|
||||
animationScale.setInterpolator( interpolator );
|
||||
if ( interpolator != null ) {
|
||||
animationScale.setInterpolator( interpolator );
|
||||
}
|
||||
|
||||
mMarker.setAnimation( animationScale );
|
||||
mMarker.startAnimation();
|
||||
try {
|
||||
mMarker.startAnimation();
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -357,7 +363,9 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
ScaleAnimation animationScale = new ScaleAnimation( fromX, toX, fromY, toY );
|
||||
animationScale.setDuration( duration );
|
||||
animationScale.setFillMode( Animation.FILL_MODE_FORWARDS );
|
||||
animationScale.setInterpolator( interpolator );
|
||||
if ( interpolator != null ) {
|
||||
animationScale.setInterpolator( interpolator );
|
||||
}
|
||||
animationScale.setAnimationListener( new Animation.AnimationListener() {
|
||||
@Override
|
||||
public void onAnimationStart() {
|
||||
@@ -398,7 +406,9 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
|
||||
AnimationSet animationSet = new AnimationSet( true );
|
||||
animationSet.setDuration( duration );
|
||||
animationSet.setInterpolator( interpolator );
|
||||
if ( interpolator != null ) {
|
||||
animationSet.setInterpolator( interpolator );
|
||||
}
|
||||
animationSet.setAnimationListener( new Animation.AnimationListener() {
|
||||
@Override
|
||||
public void onAnimationStart() {
|
||||
@@ -422,7 +432,11 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
} );
|
||||
|
||||
mMarker.setAnimation( animationSet );
|
||||
mMarker.startAnimation();
|
||||
try {
|
||||
mMarker.startAnimation();
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user