diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java index 50823cc471..122f3470c2 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java @@ -538,8 +538,6 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager { } if (isVrMode) { mAlarmInfoMarker = MarkerDrawer.getInstance().drawMapMarkerImpl(markerShowEntity, MarkerDrawer.MARKER_Z_INDEX_HIGH, clickListener); -// mAlarmInfoMarker.setInfoWindowAdapter(new RoadConditionInfoWindow3DAdapter(markerShowEntity, AbsMogoApplication.getApp(), mAlarmInfoMarker.getMogoMarkerOptions())); -// mAlarmInfoMarker.showInfoWindow(); } else { optionsRipple.icon(V2XMarkerAdapter.getV2XRoadEventViewPng(context, roadEventEntity)); IMogoMarkerManager marker = BridgeApi.INSTANCE.marker(); diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/adapter/MogoMapListenerAdapter.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/adapter/MogoMapListenerAdapter.java deleted file mode 100644 index fb35abcf1f..0000000000 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/adapter/MogoMapListenerAdapter.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.mogo.module.common.adapter; - -import android.view.MotionEvent; - -import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.map.listener.IMogoMapListener; -import com.mogo.map.model.MogoPoi; -import com.mogo.map.uicontroller.EnumMapUI; -import com.mogo.map.uicontroller.VisualAngleMode; - -/** - * @author congtaowang - * @since 2020-01-10 - *
- * 适配器 - */ -public abstract class MogoMapListenerAdapter implements IMogoMapListener { - - @Override - public void onMapLoaded() { - - } - - @Override - public void onTouch( MotionEvent motionEvent ) { - - } - - @Override - public void onPOIClick( MogoPoi poi ) { - - } - - @Override - public void onMapClick( MogoLatLng latLng ) { - - } - - @Override - public void onLockMap( boolean isLock ) { - - } - - @Override - public void onMapModeChanged( EnumMapUI ui ) { - - } - - @Override - public void onMapVisualAngleChanged(VisualAngleMode visualAngleMode) { - - } - - @Override - public void onMapChanged( MogoLatLng latLng, float zoom, float tilt, float bearing ) { - - } -} diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/BaseDrawer.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/BaseDrawer.java index b60fdd712c..7282137d08 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/BaseDrawer.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/BaseDrawer.java @@ -3,11 +3,7 @@ package com.mogo.module.common.drawer; import static com.mogo.cloud.socket.entity.SocketDownDataHelper.FROM_ADAS; import android.content.Context; -import android.graphics.Color; -import android.graphics.Typeface; import android.text.TextUtils; -import android.view.ViewGroup; -import android.widget.TextView; import com.mogo.commons.AbsMogoApplication; import com.mogo.map.marker.IMogoMarker; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/MarkerDrawer.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/MarkerDrawer.java index 7e9f9283e0..677a5d2651 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/MarkerDrawer.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/MarkerDrawer.java @@ -71,7 +71,7 @@ class MarkerDrawer { } /** - * add marker, {@link OnlineCarDrawer 如果是需要在3D模式下显示,则需要设置 {@link MogoMarkerOptions icon3DRes 资源id}} + * add marker, { 如果是需要在3D模式下显示,则需要设置 {@link MogoMarkerOptions icon3DRes 资源id}} * * @param markerShowEntity marker展示数据结构体 * @param matchRoadSide 设置是否道路吸附,暂时没用到这个字段 diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/OnlineCarDrawer.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/OnlineCarDrawer.java deleted file mode 100644 index 5b89af49b1..0000000000 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/OnlineCarDrawer.java +++ /dev/null @@ -1,202 +0,0 @@ -package com.mogo.module.common.drawer; - -import android.graphics.Rect; - -import com.mogo.commons.AbsMogoApplication; -import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.eagle.core.utilcode.mogo.logger.Logger; -import com.mogo.map.marker.IMogoMarker; -import com.mogo.map.marker.IMogoMarkerClickListener; -import com.mogo.module.common.ModuleNames; -import com.mogo.module.common.MogoApisHandler; -import com.mogo.module.common.entity.MarkerCarPois; -import com.mogo.module.common.entity.MarkerLocation; -import com.mogo.module.common.entity.MarkerOnlineCar; -import com.mogo.module.common.entity.MarkerShowEntity; -import com.mogo.service.statusmanager.IMogoStatusChangedListener; -import com.mogo.service.statusmanager.StatusDescriptor; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -public -/** - * @author congtaowang - * @since 2020/10/28 - * - * 描述 - */ -class OnlineCarDrawer implements IMogoStatusChangedListener { - - private static final String TAG = "OnlineCarDrawer"; - - // 平滑移动事件间隔(单位:秒) - private static final int SMOOTH_DURATION = 15; - - private static volatile OnlineCarDrawer sInstance; - - private OnlineCarDrawer() { - MogoApisHandler.getInstance().getApis() - .getStatusManagerApi() - .registerStatusChangedListener( TAG, StatusDescriptor.VR_MODE, this ); - } - - public static OnlineCarDrawer getInstance() { - if ( sInstance == null ) { - synchronized ( OnlineCarDrawer.class ) { - if ( sInstance == null ) { - sInstance = new OnlineCarDrawer(); - } - } - } - return sInstance; - } - - public synchronized void release() { - sInstance = null; - } - - public void clearMarkers(){ - MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager( AbsMogoApplication.getApp() ).removeMarkers( ModuleNames.CARD_TYPE_USER_DATA ); - } - - /** - * 绘制在线车辆marker - * - * @param onlineCarList - */ - public void drawOnlineCarMarkers( List< MarkerOnlineCar > onlineCarList, - int maxAmount, - boolean clearOld, - boolean showBounds, - Rect bound, - MogoLatLng centerPoint, - IMogoMarkerClickListener listener ) { - // 将数据同步给在线车辆,避免每次 perform 的时候去拉取,造成消耗 - if ( onlineCarList == null || onlineCarList.isEmpty() ) { - clearMarkers(); - return; - } - - if ( clearOld ) { - clearMarkers(); - } - - int size = MarkerDrawer.getInstance().getAppropriateSize( maxAmount, onlineCarList ); - - Map< String, IMogoMarker > existCarMap = MarkerDrawer.getInstance().purgeMarkerData( onlineCarList, ModuleNames.CARD_TYPE_USER_DATA ); - - List< MogoLatLng > carPoints = new ArrayList<>(); - for ( int i = 0; i < size; i++ ) { - MarkerOnlineCar markerOnlineCar = onlineCarList.get( i ); - MarkerLocation markerLocation = markerOnlineCar.getLocation(); - MarkerShowEntity markerShowEntity = new MarkerShowEntity(); - markerShowEntity.setBindObj( markerOnlineCar ); - markerShowEntity.setMarkerLocation( markerLocation ); - markerShowEntity.setMarkerType( markerOnlineCar.getType() ); - - if ( markerOnlineCar.getCarInfo() != null ) { - markerShowEntity.setTextContent( markerOnlineCar.getUserInfo().getUserName() ); - markerShowEntity.setIconUrl( markerOnlineCar.getUserInfo().getUserHead() ); - } - - if ( i <= 5 ) { - carPoints.add( new MogoLatLng( markerLocation.getLat(), markerLocation.getLon() ) ); - } - - String sn = MarkerDrawer.getInstance().getPrimaryKeyFromEntity( markerOnlineCar ); - IMogoMarker mogoMarker = existCarMap.get( sn ); - if ( mogoMarker == null || mogoMarker.isDestroyed() ) { - mogoMarker = MarkerDrawer.getInstance().drawMapMarkerImpl( markerShowEntity, false, MarkerDrawer.MARKER_Z_INDEX_LOW, 0, listener ); - } - if ( mogoMarker != null ) { - mogoMarker.setVisible( true ); - } - startSmooth( mogoMarker, markerOnlineCar, markerLocation ); - } - - if ( showBounds && bound != null ) { - // 将前6个点显示在固定范围内 - MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().showBounds( TAG, centerPoint, carPoints, bound, false ); - } - } - - - // 平滑移动 - private void startSmooth( IMogoMarker iMogoMarker, MarkerOnlineCar markerOnlineCar, - MarkerLocation markerLocation ) { - if ( iMogoMarker == null ) { - return; - } - List< MarkerCarPois > poiList = markerOnlineCar.getPois(); - if ( filterErrorPoint( poiList ) ) { - return; - } - if ( poiList == null || poiList.size() < 2 ) { - return; - } - - List< MogoLatLng > points = new ArrayList<>(); - - double lastLat = 0.0d; - double lastLon = 0.0d; - - for ( int j = 0; j < poiList.size(); j++ ) { - MarkerCarPois poi = poiList.get( j ); - if ( poi == null || poi.getCoordinates() == null && poi.getCoordinates().size() != 2 ) { - continue; - } - try { - double lat = Double.valueOf( poi.getCoordinates().get( 1 ) + "" ); - double lng = Double.valueOf( poi.getCoordinates().get( 0 ) + "" ); - - float distance = MarkerDrawer.calculateLineDistance( lastLon, lastLat, lng, lat ); - lastLon = lng; - lastLat = lat; - if ( distance < 0.2f ) {// 距离过短,认为静止不动 - continue; - } - - points.add( new MogoLatLng( lat, lng ) ); - } catch ( Exception e ) { - } - } - if ( points.size() >= 1 ) { - iMogoMarker.startSmooth( points, SMOOTH_DURATION ); - } else { - Logger.d( TAG, "静止小车,但是有相同的连续坐标" ); - } - } - - /** - * 有可能出现终点到起点跳跃的情况,需要用"500M"约束起点和终点 - * - * @param poiList - */ - private boolean filterErrorPoint( List< MarkerCarPois > poiList ) { - if ( poiList == null || poiList.size() < 2 ) { - return false; - } - MarkerCarPois start = poiList.get( 0 ); - MarkerCarPois end = poiList.get( poiList.size() - 1 ); - - try { - double lat1 = Double.valueOf( start.getCoordinates().get( 1 ) + "" ); - double lng1 = Double.valueOf( start.getCoordinates().get( 0 ) + "" ); - double lat2 = Double.valueOf( end.getCoordinates().get( 1 ) + "" ); - double lng2 = Double.valueOf( end.getCoordinates().get( 0 ) + "" ); - if ( MarkerDrawer.calculateLineDistance( new MogoLatLng( lat1, lng1 ), new MogoLatLng( lat2, lng2 ) ) >= 500 ) { - Logger.d( TAG, "filter point" ); - return true; - } - } catch ( Exception e ) { - } - return false; - } - - @Override - public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) { - clearMarkers(); - } -} diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/PushRoadConditionDrawer.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/PushRoadConditionDrawer.java deleted file mode 100644 index 644c8bf7bb..0000000000 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/PushRoadConditionDrawer.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.mogo.module.common.drawer; - -import com.mogo.map.overlay.IMogoPolyline; - -/** - * @author donghongyu - * @since 2020/10/30 - * TODO 推送路况信息绘制,用于演示 - */ -public class PushRoadConditionDrawer { - - private static final String TAG = "PushRoadConditionDrawer"; - private static volatile PushRoadConditionDrawer sInstance; - - private static IMogoPolyline mMogoPolyline; - - private PushRoadConditionDrawer() { - } - - public static PushRoadConditionDrawer getInstance() { - if (sInstance == null) { - synchronized (PushRoadConditionDrawer.class) { - if (sInstance == null) { - sInstance = new PushRoadConditionDrawer(); - } - } - } - return sInstance; - } - - public synchronized void release() { - clearPolyline(); - mMogoPolyline = null; - sInstance = null; - } - - public void clearPolyline() { - if (mMogoPolyline != null) { - mMogoPolyline.remove(); - mMogoPolyline = null; - } - } - -} diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/V2XWarnDataDrawer.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/V2XWarnDataDrawer.java index 2f128bf4c4..93481a4352 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/V2XWarnDataDrawer.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/V2XWarnDataDrawer.java @@ -30,7 +30,6 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL private static final String TAG = "V2XWarnDataDrawer"; private static volatile V2XWarnDataDrawer sInstance; - private boolean mChangeCarModeStatus; private V2XWarnDataDrawer() { super(); @@ -59,7 +58,6 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL @Override public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) { Logger.d(TAG, "%s - %s", descriptor, isTrue); - mChangeCarModeStatus = true; } public boolean isVrMode() { diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/map/CustomNaviInterrupter.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/map/CustomNaviInterrupter.java deleted file mode 100644 index 8676ad542b..0000000000 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/map/CustomNaviInterrupter.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.mogo.module.common.map; - -import com.mogo.commons.AbsMogoApplication; -import com.mogo.commons.debug.DebugConfig; -import com.mogo.eagle.core.utilcode.util.AppUtils; - -public -/** - * @author congtaowang - * @since 2020/6/5 - *
- * 自定义导航功能拦截器
- */
-class CustomNaviInterrupter implements Interrupter {
-
- private static final String TAG = "CustomNaviInterrupter";
-
- private static volatile CustomNaviInterrupter sInstance;
-
- private CustomNaviInterrupter() {
- }
-
- public static CustomNaviInterrupter getInstance() {
- if ( sInstance == null ) {
- synchronized ( CustomNaviInterrupter.class ) {
- if ( sInstance == null ) {
- sInstance = new CustomNaviInterrupter();
- }
- }
- }
- return sInstance;
- }
-
- public synchronized void release() {
- sInstance = null;
- }
-
- /**
- * 判断是否用自己的导航
- * 1. 项目是否强制使用自己的导航
- * 2. 是否安装了高德车机版地图
- * 3. 默认使用自己的导航
- *
- * @return true-用高德公版车机版地图 false-用Launcher自己的导航
- */
- @Override
- public boolean interrupt() {
- if ( DebugConfig.isUseCustomNavi() ) {
- return false;
- }
- if ( AppUtils.isAppInstalled( AbsMogoApplication.getApp(), "com.autonavi.amapauto" ) ) {
- return true;
- }
- return false;
- }
-}
diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/map/MapCenterPointStrategy.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/map/MapCenterPointStrategy.java
index 9a6cc93156..aae1a3f722 100644
--- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/map/MapCenterPointStrategy.java
+++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/map/MapCenterPointStrategy.java
@@ -1,7 +1,5 @@
package com.mogo.module.common.map;
-import android.util.Log;
-
import com.mogo.commons.debug.DebugConfig;
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/map/MyLocationUtil.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/map/MyLocationUtil.java
deleted file mode 100644
index 47daceae38..0000000000
--- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/map/MyLocationUtil.java
+++ /dev/null
@@ -1,124 +0,0 @@
-package com.mogo.module.common.map;
-
-import android.content.Context;
-import android.graphics.Bitmap;
-import android.graphics.drawable.Drawable;
-import android.os.Looper;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-
-import com.bumptech.glide.request.RequestOptions;
-import com.bumptech.glide.request.target.SimpleTarget;
-import com.bumptech.glide.request.transition.Transition;
-import com.mogo.commons.context.ContextHolderUtil;
-import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp;
-import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
-import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
-import com.mogo.eagle.core.utilcode.util.ViewUtils;
-import com.mogo.map.uicontroller.CarCursorOption;
-import com.mogo.module.common.MogoApisHandler;
-import com.mogo.module.common.R;
-
-/**
- * 自车图标工具类
- *
- * @author tongchenfei
- */
-public class MyLocationUtil {
-
- private static boolean isLoadingIcon = false;
- private static boolean needEmphasizeMyLocation = false;
-
- static {
- MogoApisHandler.getInstance().getApis().getDataManagerApi()
- .registerDataListener( "ADAS", data ->{
- if ( data == null ) {
- emphasizeMyLocation();
- } else if( data instanceof String ){
- setMyLocationIconUrl( ContextHolderUtil.getContext(), ( ( String ) data ));
- }
- } );
- }
-
- public static void emphasizeMyLocation(){
- if (!isLoadingIcon) {
- MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().emphasizeMyLocation();
- }else{
- needEmphasizeMyLocation = true;
- }
- }
-
- private static final CarCursorOption DEFAULT_OPTION = new CarCursorOption.Builder()
- .build();
-
- public static void setMyLocationIconUrl(Context context){
- setMyLocationIconUrl( context, SharedPrefsMgr.getInstance( context ).getString( "MY_LOCATION_CONFIG", "" ) );
- }
-
- public static void setMyLocationIconUrl(Context context, String url) {
- if (url == null || url.isEmpty()) {
- return;
- }
-
- if (Looper.myLooper() != Looper.getMainLooper()) {
- UiThreadHandler.post(() -> loadMyLocationIconInUiThread(context, url));
- } else {
- loadMyLocationIconInUiThread(context, url);
- }
- }
-
- private static void loadMyLocationIconInUiThread(Context context, String url) {
- if (!url.isEmpty()) {
- isLoadingIcon = true;
- RequestOptions options = new RequestOptions()
- .placeholder(DEFAULT_OPTION.getCarCursorRes())
- .error(DEFAULT_OPTION.getCarCursorRes())
- .dontAnimate();
- GlideApp.with(context)
- .asBitmap()
- .load(url)
- .apply(options)
- .into(new SimpleTarget
- * "data"="{"op":"查询","status":"在线","obj":"车主"}"
- */
- public static final String COMMAND_ZHIDAO_NEARBY_USER_ONLINE = "com.zhidao.nearby.user.online";
-
- /**
- * 查询指定位置的好友
- *
- * "data"="{"op":"看看","obj":"好友","location":"中关村"}"
- */
- public static final String COMMAND_ZHIDAO_NEARBY_FRIEND_BYLOCATION = "com.zhidao.nearby.friend.bylocation";
-
/**
* 返回桌面
*/
@@ -204,11 +147,6 @@ public class ServiceConst {
public static final int ONLINE_SEARCH_LIMIT = 20;
public static final int ONLINE_SEARCH_RADIUS = 2_000;
- /**
- * 查找目的地车友
- */
- public static final String COMMAND_ONLINE_CAR_PANEL = "com.zhidao.search.riders";
-
/**
* 导航开始后,延时1分钟开启推送策略
*/
@@ -219,24 +157,5 @@ public class ServiceConst {
*/
public static final long INTERVAL_SCHEDULE_CALCULATE_NOT_HOME_COMPANY_DISTANCE_FOR_PUSH = 60 * 1_000L;
- /**
- * 发送自车位置和adas识别结果给服务端
- */
- public static final int MSG_SEND_CAR_LOCATION_AND_ADAS_RECOGNIZED_RESULT_2_SERVER = 0x401;
-
- /**
- * 间隔 1s 发送一次
- */
- public static final long INTERVAL_SEND_CAR_LOCATION_AND_ADAS_RECOGNIZED_RESULT_2_SERVER = 1 * 1_000L;
-
- /**
- * adas识别数据
- */
- public static final String TYPE_MARKER_ADAS = "TYPE_MARKER_ADAS";
-
- /**
- * 云端下发数据
- */
- public static final String TYPE_MARKER_CLOUD_DATA = "TYPE_MARKER_CLOUD_DATA";
}
diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/datamanager/MogoDataHandler.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/datamanager/MogoDataHandler.java
index ab6dcd102e..586e8c134e 100644
--- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/datamanager/MogoDataHandler.java
+++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/datamanager/MogoDataHandler.java
@@ -38,7 +38,8 @@ public class MogoDataHandler implements IMogoDataManager {
return InstanceHolder.INSTANCE;
}
- public synchronized void registerDataListener( String tag, IMogoDataChangedListener listener ) {
+ @Override
+ public synchronized void registerDataListener(String tag, IMogoDataChangedListener listener ) {
if ( listener == null || TextUtils.isEmpty( tag ) ) {
return;
}
@@ -48,7 +49,8 @@ public class MogoDataHandler implements IMogoDataManager {
mListeners.get( tag ).add( listener );
}
- public synchronized void unregisterListener( String tag, IMogoDataChangedListener listener ) {
+ @Override
+ public synchronized void unregisterListener(String tag, IMogoDataChangedListener listener ) {
if ( listener == null || TextUtils.isEmpty( tag ) ) {
return;
}
diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/AIAssistIntentHandler.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/AIAssistIntentHandler.java
index b7e22acdaa..67d928a0c1 100644
--- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/AIAssistIntentHandler.java
+++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/AIAssistIntentHandler.java
@@ -6,14 +6,14 @@ import android.content.Intent;
import com.mogo.commons.voice.AIAssist;
import com.mogo.module.service.MarkerServiceHandler;
-public
+
/**
* @author congtaowang
* @since 2020/6/5
*
* 描述
*/
-class AIAssistIntentHandler implements IntentHandler {
+public class AIAssistIntentHandler implements IntentHandler {
private static final String TAG = "AIAssistIntentHandler";
diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/AppOperationIntentHandler.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/AppOperationIntentHandler.java
deleted file mode 100644
index a937300b27..0000000000
--- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/AppOperationIntentHandler.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package com.mogo.module.service.intent;
-
-import android.content.Context;
-import android.content.Intent;
-import android.text.TextUtils;
-
-import com.mogo.eagle.core.utilcode.util.LaunchUtils;
-import com.mogo.module.service.MarkerServiceHandler;
-import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
-
-import org.json.JSONObject;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author congtaowang
- * @since 2020-04-17
- *
- * 描述
- */
-public class AppOperationIntentHandler implements IntentHandler {
-
- public final Map< String, String > sAppPackages = new HashMap<>();
-
- public AppOperationIntentHandler() {
-// sAppPackages.put( "车聊聊", "com.zhidao.imdemo" );
-// sAppPackages.put( "VR模式", "" );
- }
-
- @Override
- public void handle( Context context, Intent intent ) {
- try {
- JSONObject object = new JSONObject( intent.getStringExtra( "data" ) );
- String app = object.optString( "object" );
- String operation = object.optString( "operation" );
- if ( TextUtils.equals( "打开", operation ) ) {
- if ( TextUtils.equals( "VR模式", app ) ) {
- if ( MarkerServiceHandler.getApis().getStatusManagerApi().isMainPageOnResume() ) {
- MarkerServiceHandler.getApis().getMapFrameControllerApi().changeToVRMode();
- }
- return;
- }
- if ( TextUtils.isEmpty( sAppPackages.get( app ) ) ) {
- return;
- }
- try {
- LaunchUtils.launchByPkg( context, sAppPackages.get( app ) );
- } catch ( Exception e ) {
- TipToast.shortTip( "应用程序未安装" );
- }
- } else if ( TextUtils.equals( "关闭", operation ) ) {
- if ( TextUtils.equals( "VR模式", app ) ) {
- if ( MarkerServiceHandler.getApis().getStatusManagerApi().isMainPageOnResume() ) {
- MarkerServiceHandler.getApis().getMapFrameControllerApi().changeTo2dMode();
- }
- return;
- }
- }
- } catch ( Exception e ) {
- e.printStackTrace();
- }
- }
-}
diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/IntentHandlerFactory.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/IntentHandlerFactory.java
index 2b440d9efe..70435f59e4 100644
--- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/IntentHandlerFactory.java
+++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/IntentHandlerFactory.java
@@ -22,13 +22,7 @@ public class IntentHandlerFactory {
private IntentHandlerFactory() {
// private constructor
mHandlers.put( MogoReceiver.ACTION_MOCK, new MockIntentHandler() );
- mHandlers.put( ServiceConst.COMMAND_OPERATION, new AppOperationIntentHandler() );
mHandlers.put( ServiceConst.COMMAND_MY_LOCATION, new MyLocationHandler() );
- mHandlers.put( ServiceConst.COMMAND_ZHIDAO_NEARBY_CAR_ONLINE, OnlineCarSearchIntentHandler.getInstance() );
- mHandlers.put( ServiceConst.COMMAND_ZHIDAO_NEARBY_FRIEND_ONLINE, OnlineCarSearchIntentHandler.getInstance() );
- mHandlers.put( ServiceConst.COMMAND_ZHIDAO_NEARBY_FRIEND, OnlineCarSearchIntentHandler.getInstance() );
- mHandlers.put( ServiceConst.COMMAND_ZHIDAO_NEARBY_USER_ONLINE, OnlineCarSearchIntentHandler.getInstance() );
- mHandlers.put( ServiceConst.COMMAND_ZHIDAO_NEARBY_FRIEND_BYLOCATION, OnlineCarSearchIntentHandler.getInstance() );
mHandlers.put( MogoReceiver.ACTION_VOICE_UI, new VoiceUiIntentHandler() );
mHandlers.put( Intent.ACTION_POWER_CONNECTED, AccStatusIntentHandler.getInstance() );
mHandlers.put( Intent.ACTION_POWER_DISCONNECTED, AccStatusIntentHandler.getInstance() );
@@ -38,7 +32,6 @@ public class IntentHandlerFactory {
mHandlers.put( MogoReceiver.ACTION_VOICE_READY, new AIAssistIntentHandler() );
mHandlers.put( ServiceConst.COMMAND_BACK, WholeVoiceCommandIntentHandler.getInstance() );
mHandlers.put( MogoReceiver.ACTION_MOGO, new MogoControllerIntentHandler() );
- mHandlers.put( ServiceConst.COMMAND_ONLINE_CAR_PANEL, new OnlineCarPanelIntentHandler() );
mHandlers.put( ConnectivityManager.CONNECTIVITY_ACTION, new NetworkChangedIntentHandler() );
}
diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/OnlineCarPanelIntentHandler.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/OnlineCarPanelIntentHandler.java
deleted file mode 100644
index 0fc9085e6d..0000000000
--- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/OnlineCarPanelIntentHandler.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.mogo.module.service.intent;
-
-import android.content.Context;
-import android.content.Intent;
-import android.net.Uri;
-import android.text.TextUtils;
-
-import com.mogo.commons.storage.SpStorage;
-import com.mogo.commons.voice.AIAssist;
-import com.mogo.module.service.MarkerServiceHandler;
-
-public
-/**
- * @author congtaowang
- * @since 2020/9/21
- *
- * 描述
- */
-class OnlineCarPanelIntentHandler implements IntentHandler {
-
- @Override
- public void handle( Context context, Intent intent ) {
- String json = SpStorage.getNavigationTarget();
- if ( TextUtils.isEmpty( json ) ) {
- AIAssist.getInstance( context ).speakTTSVoice( "没有导航目的地" );
- return;
- }
- AIAssist.getInstance( context ).speakTTSVoice( "正在查询" );
- if ( MarkerServiceHandler.getMogoStatusManager().isMainPageOnResume() ) {
- MarkerServiceHandler.getApis().getOnlineCarPanelApi().showPanel();
- } else {
- Intent start = new Intent( Intent.ACTION_VIEW );
- start.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
- start.setData( Uri.parse( "mogo://launcher/main/switch2?type=showOnlineCarPanel" ) );
- context.startActivity( start );
- }
- }
-}
diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/OnlineCarSearchIntentHandler.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/OnlineCarSearchIntentHandler.java
deleted file mode 100644
index 5bde5b23b7..0000000000
--- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/OnlineCarSearchIntentHandler.java
+++ /dev/null
@@ -1,183 +0,0 @@
-package com.mogo.module.service.intent;
-
-import android.content.Context;
-import android.content.Intent;
-import android.text.TextUtils;
-
-import com.mogo.commons.debug.DebugConfig;
-import com.mogo.eagle.core.data.map.MogoLatLng;
-import com.mogo.eagle.core.data.map.MogoLocation;
-import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
-import com.mogo.map.search.geo.IMogoGeoSearch;
-import com.mogo.map.search.geo.IMogoGeoSearchListener;
-import com.mogo.map.search.geo.MogoGeocodeAddress;
-import com.mogo.map.search.geo.MogoGeocodeResult;
-import com.mogo.map.search.geo.query.MogoGeocodeQuery;
-import com.mogo.module.service.MarkerServiceHandler;
-import com.mogo.module.service.ServiceConst;
-import com.mogo.module.service.marker.MapMarkerManager;
-import com.mogo.module.service.receiver.MogoReceiver;
-
-import org.json.JSONObject;
-
-public
-/**
- * @author congtaowang
- * @since 2020/6/5
- *
- * 描述
- */
-class OnlineCarSearchIntentHandler implements IntentHandler {
-
- private static final String TAG = "OnlineCarSearchIntentHandler";
-
- private static volatile OnlineCarSearchIntentHandler sInstance;
-
- private OnlineCarSearchIntentHandler() {
- }
-
- public static OnlineCarSearchIntentHandler getInstance() {
- if ( sInstance == null ) {
- synchronized ( OnlineCarSearchIntentHandler.class ) {
- if ( sInstance == null ) {
- sInstance = new OnlineCarSearchIntentHandler();
- }
- }
- }
- return sInstance;
- }
-
- public synchronized void release() {
- sInstance = null;
- }
-
- @Override
- public void handle( Context context, Intent intent ) {
-
- if ( DebugConfig.isNeedUploadCoordinatesDurationInTime() ) {
- return;
- }
-
- String command = intent.getStringExtra( MogoReceiver.PARAM_COMMAND );
- if ( TextUtils.isEmpty( command ) ) {
- return;
- }
-
- MogoLocation location = MarkerServiceHandler.getMogoLocationClient().getLastKnowLocation();
- MogoLatLng target = null;
- if ( location != null ) {
- target = new MogoLatLng( location.getLatitude(), location.getLongitude() );
- }
- boolean isFocus = false;
- boolean isSameCity = false;
- switch ( command ) {
- case ServiceConst.COMMAND_ZHIDAO_NEARBY_FRIEND:
- case ServiceConst.COMMAND_ZHIDAO_NEARBY_USER_ONLINE:
- isFocus = true;
- isSameCity = true;
- case ServiceConst.COMMAND_ZHIDAO_NEARBY_CAR_ONLINE:
- case ServiceConst.COMMAND_ZHIDAO_NEARBY_FRIEND_ONLINE:
- Logger.d( TAG, "搜索附近的好友/在线车辆" );
- doDataRequest(
- target,
- isFocus,
- isSameCity,
- ServiceConst.ONLINE_SEARCH_LIMIT,
- ServiceConst.ONLINE_SEARCH_RADIUS );
- break;
- case ServiceConst.COMMAND_ZHIDAO_NEARBY_FRIEND_BYLOCATION:
- handleAreaSearch( intent, context, target );
- break;
- }
- }
-
- private void handleAreaSearch( Intent intent, Context context, MogoLatLng target ) {
- String data = intent.getStringExtra( "data" );
- if ( TextUtils.isEmpty( data ) ) {
- Logger.e( TAG, "语音没有携带数据!!!!!" );
- return;
- }
- String keyword = null;
- try {
- JSONObject jsonObject = new JSONObject( data );
- keyword = jsonObject.get( "location" ).toString();
- Logger.d( TAG, "location 查询指定位置的好友 keyword = " + keyword );
- } catch ( Exception e ) {
- Logger.e( TAG, "语音携带数据异常!!!!!" );
- return;
- }
-
- if ( TextUtils.isEmpty( keyword ) ) {
- Logger.e( TAG, "语音携带数据为空!!!!!" );
- return;
- }
-
- if ( TextUtils.equals( "附近", keyword ) ) {
- doDataRequest(
- target,
- false,
- false,
- ServiceConst.ONLINE_SEARCH_LIMIT,
- ServiceConst.ONLINE_SEARCH_RADIUS );
- } else {
- String cityCode = MarkerServiceHandler.getMogoLocationClient().getLastKnowLocation().getCityCode();
- IMogoGeoSearch search = MarkerServiceHandler.getMapService().getGeoSearch( context );
- search.setGeoSearchListener( new IMogoGeoSearchListener() {
- @Override
- public void onGeocodeSearched( MogoGeocodeResult geocodeResult ) {
- MogoLatLng target = getGeoTargetAddress( geocodeResult );
- if ( target == null ) {
- Logger.e( TAG, "geo 检索位置错误" );
- return;
- }
- doDataRequest(
- target,
- false,
- false,
- ServiceConst.ONLINE_SEARCH_LIMIT,
- ServiceConst.ONLINE_SEARCH_RADIUS );
- }
- } );
- MogoGeocodeQuery mogoGeocodeQuery = new MogoGeocodeQuery();
- mogoGeocodeQuery.setCity( cityCode );
- mogoGeocodeQuery.setLocationName( keyword );
- search.getFromLocationNameAsyn( mogoGeocodeQuery );
- }
- }
-
- private MogoLatLng getGeoTargetAddress( MogoGeocodeResult geocodeResult ) {
- if ( geocodeResult == null
- || geocodeResult.getAddresses() == null
- || geocodeResult.getAddresses().isEmpty() ) {
- return null;
- }
- for ( MogoGeocodeAddress address : geocodeResult.getAddresses() ) {
- if ( address == null ) {
- continue;
- }
- if ( address.getLatlng() == null ) {
- continue;
- }
- return address.getLatlng();
- }
- return null;
- }
-
- private void doDataRequest( MogoLatLng target,
- boolean onlyFocus,
- boolean onlySameCity,
- int limit,
- int radius ) {
- MarkerServiceHandler.getApis().getRefreshStrategyControllerApi().restartAutoRefreshAtTime( 30_000 );
- MarkerServiceHandler.getMogoStatusManager().setUserInteractionStatus( TAG, true, false );
- if(!MarkerServiceHandler.getApis().getStatusManagerApi().isVrMode()){
- MarkerServiceHandler.getMapUIController().moveToCenter( target );
- }
- MapMarkerManager.getInstance().getOnlineCarDataByVoiceControl(
- target,
- onlyFocus,
- onlySameCity,
- limit,
- radius );
- }
-}
diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java
index 7b71eeda41..f8378da154 100644
--- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java
+++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java
@@ -9,6 +9,7 @@ import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
+import com.mogo.eagle.core.utilcode.mogo.toast.ResourcesHelper;
import com.mogo.eagle.core.utilcode.util.ThreadPoolService;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.eagle.core.utilcode.util.ViewUtils;
@@ -19,7 +20,6 @@ import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.module.common.ModuleNames;
import com.mogo.module.common.api.CallChatApi;
import com.mogo.module.common.drawer.MarkerDrawer;
-import com.mogo.module.common.drawer.OnlineCarDrawer;
import com.mogo.module.common.drawer.RoadConditionDrawer;
import com.mogo.module.common.drawer.marker.IMarkerView;
import com.mogo.module.common.drawer.marker.MapMarkerAdapter;
@@ -39,7 +39,6 @@ import com.mogo.realtime.api.MoGoAiCloudRealTime;
import com.mogo.realtime.socket.IMogoCloudOnMsgListener;
import com.mogo.service.adas.IMogoADASControlStatusChangedListener;
import com.mogo.service.module.IMogoBizActionDoneListener;
-import com.mogo.eagle.core.utilcode.mogo.toast.ResourcesHelper;
import com.zhidao.carchattingprovider.ICallChatResponse;
import org.json.JSONArray;
@@ -555,32 +554,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
mCarLatLng = new MogoLatLng(lat, lon);
}
- /**
- * 根据经纬度请求数据
- *
- * @param latlng
- */
- public void getOnlineCarDataByAutoRefreshStrategy(MogoLatLng latlng) {
- UiThreadHandler.removeCallbacks(runnable);
- getOnlineCarDataImpl(latlng, false, false, ServiceConst.ONLINE_SEARCH_LIMIT, ServiceConst.ONLINE_SEARCH_RADIUS, false);
- }
-
- /**
- * @param latLng
- * @param onlyFocus
- * @param onlySameCity
- * @param limit
- * @param radius
- */
- public void getOnlineCarDataByVoiceControl(MogoLatLng latLng,
- boolean onlyFocus,
- boolean onlySameCity,
- int limit,
- int radius) {
- UiThreadHandler.removeCallbacks(runnable);
- getOnlineCarDataImpl(latLng, onlyFocus, onlySameCity, limit, radius, true);
- }
-
private final Runnable runnable = new Runnable() {
@Override
public void run() {
@@ -662,7 +635,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
runOnTargetThread(() -> {
trackData(size);
- OnlineCarDrawer.getInstance().drawOnlineCarMarkers(onlineCarList, Integer.MAX_VALUE, fitBounds, fitBounds, mMarkerDisplayBounds, latLng, MapMarkerManager.this);
UiThreadHandler.postDelayed(runnable, SMOOTH_DURATION * 1000);
});
}
diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/mocktools/DataCollectionHandler.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/mocktools/DataCollectionHandler.java
deleted file mode 100644
index 8f7b2b6419..0000000000
--- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/mocktools/DataCollectionHandler.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package com.mogo.module.service.mocktools;
-
-import android.os.Environment;
-import android.os.Handler;
-import android.os.Message;
-
-import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler;
-
-import java.io.File;
-
-public class DataCollectionHandler {
-
- private static volatile DataCollectionHandler handler;
- private static final byte[] obj = new byte[0];
- private volatile boolean openDataCollect = false;
-
- private Handler mLocationDataCollectHandler;
- private Handler mRecognizeDataCollectHandler;
-
- private static final String WRITE_FILE_PATH = Environment.getExternalStorageDirectory().getPath() + File.separator + "mockWrite";
-
- private DataCollectionHandler() {
-
- }
-
- public static DataCollectionHandler getInstance() {
- if (handler == null) {
- synchronized (obj) {
- if (handler == null) {
- handler = new DataCollectionHandler();
- }
- }
- }
- return handler;
- }
-
- public void start() {
- openDataCollect = true;
- }
-
- public boolean canCollectData() {
- return openDataCollect;
- }
-
- public void collectLocationDataToFile(String locationData) {
- if (mLocationDataCollectHandler == null) {
- mLocationDataCollectHandler = new Handler(WorkThreadHandler.newInstance("data-collect-thread").getLooper()) {
- @Override
- public void handleMessage(Message msg) {
- super.handleMessage(msg);
-
- }
- };
- }
- }
-
- public void collectRecogniseDataToFile() {
- if (mRecognizeDataCollectHandler == null) {
- mRecognizeDataCollectHandler = new Handler(WorkThreadHandler.newInstance("recognize-collect-thread").getLooper()) {
- @Override
- public void handleMessage(Message msg) {
- super.handleMessage(msg);
-
- }
- };
- }
- }
-
- public void stop() {
- openDataCollect = false;
- mLocationDataCollectHandler = null;
- mRecognizeDataCollectHandler = null;
- }
-
-}
diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/polyline/LimberCollisionPolyline.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/polyline/LimberCollisionPolyline.java
deleted file mode 100644
index c7da3419fa..0000000000
--- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/polyline/LimberCollisionPolyline.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package com.mogo.module.service.polyline;
-
-import com.mogo.eagle.core.data.map.MogoLatLng;
-import com.mogo.map.overlay.IMogoPolyline;
-import com.mogo.map.overlay.MogoPolylineOptions;
-import com.mogo.module.service.MarkerServiceHandler;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author lixiaopeng
- * @description 前车碰撞的画线
- * @since 2021/4/25
- */
-public class LimberCollisionPolyline {
-
- private volatile static LimberCollisionPolyline mInstance = null;
-
- private IMogoPolyline mMoGoPolyline;
- // 连接线参数
- private MogoPolylineOptions mPolylineOptions;
- // 线路径集合
- private List