bugfix: npe interrupt
'work-thread-handler' thread
This commit is contained in:
@@ -77,7 +77,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
private Rect mMarkerDisplayBounds;
|
||||
|
||||
private MapMarkerManager() {
|
||||
mContext = AbsMogoApplication.getApp();
|
||||
}
|
||||
|
||||
public static synchronized MapMarkerManager getInstance() {
|
||||
@@ -96,6 +95,14 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
* @param context
|
||||
*/
|
||||
public void init( Context context ) {
|
||||
|
||||
if ( mContext != null ) {
|
||||
return;
|
||||
}
|
||||
|
||||
Logger.d( TAG, "初始化" );
|
||||
|
||||
mContext = context.getApplicationContext();
|
||||
mRefreshModel = new RefreshModel( mContext );
|
||||
|
||||
// 长连接
|
||||
@@ -357,7 +364,8 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
}
|
||||
int size = getAppropriateSize( maxAmount, exploreWayList );
|
||||
Map< String, IMogoMarker > existCarMap = purgeMarkerData( exploreWayList, ModuleNames.CARD_TYPE_ROAD_CONDITION );
|
||||
Logger.i( TAG, "existCarMap: size = %d", existCarMap.size() );for ( int i = 0; i < size; i++ ) {
|
||||
Logger.i( TAG, "existCarMap: size = %d", existCarMap.size() );
|
||||
for ( int i = 0; i < size; i++ ) {
|
||||
MarkerExploreWay markerExploreWay = exploreWayList.get( i );
|
||||
if ( !markerExploreWay.getCanLive() ) {
|
||||
MarkerLocation markerLocation = markerExploreWay.getLocation();
|
||||
@@ -373,7 +381,11 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
if ( mogoMarker == null || mogoMarker.isDestroyed() ) {
|
||||
Logger.d( TAG, "draw road condition, sn = %s", sn );
|
||||
try {
|
||||
post2AddAndStartAnimation( markerShowEntity, i * 100L );
|
||||
if ( DebugConfig.isRoadEventAnimated() ) {
|
||||
post2AddAndStartAnimation( markerShowEntity, i * 100L );
|
||||
} else {
|
||||
mogoMarker = drawMapMarker( markerShowEntity, ServiceConst.MARKER_Z_INDEX_HIGH );
|
||||
}
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -391,7 +403,10 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
return;
|
||||
}
|
||||
IMogoMarker marker = drawMapMarker( entity, ServiceConst.MARKER_Z_INDEX_HIGH );
|
||||
marker.startScaleAnimationWithAlpha( 0, 1.2f, 0, 1.2f, 0f, 1f,300, new LinearInterpolator(), new OnMarkerAnimationListener() {
|
||||
if ( marker == null ) {
|
||||
return;
|
||||
}
|
||||
marker.startScaleAnimationWithAlpha( 0, 1.2f, 0, 1.2f, 0f, 1f, 300, new LinearInterpolator(), new OnMarkerAnimationListener() {
|
||||
@Override
|
||||
public void onAnimStart() {
|
||||
Logger.d( TAG, " onAnimStart ---1----> " );
|
||||
@@ -399,7 +414,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
|
||||
@Override
|
||||
public void onAnimEnd() {
|
||||
if ( marker.isDestroyed() ) {
|
||||
if ( marker == null || marker.isDestroyed() ) {
|
||||
return;
|
||||
}
|
||||
marker.startScaleAnimation( 1.2f, 1, 1.2f, 1, 100, new LinearInterpolator(), null );
|
||||
|
||||
Reference in New Issue
Block a user