优化代码

This commit is contained in:
wangcongtao
2020-11-25 21:17:12 +08:00
parent 431a467ff4
commit e89d4058d2
15 changed files with 94 additions and 62 deletions

View File

@@ -412,7 +412,9 @@ public class MogoServices implements IMogoMapListener,
MogoApisHandler.getInstance().getApis().getAdasControllerApi().setSettingStatus(false);
MogoApisHandler.getInstance().getApis().getEventPanelManager().hidePanel();
carsChattingProvider = (ICarsChattingProvider) ARouter.getInstance().build(CallChattingProviderConstant.CAR_CALL_PROVIDER).navigation();
carsChattingProvider.hideUserWindow("MOGO_COMMON_SERVICE", mContext, mCallProviderResponse);
if ( carsChattingProvider != null ) {
carsChattingProvider.hideUserWindow("MOGO_COMMON_SERVICE", mContext, mCallProviderResponse);
}
}
public void init(Context context) {

View File

@@ -113,24 +113,26 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
MarkerServiceHandler.getActionManager().registerBizActionDoneListener( this );
MarkerServiceHandler.getApis().getRegisterCenterApi().registerADASControlStatusChangedListener( TAG, this );
CallChatApi.getInstance().getApiProvider().registerUserWindowStatusListener( TAG, mContext, new ICallChatResponse() {
if ( CallChatApi.getInstance().getApiProvider() != null ) {
CallChatApi.getInstance().getApiProvider().registerUserWindowStatusListener( TAG, mContext, new ICallChatResponse() {
@Override
public void userWindowStatus( boolean show ) {
try {
if ( mLastCheckMarker == null ) {
return;
@Override
public void userWindowStatus( boolean show ) {
try {
if ( mLastCheckMarker == null ) {
return;
}
if ( TextUtils.equals( mLastCheckMarker.getOwner(), ModuleNames.CARD_TYPE_USER_DATA )
&& !show ) {
closeMarker( mLastCheckMarker );
}
} catch ( Exception e ) {
e.printStackTrace();
}
if ( TextUtils.equals( mLastCheckMarker.getOwner(), ModuleNames.CARD_TYPE_USER_DATA )
&& !show ) {
closeMarker( mLastCheckMarker );
}
} catch ( Exception e ) {
e.printStackTrace();
}
}
} );
} );
}
}
/**

View File

@@ -194,7 +194,9 @@ public class UserDataMarkerInfoWindowAdapter implements IMogoInfoWindowAdapter {
params.put( CallChattingProviderConstant.CCPROVIDER_LON, location.getLon() + "" );
}
Logger.d( TAG, "call parameters: %s", params );
MarkerServiceHandler.getCarChatting().call( params );
if ( MarkerServiceHandler.getCarChatting() != null ) {
MarkerServiceHandler.getCarChatting().call( params );
}
}
protected void loadImageHeader( final MarkerShowEntity markerShowEntity ) {

View File

@@ -78,7 +78,9 @@ class OnlineCarPanelAdapter extends RecyclerView.Adapter<OnlineCarPanelAdapter.V
params.put(CallChattingProviderConstant.CCPROVIDER_LAT, location.getLat() + "");
params.put(CallChattingProviderConstant.CCPROVIDER_LON, location.getLon() + "");
ICarsChattingProvider carChatting = MarkerServiceHandler.getCarChatting();
carChatting.call(params);
if ( carChatting != null ) {
carChatting.call(params);
}
});
}