opt
This commit is contained in:
@@ -55,6 +55,7 @@ import com.mogo.service.module.MogoAction;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
@@ -286,6 +287,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE, StatusDescriptor.ADAS_UI, this );
|
||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE, StatusDescriptor.MAIN_PAGE_RESUME, this );
|
||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE, StatusDescriptor.SEEK_HELPING, this );
|
||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE, StatusDescriptor.ACC_STATUS, this );
|
||||
mStatusManager.setAIAssistReady( TAG, AIAssist.getInstance( mContext ).hasFlush() );
|
||||
|
||||
registerMogoReceiver( context );
|
||||
@@ -713,14 +715,18 @@ public class MogoServices implements IMogoMapListener,
|
||||
break;
|
||||
case ACC_STATUS:
|
||||
if ( isTrue ) {
|
||||
initLocationServiceProcess( mContext );
|
||||
mADASController.showADAS();
|
||||
refreshStrategy();
|
||||
MarkerServiceHandler.getApis().getMapServiceApi().getSingletonLocationClient( mContext ).stop();
|
||||
} else {
|
||||
try {
|
||||
MarkerServiceHandler.getApis().getMapServiceApi().getMarkerManager( mContext ).removeMarkers();
|
||||
MarkerServiceHandler.getApis().getMapServiceApi().getSingletonLocationClient( mContext ).start();
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "error." );
|
||||
}
|
||||
refreshStrategy();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,9 @@ import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.navi.IMogoNaviListener;
|
||||
import com.mogo.map.navi.MogoNaviInfo;
|
||||
import com.mogo.map.navi.MogoTraffic;
|
||||
import com.mogo.map.search.geo.IMogoGeoSearch;
|
||||
import com.mogo.map.search.geo.IMogoGeoSearchListener;
|
||||
import com.mogo.map.search.geo.MogoGeocodeResult;
|
||||
@@ -155,6 +158,49 @@ public class MockIntentHandler implements IntentHandler {
|
||||
case 13: {
|
||||
double lat = intent.getFloatExtra( "lat", 0.0f );
|
||||
double lon = intent.getFloatExtra( "lon", 0.0f );
|
||||
boolean real = intent.getBooleanExtra( "real", false );
|
||||
MarkerServiceHandler.getRegisterCenter().registerMogoNaviListener( TAG, new IMogoNaviListener() {
|
||||
@Override
|
||||
public void onInitNaviFailure() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInitNaviSuccess() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviInfoUpdate( MogoNaviInfo naviinfo ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartNavi() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopNavi() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCalculateSuccess() {
|
||||
MarkerServiceHandler.getRegisterCenter().unregisterMogoNaviListener( TAG );
|
||||
MarkerServiceHandler.getNavi().startNavi( real );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onoCalculateFailed() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateTraffic( MogoTraffic traffic ) {
|
||||
|
||||
}
|
||||
} );
|
||||
MarkerServiceHandler.getNavi().naviTo( new MogoLatLng( lat, lon ) );
|
||||
}
|
||||
case 14: {
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.mogo.module.service.marker;
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
import android.text.TextUtils;
|
||||
import android.view.animation.AccelerateInterpolator;
|
||||
import android.view.animation.LinearInterpolator;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
@@ -11,6 +13,7 @@ import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.IMogoMarkerManager;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.marker.anim.OnMarkerAnimationListener;
|
||||
import com.mogo.module.common.ModuleNames;
|
||||
import com.mogo.module.common.entity.MarkerCarPois;
|
||||
import com.mogo.module.common.entity.MarkerCardResult;
|
||||
@@ -34,6 +37,7 @@ import com.mogo.service.module.IMogoBizActionDoneListener;
|
||||
import com.mogo.utils.ResourcesHelper;
|
||||
import com.mogo.utils.ThreadPoolService;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import org.json.JSONArray;
|
||||
@@ -293,6 +297,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
MogoLatLng centerPoint ) {
|
||||
// 将数据同步给在线车辆,避免每次 perform 的时候去拉取,造成消耗
|
||||
if ( onlineCarList == null || onlineCarList.isEmpty() ) {
|
||||
MarkerServiceHandler.getMarkerManager().removeMarkers( ModuleNames.CARD_TYPE_USER_DATA );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -324,9 +329,12 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
|
||||
String sn = getPrimaryKeyFromEntity( markerOnlineCar );
|
||||
IMogoMarker mogoMarker = existCarMap.get( sn );
|
||||
if ( mogoMarker == null ) {
|
||||
if ( mogoMarker == null || mogoMarker.isDestroyed() ) {
|
||||
mogoMarker = drawMapMarker( markerShowEntity, ServiceConst.MARKER_Z_INDEX_LOW );
|
||||
}
|
||||
if ( mogoMarker != null ) {
|
||||
mogoMarker.setVisible( true );
|
||||
}
|
||||
startSmooth( mogoMarker, markerOnlineCar, markerLocation );
|
||||
}
|
||||
|
||||
@@ -362,14 +370,44 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
|
||||
String sn = getPrimaryKeyFromEntity( markerExploreWay );
|
||||
IMogoMarker mogoMarker = existCarMap.get( sn );
|
||||
if ( mogoMarker == null ) {
|
||||
if ( mogoMarker == null || mogoMarker.isDestroyed() ) {
|
||||
Logger.d( TAG, "draw road condition, sn = %s", sn );
|
||||
drawMapMarker( markerShowEntity, ServiceConst.MARKER_Z_INDEX_HIGH );
|
||||
try {
|
||||
post2AddAndStartAnimation( markerShowEntity, i * 100L );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void post2AddAndStartAnimation( MarkerShowEntity entity, long delay ) {
|
||||
if ( entity == null ) {
|
||||
return;
|
||||
}
|
||||
WorkThreadHandler.getInstance().postDelayed( () -> {
|
||||
if ( entity == null ) {
|
||||
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() {
|
||||
@Override
|
||||
public void onAnimStart() {
|
||||
Logger.d( TAG, " onAnimStart ---1----> " );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimEnd() {
|
||||
if ( marker.isDestroyed() ) {
|
||||
return;
|
||||
}
|
||||
marker.startScaleAnimation( 1.2f, 1, 1.2f, 1, 100, new LinearInterpolator(), null );
|
||||
}
|
||||
} );
|
||||
}, delay );
|
||||
}
|
||||
|
||||
/**
|
||||
* S = (A ∩ B) ∪ B
|
||||
* (A ∩ B)作为旧列表需要保留的部分
|
||||
|
||||
@@ -54,6 +54,7 @@ public class UserDataMarkerInfoWindowAdapter implements IMogoInfoWindowAdapter {
|
||||
|
||||
private View mInfoWindowView = null;
|
||||
|
||||
private View mContentContainer;
|
||||
private MogoImageView mUserHeader;
|
||||
private TextView mContent;
|
||||
private TextView mTag;
|
||||
@@ -92,12 +93,23 @@ public class UserDataMarkerInfoWindowAdapter implements IMogoInfoWindowAdapter {
|
||||
|
||||
if ( mInfoWindowView == null ) {
|
||||
mInfoWindowView = LayoutInflater.from( mContext ).inflate( R.layout.view_map_data_user_info_window, null );
|
||||
mContentContainer = mInfoWindowView.findViewById( R.id.module_service_id_marker_content );
|
||||
mUserHeader = mInfoWindowView.findViewById( R.id.module_service_id_user_header );
|
||||
mContent = mInfoWindowView.findViewById( R.id.module_service_id_content );
|
||||
mTag = mInfoWindowView.findViewById( R.id.module_service_id_tag );
|
||||
mCall = mInfoWindowView.findViewById( R.id.module_service_id_call );
|
||||
}
|
||||
|
||||
if ( DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_BYD ) {
|
||||
mContentContainer.setPadding(
|
||||
mContentContainer.getPaddingLeft(),
|
||||
mContentContainer.getPaddingTop(),
|
||||
mContentContainer.getResources().getDimensionPixelSize( R.dimen.module_service_id_marker_content_paddingRight_widthoutCall ),
|
||||
mContentContainer.getPaddingBottom()
|
||||
);
|
||||
mCall.setVisibility( View.GONE );
|
||||
}
|
||||
|
||||
try {
|
||||
MarkerShowEntity markerShowEntity = ( MarkerShowEntity ) marker.getObject();
|
||||
mContent.setText( markerShowEntity.getTextContent() );
|
||||
|
||||
Reference in New Issue
Block a user