[Upload]
删除冗余代码 MoGoEagleEye.modules.mogo-module-map MoGoEagleEye.modules.mogo-module-service MoGoEagleEye.modules.mogo-module-share MoGoEagleEye.services.mogo-service-api Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
@@ -10,7 +10,6 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi;
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst;
|
||||
import com.mogo.eagle.core.function.v2x.events.network.V2XRefreshModel;
|
||||
@@ -19,10 +18,10 @@ import com.mogo.eagle.core.function.v2x.events.utils.ChartingUtil;
|
||||
import com.mogo.eagle.core.function.v2x.events.utils.RoadConditionUtils;
|
||||
import com.mogo.eagle.core.function.v2x.events.utils.TrackUtils;
|
||||
import com.mogo.eagle.core.function.v2x.events.utils.V2XSQLiteUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.Utils;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.navi.IMogoNaviListener;
|
||||
import com.mogo.map.navi.MogoNaviInfo;
|
||||
import com.mogo.map.navi.MogoTraffic;
|
||||
@@ -30,7 +29,6 @@ import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.MarkerLocation;
|
||||
import com.mogo.module.common.entity.V2XEventZanData;
|
||||
import com.mogo.service.module.IMogoRegisterCenter;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.zhidao.carchattingprovider.CallChattingProviderConstant;
|
||||
import com.zhidao.carchattingprovider.ICarsChattingProvider;
|
||||
import com.zhidao.carchattingprovider.MogoDriverInfo;
|
||||
@@ -193,34 +191,6 @@ public abstract class V2XBaseViewHolder<T>
|
||||
delayedCloseWindow();
|
||||
}
|
||||
|
||||
/**
|
||||
* 导航规划路线
|
||||
*/
|
||||
public void triggerStartNavi(MarkerExploreWay noveltyInfo) {
|
||||
try {
|
||||
IMogoRegisterCenter registerCenter = BridgeApi.INSTANCE.registerCenter();
|
||||
if (registerCenter != null) {
|
||||
registerCenter.registerMogoNaviListener(MODULE_NAME, this);
|
||||
}
|
||||
MogoLatLng endPoint = new MogoLatLng(
|
||||
noveltyInfo.getLocation().getLat(),
|
||||
noveltyInfo.getLocation().getLon());
|
||||
|
||||
IMogoNavi navi = BridgeApi.INSTANCE.navi();
|
||||
if (navi != null) {
|
||||
navi.naviTo(endPoint);
|
||||
}
|
||||
TrackUtils.trackV2xRoadEvent(
|
||||
noveltyInfo.getInfoId(),
|
||||
noveltyInfo.getSn(),
|
||||
V2XConst.V2X_ROAD_NAVI);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
TipToast.tip("路况信息异常");
|
||||
}
|
||||
delayedCloseWindow();
|
||||
}
|
||||
|
||||
public void triggerCancel(){
|
||||
delayedCloseWindow();
|
||||
}
|
||||
@@ -263,11 +233,6 @@ public abstract class V2XBaseViewHolder<T>
|
||||
@Override
|
||||
public void onCalculateSuccess() {
|
||||
Logger.w(TAG, "onCalculateSuccess");
|
||||
|
||||
IMogoNavi navi = BridgeApi.INSTANCE.navi();
|
||||
if (navi != null) {
|
||||
navi.startNavi(true);
|
||||
}
|
||||
IMogoRegisterCenter registerCenter = BridgeApi.INSTANCE.registerCenter();
|
||||
|
||||
if (registerCenter != null) {
|
||||
|
||||
@@ -32,12 +32,11 @@ import com.mogo.module.v2x.voice.V2XVoiceManager;
|
||||
public class V2XFatigueDrivingVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
|
||||
private TextView mTvAddress, mTvAddressDistance;
|
||||
private ImageView mIvToNav, mIvClose;
|
||||
private ImageView mIvClose;
|
||||
private MarkerExploreWay mNoveltyInfo;
|
||||
private V2XPushMessageEntity mV2XPushMessageEntity;
|
||||
|
||||
// 语音控制导航
|
||||
private V2XVoiceCallbackListener mNaviCb = (command, intent) -> triggerStartNavi(mNoveltyInfo);
|
||||
private V2XVoiceCallbackListener mNaviCancel = (command, intent) -> triggerCancel();
|
||||
|
||||
public V2XFatigueDrivingVH(ViewGroup viewGroup, IV2XWindow v2XWindow) {
|
||||
@@ -46,9 +45,7 @@ public class V2XFatigueDrivingVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
, v2XWindow);
|
||||
mTvAddress = itemView.findViewById(R.id.tvAddress);
|
||||
mTvAddressDistance = itemView.findViewById(R.id.tvAddressDistance);
|
||||
mIvToNav = itemView.findViewById(R.id.ivToNav);
|
||||
mIvClose = itemView.findViewById(R.id.ivClose);
|
||||
mIvToNav.setOnClickListener(v -> triggerStartNavi(mNoveltyInfo));
|
||||
mIvClose.setOnClickListener(v -> delayedCloseWindow());
|
||||
|
||||
// 设置视图状态监听
|
||||
@@ -56,13 +53,6 @@ public class V2XFatigueDrivingVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
@Override
|
||||
public void onViewAttachedToWindow(View v) {
|
||||
//Logger.w(MODULE_NAME, "列表View V2XPushEventDetailVH 触发 onViewAttachedToWindow");
|
||||
// 注册语音交互
|
||||
V2XVoiceManager.INSTANCE
|
||||
.registerWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_NAVI,
|
||||
mNaviCb)
|
||||
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_NAVI_UN_WAKEUP,
|
||||
mNaviCb);
|
||||
|
||||
V2XVoiceManager.INSTANCE
|
||||
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_CANCEL_NAVI_UN_WAKEUP,mNaviCancel);
|
||||
|
||||
|
||||
@@ -10,25 +10,23 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi;
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst;
|
||||
import com.mogo.eagle.core.function.v2x.events.utils.ChartingUtil;
|
||||
import com.mogo.eagle.core.function.v2x.events.utils.RoadConditionUtils;
|
||||
import com.mogo.eagle.core.function.v2x.events.utils.TrackUtils;
|
||||
import com.mogo.eagle.core.function.v2x.events.utils.V2XSQLiteUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.Utils;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.navi.IMogoNaviListener;
|
||||
import com.mogo.map.navi.MogoNaviInfo;
|
||||
import com.mogo.map.navi.MogoTraffic;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.MarkerLocation;
|
||||
import com.mogo.module.common.entity.V2XEventZanData;
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
|
||||
import com.mogo.service.module.IMogoRegisterCenter;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.zhidao.carchattingprovider.CallChattingProviderConstant;
|
||||
import com.zhidao.carchattingprovider.ICarsChattingProvider;
|
||||
import com.zhidao.carchattingprovider.MogoDriverInfo;
|
||||
@@ -180,36 +178,6 @@ public abstract class V2XHistoryBaseViewHolder<T>
|
||||
delayedCloseWindow();
|
||||
}
|
||||
|
||||
/**
|
||||
* 导航规划路线
|
||||
*/
|
||||
public void triggerStartNavi(MarkerExploreWay noveltyInfo) {
|
||||
try {
|
||||
|
||||
IMogoRegisterCenter registerCenter = BridgeApi.INSTANCE.registerCenter();
|
||||
if (registerCenter != null) {
|
||||
registerCenter.registerMogoNaviListener(MODULE_NAME, this);
|
||||
}
|
||||
MogoLatLng endPoint = new MogoLatLng(
|
||||
noveltyInfo.getLocation().getLat(),
|
||||
noveltyInfo.getLocation().getLon());
|
||||
|
||||
IMogoNavi navi = BridgeApi.INSTANCE.navi();
|
||||
if (navi != null) {
|
||||
navi.naviTo(endPoint);
|
||||
}
|
||||
TrackUtils.trackV2xRoadEvent(
|
||||
noveltyInfo.getInfoId(),
|
||||
noveltyInfo.getSn(),
|
||||
V2XConst.V2X_ROAD_NAVI);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
TipToast.tip("路况信息异常");
|
||||
}
|
||||
delayedCloseWindow();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 显示自定义 Toast
|
||||
*
|
||||
@@ -247,10 +215,6 @@ public abstract class V2XHistoryBaseViewHolder<T>
|
||||
@Override
|
||||
public void onCalculateSuccess() {
|
||||
Logger.w(TAG, "onCalculateSuccess");
|
||||
IMogoNavi navi = BridgeApi.INSTANCE.navi();
|
||||
if (navi != null) {
|
||||
navi.startNavi(true);
|
||||
}
|
||||
IMogoRegisterCenter registerCenter = BridgeApi.INSTANCE.registerCenter();
|
||||
if (registerCenter != null) {
|
||||
registerCenter.unregisterMogoNaviListener(MODULE_NAME);
|
||||
|
||||
@@ -55,15 +55,12 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
private TextView tvDistance;
|
||||
private TextView tvEventTime;
|
||||
private ImageView ivCall;
|
||||
private ImageView ivNavi;
|
||||
|
||||
private V2XPushMessageEntity mV2XPushMessageEntity;
|
||||
private MarkerExploreWay mNoveltyInfo;
|
||||
|
||||
// 上传事件的用户信息
|
||||
private MarkerUserInfo mUserInfo = new MarkerUserInfo();
|
||||
// 语音控制导航
|
||||
private V2XVoiceCallbackListener mNaviCb = (command, intent) -> triggerStartNavi(mNoveltyInfo);
|
||||
// 语音控制拨打电话
|
||||
private V2XVoiceCallbackListener mCallChartingCb = (command, intent) -> {
|
||||
try {
|
||||
@@ -88,14 +85,6 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
tvDistance = itemView.findViewById(R.id.tvFaultHelpDistance);
|
||||
tvEventTime = itemView.findViewById(R.id.tvFaultHelpEventTime);
|
||||
ivCall = itemView.findViewById(R.id.ivFaultHelpEventCall);
|
||||
ivNavi = itemView.findViewById(R.id.ivFaultHelpEventNavi);
|
||||
ivNavi.setOnClickListener(v -> {
|
||||
triggerStartNavi(mNoveltyInfo);
|
||||
V2XRefreshModel v2XRefreshModel = BridgeApi.INSTANCE.refreshModel();
|
||||
if (v2XRefreshModel != null) {
|
||||
v2XRefreshModel.respondingToHelp(mUserInfo.getSn());
|
||||
}
|
||||
});
|
||||
|
||||
// 设置视图状态监听
|
||||
itemView.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
|
||||
@@ -104,10 +93,6 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
//Logger.w(MODULE_NAME, "列表View V2XPushEventDetailVH 触发 onViewAttachedToWindow");
|
||||
// 注册语音交互
|
||||
V2XVoiceManager.INSTANCE
|
||||
.registerWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_NAVI,
|
||||
mNaviCb)
|
||||
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_NAVI_UN_WAKEUP,
|
||||
mNaviCb)
|
||||
.registerWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_CALL_CHATTING,
|
||||
mCallChartingCb)
|
||||
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_CHAT_MORE_UN_WAKEUP,
|
||||
@@ -121,8 +106,6 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
//Logger.w(MODULE_NAME, "列表View V2XPushEventDetailVH 触发 onViewDetachedFromWindow");
|
||||
// 反注册语音交互
|
||||
V2XVoiceManager.INSTANCE
|
||||
.unRegisterWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_NAVI)
|
||||
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_NAVI_UN_WAKEUP)
|
||||
.unRegisterWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_CALL_CHATTING)
|
||||
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_CHAT_MORE_UN_WAKEUP)
|
||||
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_CAR_INFO_UN_WAKEUP);
|
||||
|
||||
@@ -40,7 +40,6 @@ public class V2XPushEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
private ImageView ivRoadReportTrue;
|
||||
private ImageView ivRoadReportErr;
|
||||
private ImageView ivRoadCallChart;
|
||||
private ImageView ivRoadEventNav;
|
||||
private ImageView ivRoadEventLike;
|
||||
|
||||
// 上传事件的用户信息
|
||||
@@ -49,8 +48,6 @@ public class V2XPushEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
private V2XPushMessageEntity mV2XRoadEventEntity;
|
||||
private MarkerExploreWay mNoveltyInfo;
|
||||
|
||||
// 语音控制导航
|
||||
private V2XVoiceCallbackListener mNaviCb = (command, intent) -> triggerStartNavi(mNoveltyInfo);
|
||||
// 语音控制拨打电话
|
||||
private V2XVoiceCallbackListener mCallChartingCb = (command, intent) -> {
|
||||
try {
|
||||
@@ -78,11 +75,8 @@ public class V2XPushEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
ivRoadReportTrue = itemView.findViewById(R.id.ivRoadReportTrue);
|
||||
ivRoadReportErr = itemView.findViewById(R.id.ivRoadReportErr);
|
||||
ivRoadCallChart = itemView.findViewById(R.id.ivRoadCallChart);
|
||||
ivRoadEventNav = itemView.findViewById(R.id.ivRoadEventNav);
|
||||
ivRoadEventLike = itemView.findViewById(R.id.ivRoadEventLike);
|
||||
|
||||
ivRoadEventNav.getParent().getParent().requestDisallowInterceptTouchEvent(true);
|
||||
ivRoadEventNav.setOnClickListener(v -> triggerStartNavi(mNoveltyInfo));
|
||||
ivRoadCallChart.setOnClickListener(v -> {
|
||||
try {
|
||||
mUserInfo.setSn(mV2XRoadEventEntity.getSn());
|
||||
@@ -105,10 +99,6 @@ public class V2XPushEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
//Logger.w(MODULE_NAME, "列表View V2XPushEventDetailVH 触发 onViewAttachedToWindow");
|
||||
// 注册语音交互
|
||||
V2XVoiceManager.INSTANCE
|
||||
.registerWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_NAVI,
|
||||
mNaviCb)
|
||||
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_NAVI_UN_WAKEUP,
|
||||
mNaviCb)
|
||||
.registerWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_CALL_CHATTING,
|
||||
mCallChartingCb)
|
||||
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_CHAT_MORE_UN_WAKEUP,
|
||||
@@ -128,8 +118,6 @@ public class V2XPushEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
}
|
||||
// 反注册语音交互
|
||||
V2XVoiceManager.INSTANCE
|
||||
.unRegisterWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_NAVI)
|
||||
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_NAVI_UN_WAKEUP)
|
||||
.unRegisterWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_CLOSE_WINDOW)
|
||||
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_CLOSE_WINDOW_UN_WAKEUP)
|
||||
.unRegisterWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_CALL_CHATTING)
|
||||
@@ -171,7 +159,6 @@ public class V2XPushEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
switch (mV2XRoadEventEntity.getSceneId()) {
|
||||
case "100015"://取快递
|
||||
case "100016"://顺风车
|
||||
ivRoadEventNav.setVisibility(View.VISIBLE);
|
||||
ivRoadCallChart.setVisibility(View.VISIBLE);
|
||||
ivRoadReportTrue.setVisibility(View.GONE);
|
||||
ivRoadReportErr.setVisibility(View.GONE);
|
||||
@@ -182,7 +169,6 @@ public class V2XPushEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
case "100018"://故障车辆推送
|
||||
ivRoadEventLike.setVisibility(View.VISIBLE);
|
||||
ivRoadCallChart.setVisibility(View.GONE);
|
||||
ivRoadEventNav.setVisibility(View.GONE);
|
||||
ivRoadReportTrue.setVisibility(View.GONE);
|
||||
ivRoadReportErr.setVisibility(View.GONE);
|
||||
break;
|
||||
|
||||
@@ -31,16 +31,13 @@ import kotlinx.coroutines.launch
|
||||
class V2XRecommendRouteVH(viewGroup: ViewGroup, v2XWindow: IV2XWindow<*>) : V2XBaseViewHolder<V2XEventShowEntity>(
|
||||
LayoutInflater.from(viewGroup.context).inflate(R.layout.item_v2x_recommend_route, viewGroup, false), v2XWindow), V2XVoiceCallbackListener {
|
||||
private var mTvAddress: TextView? = null
|
||||
private var mIvToNav: ImageView? = null
|
||||
private var mIvClose: ImageView? = null
|
||||
private var mNoveltyInfo: MarkerExploreWay? = null
|
||||
private val mainScope = MainScope()
|
||||
|
||||
init {
|
||||
mTvAddress = itemView.findViewById<TextView>(R.id.tvAddress)
|
||||
mIvToNav = itemView.findViewById<ImageView>(R.id.ivToNav)
|
||||
mIvClose = itemView.findViewById<ImageView>(R.id.ivClose)
|
||||
mIvToNav?.setOnClickListener { triggerStartNavi(mNoveltyInfo) }
|
||||
mTvAddress = itemView.findViewById(R.id.tvAddress)
|
||||
mIvClose = itemView.findViewById(R.id.ivClose)
|
||||
mIvClose?.setOnClickListener { delayedCloseWindow() }
|
||||
itemView.addOnAttachStateChangeListener(object : View.OnAttachStateChangeListener {
|
||||
override fun onViewAttachedToWindow(view: View) {
|
||||
@@ -75,7 +72,6 @@ class V2XRecommendRouteVH(viewGroup: ViewGroup, v2XWindow: IV2XWindow<*>) : V2XB
|
||||
|
||||
override fun onCallback(command: String?, intent: Intent?) {
|
||||
when (command) {
|
||||
V2XVoiceConstants.V2X_CONFIRM_ACTION -> triggerStartNavi(mNoveltyInfo)
|
||||
V2XVoiceConstants.V2X_CANCLE_ACTION -> delayedCloseWindow()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.mogo.eagle.core.function.v2x.events.adapter.holder;
|
||||
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -28,9 +31,6 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
|
||||
/**
|
||||
* 出行动态中的他人故障求助
|
||||
*
|
||||
@@ -45,7 +45,6 @@ public class V2XScenarioHistoryOtherSeekHelpVH extends V2XHistoryBaseViewHolder<
|
||||
private TextView mTvFaultHelpEventTime;
|
||||
private TextView mTvFaultHelpDistance;
|
||||
private ImageView mIvFaultHelpEventCall;
|
||||
private ImageView mIvFaultHelpEventNavi;
|
||||
|
||||
private MarkerExploreWay mNoveltyInfo;
|
||||
// 上传事件的用户信息
|
||||
@@ -63,7 +62,6 @@ public class V2XScenarioHistoryOtherSeekHelpVH extends V2XHistoryBaseViewHolder<
|
||||
mTvFaultHelpEventTime = itemView.findViewById(R.id.tvFaultHelpEventTime);
|
||||
mTvFaultHelpDistance = itemView.findViewById(R.id.tvFaultHelpDistance);
|
||||
mIvFaultHelpEventCall = itemView.findViewById(R.id.ivFaultHelpEventCall);
|
||||
mIvFaultHelpEventNavi = itemView.findViewById(R.id.ivFaultHelpEventNavi);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -118,11 +116,6 @@ public class V2XScenarioHistoryOtherSeekHelpVH extends V2XHistoryBaseViewHolder<
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
mIvFaultHelpEventNavi.setOnClickListener(v -> {
|
||||
BridgeApi.INSTANCE.refreshModel().respondingToHelp(mUserInfo.getSn());
|
||||
triggerStartNavi(mNoveltyInfo);
|
||||
});
|
||||
|
||||
// M1低配车机限制
|
||||
// 不展示打电话按钮
|
||||
// 不能查看用户详情
|
||||
|
||||
@@ -80,8 +80,6 @@ internal object BridgeApi {
|
||||
|
||||
fun analytics() = apis?.analyticsApi
|
||||
|
||||
fun navi() = apis?.mapServiceApi?.getNavi(context())
|
||||
|
||||
fun overlay() = apis?.mapServiceApi?.getOverlayManager(context())
|
||||
|
||||
fun carChatProvider() = carChatProvider
|
||||
|
||||
@@ -63,19 +63,6 @@ public interface IMoGoV2XMarkerManager extends IProvider {
|
||||
*/
|
||||
void clearOnlineCarPOI();
|
||||
|
||||
/**
|
||||
* 绘制 特殊车辆
|
||||
*
|
||||
* @param context
|
||||
* @param v2XMarkerEntity
|
||||
* @param clickListener
|
||||
*/
|
||||
void drawableSpecialCarPOI(Context context, V2XSpecialCarRes.V2XMarkerEntity v2XMarkerEntity, IMogoMarkerClickListener clickListener);
|
||||
|
||||
/**
|
||||
* 清除 特殊车辆 POI
|
||||
*/
|
||||
void clearSpecialCarPOI();
|
||||
|
||||
/**
|
||||
* 绘制可以直播的在线车辆
|
||||
|
||||
@@ -2,20 +2,16 @@ package com.mogo.eagle.core.function.v2x.events.manager.impl;
|
||||
|
||||
import static com.mogo.eagle.core.function.v2x.events.consts.V2XConst.MODULE_NAME;
|
||||
import static com.mogo.eagle.core.function.v2x.events.consts.V2XConst.V2X_EVENT_ALARM_POI;
|
||||
import static com.mogo.module.service.strategy.CarIconDisplayStrategy.sFrameVr;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.v2x.R;
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi;
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.MoGoV2XServicePaths;
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst;
|
||||
import com.mogo.eagle.core.function.v2x.events.entity.net.V2XSpecialCarRes;
|
||||
import com.mogo.eagle.core.function.v2x.events.listener.V2XMarkerClickListener;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XMarkerManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XPolylineManager;
|
||||
@@ -24,6 +20,7 @@ import com.mogo.eagle.core.function.v2x.events.manager.V2XStatusManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.marker.V2XMarkerAdapter;
|
||||
import com.mogo.eagle.core.function.v2x.events.utils.EntityUtilsKt;
|
||||
import com.mogo.eagle.core.function.v2x.events.utils.MapUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.util.ViewUtils;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
@@ -34,7 +31,6 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.common.drawer.MarkerDrawer;
|
||||
import com.mogo.module.common.drawer.marker.IMarkerView;
|
||||
import com.mogo.module.common.drawer.marker.MapMarkerAdapter;
|
||||
import com.mogo.module.common.drawer.marker.RoadConditionInfoWindow3DAdapter;
|
||||
import com.mogo.module.common.entity.MarkerCardResult;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.MarkerLocation;
|
||||
@@ -47,13 +43,11 @@ import com.mogo.module.common.utils.CarSeries;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.module.service.Utils;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.v2x.V2XManager;
|
||||
import com.mogo.v2x.data.V2XMarkerCardResult;
|
||||
import com.mogo.v2x.data.V2XMarkerExploreWay;
|
||||
import com.mogo.v2x.data.V2XMarkerLocation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
@@ -84,7 +78,6 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
|
||||
polylineManager.clearLine();
|
||||
}
|
||||
clearAlarmPOI();
|
||||
clearSpecialCarPOI();
|
||||
// 锁车
|
||||
IMogoMapUIController mapUiController = BridgeApi.INSTANCE.mapUiController();
|
||||
if (mapUiController != null) {
|
||||
@@ -257,152 +250,6 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawableSpecialCarPOI(Context context, V2XSpecialCarRes.V2XMarkerEntity v2XMarkerEntity, IMogoMarkerClickListener clickListener) {
|
||||
try {
|
||||
IMogoMapUIController mapUiController = BridgeApi.INSTANCE.mapUiController();
|
||||
if (mapUiController != null) {
|
||||
mapUiController.changeMapMode(EnumMapUI.NorthUP_2D);
|
||||
}
|
||||
IMoGoV2XStatusManager v2xStatus = BridgeApi.INSTANCE.v2xStatus();
|
||||
if (v2xStatus != null) {
|
||||
v2xStatus.setOtherSeekHelpPOIShow(TAG, true);
|
||||
}
|
||||
|
||||
// 绘制特殊车辆
|
||||
if (v2XMarkerEntity == null) {
|
||||
return;
|
||||
}
|
||||
MarkerLocation markerLocation = new MarkerLocation();
|
||||
markerLocation.setLon(v2XMarkerEntity.getLon());
|
||||
markerLocation.setLat(v2XMarkerEntity.getLat());
|
||||
|
||||
// 进行数据转换,用于Marker展示
|
||||
V2XRoadEventEntity roadEventEntity = new V2XRoadEventEntity();
|
||||
roadEventEntity.setPoiType(v2XMarkerEntity.getTargetId() + "");
|
||||
roadEventEntity.setLocation(markerLocation);
|
||||
roadEventEntity.setBindObj(v2XMarkerEntity);
|
||||
|
||||
MarkerShowEntity markerShowEntity = new MarkerShowEntity();
|
||||
markerShowEntity.setBindObj(v2XMarkerEntity);
|
||||
markerShowEntity.setChecked(false);
|
||||
markerShowEntity.setMarkerLocation(markerLocation);
|
||||
|
||||
// 重置告警信息
|
||||
V2XStatusManager.getInstance().setAlarmInfo(roadEventEntity);
|
||||
|
||||
// 清除原来的大而全的新鲜事儿
|
||||
clearALLPOI();
|
||||
if (roadEventEntity.getLocation() != null) {
|
||||
// 道路事件,或者水波纹扩散效果
|
||||
MogoMarkerOptions optionsRipple = new MogoMarkerOptions()
|
||||
.data(roadEventEntity)
|
||||
.latitude(roadEventEntity.getLocation().getLat())
|
||||
.longitude(roadEventEntity.getLocation().getLon());
|
||||
optionsRipple.anchor(0.5f, 0.5f);
|
||||
|
||||
//由于性能问题,D车机不使用事件扩散动画
|
||||
//showInfoWindow只支持添加单个marker,不支持帧动画
|
||||
if (!CarSeries.isF8xxSeries()) {
|
||||
optionsRipple.icon(V2XMarkerAdapter.getV2XRoadEventViewPng(context, roadEventEntity));
|
||||
boolean isVrMode = false;
|
||||
IMogoStatusManager statusManager = BridgeApi.INSTANCE.statusManager();
|
||||
if (statusManager != null) {
|
||||
isVrMode = statusManager.isVrMode();
|
||||
}
|
||||
if (isVrMode) {
|
||||
mAlarmInfoMarker = MarkerDrawer.getInstance().drawMapMarkerImpl(markerShowEntity, MarkerDrawer.MARKER_Z_INDEX_HIGH, null);
|
||||
mAlarmInfoMarker.setInfoWindowAdapter(new RoadConditionInfoWindow3DAdapter(markerShowEntity, AbsMogoApplication.getApp(), mAlarmInfoMarker.getMogoMarkerOptions()));
|
||||
mAlarmInfoMarker.showInfoWindow();
|
||||
} else {
|
||||
IMogoMarkerManager marker = BridgeApi.INSTANCE.marker();
|
||||
if (marker != null) {
|
||||
mAlarmInfoMarker = marker.addMarker(V2X_EVENT_ALARM_POI, optionsRipple);
|
||||
}
|
||||
}
|
||||
// 当前Marker设置为最上面
|
||||
mAlarmInfoMarker.setToTop();
|
||||
} else {
|
||||
boolean isVrMode = false;
|
||||
IMogoStatusManager statusManager = BridgeApi.INSTANCE.statusManager();
|
||||
if (statusManager != null) {
|
||||
isVrMode = statusManager.isVrMode();
|
||||
}
|
||||
if (isVrMode) {
|
||||
ArrayList<Bitmap> mBitmapFrames = new ArrayList<>();
|
||||
for (int i : sFrameVr) {
|
||||
mBitmapFrames.add(BitmapFactory.decodeResource(AbsMogoApplication.getApp().getResources(), i));
|
||||
}
|
||||
optionsRipple.icons(mBitmapFrames);
|
||||
optionsRipple.period(20);
|
||||
optionsRipple.scale(0.4f);
|
||||
IMogoMarkerManager marker = BridgeApi.INSTANCE.marker();
|
||||
if (marker != null) {
|
||||
mAlarmInfoMarker = marker.addMarker(V2X_EVENT_ALARM_POI, optionsRipple);
|
||||
}
|
||||
|
||||
MogoMarkerOptions options = new MogoMarkerOptions().data(roadEventEntity)
|
||||
.latitude(roadEventEntity.getLocation().getLat()).longitude(roadEventEntity.getLocation().getLon());
|
||||
options.anchor(0.5f, 0.5f);
|
||||
options.icon3DRes(R.raw.special_vehicle);
|
||||
options.anchorColor("#FFBF29FF");
|
||||
if (marker != null) {
|
||||
m3DMarker = marker.addMarker(V2X_EVENT_ALARM_POI, options);
|
||||
}
|
||||
if (m3DMarker != null) {
|
||||
m3DMarker.setToTop();
|
||||
}
|
||||
} else {
|
||||
optionsRipple.icons(V2XMarkerAdapter.getV2XRoadEventViewGif(context, roadEventEntity));
|
||||
optionsRipple.period(100);
|
||||
IMogoMarkerManager marker = BridgeApi.INSTANCE.marker();
|
||||
if (marker != null) {
|
||||
mAlarmInfoMarker = marker.addMarker(V2X_EVENT_ALARM_POI, optionsRipple);
|
||||
}
|
||||
// 当前Marker设置为最上面
|
||||
if (mAlarmInfoMarker != null) {
|
||||
mAlarmInfoMarker.setToTop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 绘制连接线
|
||||
IMoGoV2XPolylineManager iMoGoV2XPolylineManager = BridgeApi.INSTANCE.v2xPolyline();
|
||||
if (iMoGoV2XPolylineManager != null) {
|
||||
iMoGoV2XPolylineManager.drawablePolyline(context, roadEventEntity);
|
||||
}
|
||||
// 缩放地图
|
||||
MapUtils.zoomMap(
|
||||
new MogoLatLng(roadEventEntity.getLocation().getLat(),
|
||||
roadEventEntity.getLocation().getLon()
|
||||
), context);
|
||||
} else {
|
||||
Logger.e(MODULE_NAME, "Location 必须进行初始化!!!!!");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearSpecialCarPOI() {
|
||||
boolean isOtherSeekHelpPOIShow = false;
|
||||
IMoGoV2XStatusManager iMoGoV2XStatusManager = BridgeApi.INSTANCE.v2xStatus();
|
||||
if (iMoGoV2XStatusManager != null) {
|
||||
isOtherSeekHelpPOIShow = iMoGoV2XStatusManager.isOtherSeekHelpPOIShow();
|
||||
}
|
||||
if (isOtherSeekHelpPOIShow) {
|
||||
iMoGoV2XStatusManager.setOtherSeekHelpPOIShow(TAG, false);
|
||||
// 重置告警信息
|
||||
V2XStatusManager.getInstance().setAlarmInfo(null);
|
||||
if (mAlarmInfoMarker != null) {
|
||||
mAlarmInfoMarker.remove();
|
||||
}
|
||||
if (m3DMarker != null) {
|
||||
m3DMarker.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawableLiveCarPOI(List<MarkerOnlineCar> markerOnlineCars, IMogoMarkerClickListener clickListener) {
|
||||
|
||||
@@ -9,10 +9,10 @@ import com.mogo.eagle.core.function.v2x.events.consts.MoGoV2XServicePaths;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XPolylineManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XStatusManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.V2XStatusManager;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.overlay.IMogoOverlayManager;
|
||||
import com.mogo.map.overlay.IMogoPolyline;
|
||||
import com.mogo.map.overlay.MogoPolylineOptions;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.common.enums.EventTypeEnum;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
@@ -76,11 +76,11 @@ public class MoGoV2XPolylineManager implements IMoGoV2XPolylineManager {
|
||||
options.width(10).useGradient(true).colorValues(colors);
|
||||
|
||||
// 当前车辆位置
|
||||
IMogoNavi navi = BridgeApi.INSTANCE.navi();
|
||||
MogoLatLng carLocation = null;
|
||||
if (navi != null) {
|
||||
carLocation = navi.getCarLocation();
|
||||
}
|
||||
MogoLatLng carLocation = new MogoLatLng(
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLat(),
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLon()
|
||||
);
|
||||
|
||||
if (carLocation != null) {
|
||||
options.add(carLocation);
|
||||
} else {
|
||||
|
||||
@@ -6,22 +6,18 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
|
||||
import com.mogo.eagle.core.function.v2x.R;
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XStatusManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.impl.AbsV2XScenario;
|
||||
import com.mogo.eagle.core.function.v2x.events.voice.V2XVoiceCallbackListener;
|
||||
import com.mogo.eagle.core.function.v2x.events.voice.V2XVoiceConstants;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.util.Utils;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XPushMessageEntity;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceManager;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.service.windowview.IMogoTopViewManager;
|
||||
import com.mogo.service.windowview.IMogoTopViewStatusListener;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
|
||||
|
||||
/**
|
||||
@@ -34,9 +30,6 @@ import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
*/
|
||||
public class V2XFatigueDrivingScenario extends AbsV2XScenario<V2XPushMessageEntity> implements IMogoTopViewStatusListener {
|
||||
|
||||
// 语音控制导航
|
||||
private V2XVoiceCallbackListener mNaviCb = (command, intent) -> startNavi();
|
||||
|
||||
public V2XFatigueDrivingScenario() {
|
||||
setV2XWindow(new V2XFatigueDrivingWindow());
|
||||
}
|
||||
@@ -56,10 +49,6 @@ public class V2XFatigueDrivingScenario extends AbsV2XScenario<V2XPushMessageEnti
|
||||
if (!isSameScenario(v2XMessageEntity)) {
|
||||
setV2XMessageEntity(v2XMessageEntity);
|
||||
if (v2XMessageEntity != null) {
|
||||
// 注册语音交互
|
||||
V2XVoiceManager.INSTANCE
|
||||
.registerWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_NAVI, mNaviCb)
|
||||
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_NAVI_UN_WAKEUP, mNaviCb);
|
||||
if (v2XMessageEntity.isShowState()
|
||||
&& isMainPageOnResume) {
|
||||
show();
|
||||
@@ -146,27 +135,4 @@ public class V2XFatigueDrivingScenario extends AbsV2XScenario<V2XPushMessageEnti
|
||||
v2xStatus.setFatigueDrivingWindowShow(TAG, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导航规划路线
|
||||
*/
|
||||
private void startNavi() {
|
||||
if (getV2XMessageEntity().getContent() != null) {
|
||||
// 反注册语音交互
|
||||
V2XVoiceManager.INSTANCE
|
||||
.unRegisterWakeCmd(
|
||||
V2XVoiceConstants.COMMAND_ZHIDAO_V2X_NAVI)
|
||||
.unRegisterUnWakeVoice(
|
||||
V2XVoiceConstants.COMMAND_V2X_TO_NAVI_UN_WAKEUP);
|
||||
MogoLatLng endPoint = new MogoLatLng(getV2XMessageEntity().getContent().getLat(),
|
||||
getV2XMessageEntity().getContent().getLon());
|
||||
IMogoNavi navi = BridgeApi.INSTANCE.navi();
|
||||
if (navi != null) {
|
||||
navi.naviTo(endPoint);
|
||||
}
|
||||
close();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -132,8 +132,6 @@ public class V2XCarForHelpScenario extends AbsV2XScenario<Boolean> implements IM
|
||||
|
||||
IMoGoV2XMarkerManager v2xMarker = BridgeApi.INSTANCE.v2xMarker();
|
||||
if (v2xMarker != null) {
|
||||
// 移除事件POI
|
||||
v2xMarker.clearSpecialCarPOI();
|
||||
// 绘制上次的数据
|
||||
v2xMarker.drawableLastAllPOI();
|
||||
}
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
package com.mogo.eagle.core.function.v2x.events.utils;
|
||||
|
||||
import android.location.Location;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
@@ -26,31 +25,21 @@ public class LocationUtils {
|
||||
* @return 当前位置
|
||||
*/
|
||||
public static MogoLatLng getCurrentLatLon() {
|
||||
IMogoNavi navi = BridgeApi.INSTANCE.navi();
|
||||
MogoLatLng latLon = null;
|
||||
if (navi != null) {
|
||||
latLon = navi.getCarLocation();
|
||||
if (latLon == null) {
|
||||
Location location = navi.getCarLocation2();
|
||||
if (location != null) {
|
||||
latLon = new MogoLatLng(location.getLatitude(), location.getLongitude());
|
||||
}
|
||||
// 当前车辆位置
|
||||
MogoLatLng latLon = new MogoLatLng(
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLat(),
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLon()
|
||||
);
|
||||
IMogoLocationClient locationClient = BridgeApi.INSTANCE.locationClient();
|
||||
if (locationClient != null) {
|
||||
MogoLocation location = locationClient.getLastKnowLocation();
|
||||
if (location != null) {
|
||||
latLon = new MogoLatLng(location.getLatitude(), location.getLongitude());
|
||||
}
|
||||
}
|
||||
if (latLon == null) {
|
||||
IMogoLocationClient locationClient = BridgeApi.INSTANCE.locationClient();
|
||||
if (locationClient != null) {
|
||||
MogoLocation location = locationClient.getLastKnowLocation();
|
||||
if (location != null) {
|
||||
latLon = new MogoLatLng(location.getLatitude(), location.getLongitude());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (latLon == null) {
|
||||
IMogoMapUIController mapUiController = BridgeApi.INSTANCE.mapUiController();
|
||||
if (mapUiController != null) {
|
||||
latLon = mapUiController.getWindowCenterLocation();
|
||||
}
|
||||
IMogoMapUIController mapUiController = BridgeApi.INSTANCE.mapUiController();
|
||||
if (mapUiController != null) {
|
||||
latLon = mapUiController.getWindowCenterLocation();
|
||||
}
|
||||
return latLon;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.graphics.Rect
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi
|
||||
import com.mogo.eagle.core.utilcode.util.WindowUtils
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import com.mogo.module.common.utils.CarSeries
|
||||
import java.lang.Exception
|
||||
|
||||
@@ -18,8 +19,6 @@ class MapUtils {
|
||||
if (latLng == null) {
|
||||
return
|
||||
}
|
||||
// 当前车辆位置
|
||||
val navi = BridgeApi.navi() ?: return
|
||||
//Logger.d(V2XConst.MODULE_NAME, "重新调整地图缩放比:" + latLng);
|
||||
val mBoundRect = Rect()
|
||||
val paddingTop: Int
|
||||
@@ -41,7 +40,11 @@ class MapUtils {
|
||||
mBoundRect.top = paddingTop
|
||||
mBoundRect.left = paddingLeft
|
||||
mBoundRect.right = paddingRight
|
||||
val carLocation = navi.carLocation
|
||||
// 当前车辆位置
|
||||
val carLocation = MogoLatLng(
|
||||
MogoApisHandler.getInstance().apis.adasControllerApi.lastLat,
|
||||
MogoApisHandler.getInstance().apis.adasControllerApi.lastLon
|
||||
)
|
||||
// 调整自适应的地图镜头
|
||||
carLocation?.let {
|
||||
BridgeApi.mapUiController()?.showBounds("MapUtils", it, listOf(latLng), mBoundRect, true)
|
||||
|
||||
@@ -71,6 +71,7 @@
|
||||
<ImageView
|
||||
android:id="@+id/ivToNav"
|
||||
android:layout_width="@dimen/module_v2x_event_button_size"
|
||||
android:visibility="invisible"
|
||||
android:layout_height="@dimen/module_v2x_event_button_size"
|
||||
android:layout_marginEnd="@dimen/dp_40"
|
||||
android:src="@drawable/selector_nav_btn"
|
||||
|
||||
@@ -112,6 +112,7 @@
|
||||
android:id="@+id/ivFaultHelpEventNavi"
|
||||
android:layout_width="@dimen/module_v2x_event_button_size"
|
||||
android:layout_height="@dimen/module_v2x_event_button_size"
|
||||
android:visibility="gone"
|
||||
android:src="@drawable/selector_nav_btn"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
@@ -107,9 +107,9 @@
|
||||
android:layout_height="@dimen/module_v2x_fault_help_event_call_width"
|
||||
android:layout_marginRight="@dimen/module_v2x_fault_help_event_navi_margin_right"
|
||||
android:src="@drawable/v2x_event_icon_daohang_vr"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible" />
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -110,7 +110,7 @@
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toEndOf="@+id/ivRoadCallChart"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible" />
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivRoadEventLike"
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
android:layout_height="@dimen/module_v2x_event_button_size"
|
||||
android:layout_marginEnd="@dimen/dp_40"
|
||||
android:src="@drawable/v2x_to_nav"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/ivClose"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -123,6 +123,7 @@
|
||||
android:layout_height="@dimen/module_v2x_event_button_size"
|
||||
android:layout_marginRight="@dimen/dp_40"
|
||||
android:src="@drawable/selector_nav_history"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
1
libraries/map-autonavi/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
/build
|
||||
@@ -1,66 +0,0 @@
|
||||
plugins {
|
||||
id 'com.android.library'
|
||||
id 'kotlin-android'
|
||||
id 'kotlin-android-extensions'
|
||||
id 'kotlin-kapt'
|
||||
id 'com.alibaba.arouter'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
// buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||
defaultConfig {
|
||||
minSdkVersion rootProject.ext.android.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
||||
versionCode Integer.valueOf(VERSION_CODE)
|
||||
versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION")
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles 'consumer-rules.pro'
|
||||
|
||||
//ARouter apt 参数
|
||||
kapt {
|
||||
useBuildCache = false
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.getName())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility 1.8
|
||||
targetCompatibility 1.8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: "libs", include: ["*.jar"])
|
||||
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
implementation rootProject.ext.dependencies.mogomapapi
|
||||
implementation rootProject.ext.dependencies.mogocommons
|
||||
implementation rootProject.ext.dependencies.mogomapapi
|
||||
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
} else {
|
||||
implementation project(':core:mogo-core-utils')
|
||||
implementation project(':libraries:mogo-map-api')
|
||||
implementation project(':foudations:mogo-commons')
|
||||
implementation project(':services:mogo-service-api')
|
||||
|
||||
implementation project(':core:mogo-core-data')
|
||||
}
|
||||
}
|
||||
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
@@ -1,3 +0,0 @@
|
||||
GROUP=com.mogo.map
|
||||
POM_ARTIFACT_ID=map-autonavi
|
||||
VERSION_CODE=1
|
||||
21
libraries/map-autonavi/proguard-rules.pro
vendored
@@ -1,21 +0,0 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
@@ -1,13 +0,0 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.map.impl.automap">
|
||||
|
||||
<application>
|
||||
<receiver
|
||||
android:name=".navi.AutoNaviReceiver"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="AUTONAVI_STANDARD_BROADCAST_SEND" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -1,229 +0,0 @@
|
||||
package com.mogo.map.impl.automap.navi;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Rect;
|
||||
import android.location.Location;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.navi.MogoCalculatePath;
|
||||
import com.mogo.map.navi.MogoNaviConfig;
|
||||
import com.mogo.map.navi.OnCalculatePathItemClickInteraction;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/6/2
|
||||
* <p>
|
||||
* 使用高德车机版导航
|
||||
*/
|
||||
public class AutoNaviClient implements IMogoNavi {
|
||||
|
||||
private static final String TAG = "NaviClient";
|
||||
|
||||
public static final String ACTION_AUTO_MAP = "AUTONAVI_STANDARD_BROADCAST_RECV";
|
||||
|
||||
public static final String KEY_TYPE = "KEY_TYPE";
|
||||
public static final String SOURCE_APP = "SOURCE_APP";
|
||||
public static final String LAT = "LAT";
|
||||
public static final String LON = "LON";
|
||||
public static final String ENTRY_LAT = "ENTRY_LAT";
|
||||
public static final String ENTRY_LON = "ENTRY_LON";
|
||||
public static final String DEV = "DEV"; // (int)是否偏移(0:lat 和 lon 是已经加密后的,不需要国测加密; 1:需要国测加密)
|
||||
|
||||
/**
|
||||
* (必填)(int)导航方式
|
||||
* =1(避免收费)
|
||||
* =2(多策略算路)
|
||||
* =3 (不走高速)
|
||||
* =4(躲避拥堵)
|
||||
* =5(不走高速且避免收费)
|
||||
* =6(不走高速且躲避拥堵)
|
||||
* =7(躲避收费且躲避拥堵)
|
||||
* =8(不走高速躲避收费和拥堵)
|
||||
* =20 (高速优先)
|
||||
* =24(高速优先且躲避拥堵)
|
||||
* =-1(地图内部设置默认规则)
|
||||
*/
|
||||
public static final String STYLE = "STYLE";
|
||||
|
||||
private static volatile AutoNaviClient sInstance;
|
||||
private final Context mContext;
|
||||
|
||||
private AutoNaviClient( Context context ) {
|
||||
mContext = context.getApplicationContext();
|
||||
}
|
||||
|
||||
public static AutoNaviClient getInstance( Context context ) {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( AutoNaviClient.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new AutoNaviClient( context );
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public void naviTo( MogoLatLng endPoint ) {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra( KEY_TYPE, 10038 );
|
||||
intent.putExtra( LAT, endPoint.lat );
|
||||
intent.putExtra( LON, endPoint.lon );
|
||||
// intent.putExtra( ENTRY_LAT, endPoint.lat );
|
||||
// intent.putExtra( ENTRY_LON, endPoint.lon );
|
||||
intent.putExtra( DEV, 0 );
|
||||
intent.putExtra( STYLE, -1 );
|
||||
intent.putExtra( SOURCE_APP, "Third App" );
|
||||
sendByIntent( intent );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo( MogoLatLng endPoint, MogoNaviConfig config ) {
|
||||
naviTo( endPoint );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo( MogoLatLng endPoint, List< MogoLatLng > wayPoints ) {
|
||||
naviTo( endPoint );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo( MogoLatLng endPoint, List< MogoLatLng > wayPoints, MogoNaviConfig config ) {
|
||||
naviTo( endPoint );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reCalculateRoute( MogoNaviConfig config ) {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopNavi() {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra( "KEY_TYPE", 10010 );
|
||||
sendByIntent( intent );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startNavi( boolean isRealNavi ) {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
}
|
||||
|
||||
private void sendByIntent( Intent intent ) {
|
||||
intent.setAction( ACTION_AUTO_MAP );
|
||||
intent.addFlags( Intent.FLAG_INCLUDE_STOPPED_PACKAGES );
|
||||
mContext.sendBroadcast( intent );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNaviing() {
|
||||
return MapState.getInstance().isNaving();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List< MogoCalculatePath > getCalculatedStrategies() {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List< MogoLatLng > getCalculatedPathPos() {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OnCalculatePathItemClickInteraction getItemClickInteraction() {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLineClickInteraction( OnCalculatePathItemClickInteraction itemClickInteraction ) {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearCalculatePaths() {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCalculatePathDisplayBounds( Rect bounds ) {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoNaviConfig getNaviConfig() {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
return MogoMapApi.getApiBuilder().getNavi( mContext ).getNaviConfig();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setBroadcastMode( int mode ) {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List< MogoLatLng > getNaviPathCoordinates() {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoLatLng getCarLocation() {
|
||||
return MogoMapApi.getApiBuilder().getNavi( mContext ).getCarLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location getCarLocation2() {
|
||||
return MogoMapApi.getApiBuilder().getNavi( mContext ).getCarLocation2();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCarLocationChangedListener( IMogoCarLocationChangedListener2 listener ) {
|
||||
//do not impl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startAimlessMode() {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopAimlessMode() {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAimlessModeStatus( boolean open ) {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayOverview( Rect bounds ) {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUseExtraGPSData( boolean use ) {
|
||||
MogoMapApi.getApiBuilder().getNavi( mContext ).setUseExtraGPSData( use );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtraGPSData( double lon, double lat, float speed, float accuracy, float bearing, long timestamp ) {
|
||||
MogoMapApi.getApiBuilder().getNavi( mContext ).setExtraGPSData( lon, lat, speed, accuracy, bearing, timestamp );
|
||||
}
|
||||
}
|
||||
@@ -1,159 +0,0 @@
|
||||
package com.mogo.map.impl.automap.navi;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.mogo.commons.storage.SpStorage;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.map.navi.MogoNaviInfo;
|
||||
import com.mogo.map.navi.MogoNaviListenerHandler;
|
||||
import com.mogo.map.navi.MogoTraffic;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/6/2
|
||||
* <p>
|
||||
* 高德公版地图透出信息广播接收者
|
||||
*/
|
||||
public class AutoNaviReceiver extends BroadcastReceiver {
|
||||
|
||||
private static final String TAG = "AutoNaviReceiver";
|
||||
|
||||
public static final String ACTION_AUTONAVI_SEND = "AUTONAVI_STANDARD_BROADCAST_SEND";
|
||||
private static AutoNaviReceiver autoNaviReceiver;
|
||||
private static boolean sRegisterFlag = false;
|
||||
|
||||
private static MogoNaviInfo sNaviInfo;
|
||||
private static MogoTraffic sTraffic;
|
||||
|
||||
|
||||
public static void register( Context context ) {
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction( ACTION_AUTONAVI_SEND );
|
||||
autoNaviReceiver = new AutoNaviReceiver();
|
||||
context.registerReceiver( autoNaviReceiver, filter );
|
||||
sRegisterFlag = true;
|
||||
}
|
||||
|
||||
public static void unregister( Context context ) {
|
||||
if ( autoNaviReceiver != null && sRegisterFlag ) {
|
||||
try {
|
||||
context.unregisterReceiver( autoNaviReceiver );
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "error. " );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceive( Context context, Intent intent ) {
|
||||
String action = intent.getAction();
|
||||
|
||||
if ( !TextUtils.equals( ACTION_AUTONAVI_SEND, action ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
int keyType = intent.getIntExtra( "KEY_TYPE", 0 );
|
||||
switch ( keyType ) {
|
||||
case 10001:
|
||||
handleAutoNaviInfo( context, intent );
|
||||
break;
|
||||
case 10019:
|
||||
int state = intent.getIntExtra( "EXTRA_STATE", -1 );
|
||||
handleMapStatusChanged( state );
|
||||
break;
|
||||
case 10056:
|
||||
String json = intent.getStringExtra( "EXTRA_ROAD_INFO" );
|
||||
SpStorage.setNavigationTarget( json );
|
||||
Logger.d( TAG, json );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 在导航/巡航/模拟导航中auto主动将变化的引导信息发送给第三方系统
|
||||
*
|
||||
* @param intent
|
||||
*/
|
||||
private void handleAutoNaviInfo( Context context, Intent intent ) {
|
||||
|
||||
int type = intent.getIntExtra( GuideInfoExtraKey.TYPE, -1 );
|
||||
|
||||
int cameraSpeed = intent.getIntExtra( GuideInfoExtraKey.CAMERA_SPEED, 0 );
|
||||
int cameraDisc = intent.getIntExtra( GuideInfoExtraKey.CAMERA_DIST, 0 );
|
||||
int cameraType = intent.getIntExtra( GuideInfoExtraKey.CAMERA_TYPE, 0 );
|
||||
|
||||
if ( type == 0 || type == 1 ) {
|
||||
if ( !MapState.getInstance().isNaving()
|
||||
&& MogoNaviListenerHandler.getInstance().hasDelegateListener() ) {
|
||||
MapState.getInstance().setNaving( true );
|
||||
MogoNaviListenerHandler.getInstance().onStartNavi();
|
||||
}
|
||||
if ( sNaviInfo == null ) {
|
||||
sNaviInfo = new MogoNaviInfo();
|
||||
}
|
||||
sNaviInfo.setCurrentLimitSpeed( cameraSpeed );
|
||||
sNaviInfo.setCurrentRoadName( intent.getStringExtra( GuideInfoExtraKey.CUR_ROAD_NAME ) );
|
||||
sNaviInfo.setCurrentSpeed( intent.getIntExtra( GuideInfoExtraKey.CUR_SPEED, 0 ) );
|
||||
sNaviInfo.setCurStepRetainDistance( intent.getIntExtra( GuideInfoExtraKey.SEG_REMAIN_DIS, 0 ) );
|
||||
sNaviInfo.setCurStepRetainTime( intent.getIntExtra( GuideInfoExtraKey.SEG_REMAIN_TIME, 0 ) );
|
||||
sNaviInfo.setIconResId( MogoMapApi.getApiBuilder().getResIdByIconType( context, intent.getIntExtra( GuideInfoExtraKey.NEW_ICON, 0 ) ) );
|
||||
sNaviInfo.setNextRoadName( intent.getStringExtra( GuideInfoExtraKey.NEXT_ROAD_NAME ) );
|
||||
sNaviInfo.setPathRetainDistance( intent.getIntExtra( GuideInfoExtraKey.ROUTE_REMAIN_DIS, 0 ) );
|
||||
sNaviInfo.setPathRetainTime( intent.getIntExtra( GuideInfoExtraKey.ROUTE_REMAIN_TIME, 0 ) );
|
||||
MogoNaviListenerHandler.getInstance().onNaviInfoUpdate( sNaviInfo );
|
||||
}
|
||||
if ( sTraffic == null ) {
|
||||
sTraffic = new MogoTraffic( MapState.getInstance().isAimless() ? MogoTraffic.TYPE_AIM : MogoTraffic.TYPE_NAVI );
|
||||
}
|
||||
sTraffic.setFromType( MapState.getInstance().isAimless() ? MogoTraffic.TYPE_AIM : MogoTraffic.TYPE_NAVI );
|
||||
sTraffic.setDistance( cameraDisc );
|
||||
sTraffic.setSpeedLimit( cameraSpeed );
|
||||
sTraffic.setTrafficType( cameraType );
|
||||
MogoNaviListenerHandler.getInstance().onUpdateTraffic2( sTraffic );
|
||||
}
|
||||
|
||||
/**
|
||||
* 当导航发生状态变更时,将相应的状态通知给系统。
|
||||
*
|
||||
* @param state
|
||||
*/
|
||||
private void handleMapStatusChanged( int state ) {
|
||||
if ( state == -1 ) {
|
||||
return;
|
||||
}
|
||||
switch ( state ) {
|
||||
case MapStateValue.START_NAVI:
|
||||
case MapStateValue.START_EMULATOR_NAVI:
|
||||
if ( MapState.getInstance().isNaving() ) {
|
||||
Logger.w( TAG, "naving..." );
|
||||
return;
|
||||
}
|
||||
MapState.getInstance().setNaving( true );
|
||||
MogoNaviListenerHandler.getInstance().onStartNavi();
|
||||
break;
|
||||
case MapStateValue.STOP_NAVI:
|
||||
case MapStateValue.STOP_EMULATOR_NAVI:
|
||||
case MapStateValue.APP_START: // 语音退出导航,感觉是杀掉了高德APP了
|
||||
if ( MapState.getInstance().isNaving() ) {
|
||||
MapState.getInstance().setNaving( false );
|
||||
MogoNaviListenerHandler.getInstance().onStopNavi();
|
||||
}
|
||||
break;
|
||||
case MapStateValue.START_AIMLESS_NAVI:
|
||||
MapState.getInstance().setAimless( true );
|
||||
break;
|
||||
case MapStateValue.STOP_AIMLESS_NAVI:
|
||||
MapState.getInstance().setAimless( false );
|
||||
break;
|
||||
case MapStateValue.EXIT_APP:
|
||||
break;
|
||||
case MapStateValue.DESTINATION:
|
||||
MogoNaviListenerHandler.getInstance().onArriveDestination();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,129 +0,0 @@
|
||||
package com.mogo.map.impl.automap.navi;
|
||||
|
||||
//引导信息对应的KEY值机器描述
|
||||
public class GuideInfoExtraKey {
|
||||
/**
|
||||
* 导航类型,对应的值为int类型
|
||||
* 0:GPS导航
|
||||
* 1:模拟导航
|
||||
* 2:巡航
|
||||
*/
|
||||
public static final String TYPE = "TYPE";
|
||||
|
||||
/**
|
||||
* 当前道路名称,对应的值为String类型
|
||||
*/
|
||||
public static final String CUR_ROAD_NAME = "CUR_ROAD_NAME";
|
||||
|
||||
/**
|
||||
* 下一道路名,对应的值为String类型
|
||||
*/
|
||||
public static final String NEXT_ROAD_NAME = "NEXT_ROAD_NAME";
|
||||
|
||||
/**
|
||||
* 电子眼限速度,对应的值为int类型,无限速则为0,单位:公里/小时
|
||||
*/
|
||||
public static final String CAMERA_SPEED = "CAMERA_SPEED";
|
||||
|
||||
/**
|
||||
* 导航转向图标,对应的值为int类型
|
||||
*/
|
||||
public static final String ICON = "ICON";
|
||||
|
||||
/**
|
||||
* 导航最新的转向图标,对应的值为int类型
|
||||
*/
|
||||
public static final String NEW_ICON = "NEW_ICON";
|
||||
|
||||
/**
|
||||
* 路径剩余距离,对应的值为int类型,单位:米
|
||||
*/
|
||||
public static final String ROUTE_REMAIN_DIS = "ROUTE_REMAIN_DIS";
|
||||
/**
|
||||
* 路径剩余时间,对应的值为int类型,单位:秒
|
||||
*/
|
||||
public static final String ROUTE_REMAIN_TIME = "ROUTE_REMAIN_TIME";
|
||||
|
||||
/**
|
||||
* 当前导航段剩余距离,对应的值为int类型,单位:米
|
||||
*/
|
||||
public static final String SEG_REMAIN_DIS = "SEG_REMAIN_DIS";
|
||||
|
||||
/**
|
||||
* 当前导航段剩余时间,对应的值为int类型,单位:秒
|
||||
*/
|
||||
public static final String SEG_REMAIN_TIME = "SEG_REMAIN_TIME";
|
||||
|
||||
/**
|
||||
* 路径总距离,对应的值为int类型,单位:米
|
||||
*/
|
||||
public static final String ROUTE_ALL_DIS = "ROUTE_ALL_DIS";
|
||||
|
||||
/**
|
||||
* 路径总时间,对应的值为int类型,单位:秒
|
||||
*/
|
||||
public static final String ROUTE_ALL_TIME = "ROUTE_ALL_TIME";
|
||||
|
||||
/**
|
||||
* 当前车速,对应的值为int类型,单位:公里/小时
|
||||
*/
|
||||
public static final String CUR_SPEED = "CUR_SPEED";
|
||||
|
||||
/**
|
||||
* 当前道路类型,对应的值为int类型
|
||||
* 0:高速公路
|
||||
* 1:国道
|
||||
* 2:省道
|
||||
* 3:县道
|
||||
* 4:乡公路
|
||||
* 5:县乡村内部道路
|
||||
* 6:主要大街、城市快速道 * 7:主要道路
|
||||
* 8:次要道路
|
||||
* 9:普通道路
|
||||
* 10:非导航道路
|
||||
*/
|
||||
public static final String ROAD_TYPE = "ROAD_TYPE";
|
||||
|
||||
/**
|
||||
* 路径剩余时间,对应的值为String类型,单位:天/小时/分钟 比如:1天2小时, 21小时30分
|
||||
* 钟(只用于长安)
|
||||
*/
|
||||
public static final String ROUTE_REMAIN_TIME_STRING = "ROUTE_REMAIN_TIME_S TRING";
|
||||
|
||||
/**
|
||||
* 下下个路名名称,对应的值为String类型
|
||||
*/
|
||||
public static final String NEXT_NEXT_ROAD_NAME = "NEXT_NEXT_ROAD_NAME";
|
||||
/**
|
||||
* 下下个路口转向图标,对应的值为int类型
|
||||
*/
|
||||
|
||||
public static final String NEXT_NEXT_TURN_ICON = "NEXT_NEXT_TURN_ICON";
|
||||
|
||||
/**
|
||||
* 距离下下个路口剩余距离,对应的值为int类型,单位:米
|
||||
*/
|
||||
public static final String NEXT_SEG_REMAIN_DIS = "NEXT_SEG_REMAIN_DIS";
|
||||
|
||||
/**
|
||||
* 距离下下个路口剩余时间,对应的值为int类型,单位:秒
|
||||
*/
|
||||
public static final String NEXT_SEG_REMAIN_TIME = "NEXT_SEG_REMAIN_TIME";
|
||||
|
||||
/**
|
||||
* 距离最近的电子眼距离,对应的值为int类型,单位:米
|
||||
*/
|
||||
public static final String CAMERA_DIST = "CAMERA_DIST";
|
||||
|
||||
/**
|
||||
* 电子眼类型,对应的值为int类型
|
||||
* 0 测速摄像头
|
||||
* 1为监控摄像头
|
||||
* 2为闯红灯拍照
|
||||
* 3为违章拍照
|
||||
* 4为公交专用道摄像头
|
||||
* 5为应急车道摄像头
|
||||
* 6为非机动车道拍照
|
||||
*/
|
||||
public static final String CAMERA_TYPE = "CAMERA_TYPE";
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package com.mogo.map.impl.automap.navi;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/6/3
|
||||
*
|
||||
* 高德地图状态
|
||||
*/
|
||||
class MapState {
|
||||
|
||||
private static volatile MapState sInstance;
|
||||
|
||||
private MapState() {
|
||||
}
|
||||
|
||||
public static MapState getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( MapState.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new MapState();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
private boolean isNaving = false;
|
||||
private boolean isAimless = false;
|
||||
|
||||
public boolean isNaving() {
|
||||
return isNaving;
|
||||
}
|
||||
|
||||
public void setNaving( boolean naving ) {
|
||||
isNaving = naving;
|
||||
}
|
||||
|
||||
public boolean isAimless() {
|
||||
return isAimless;
|
||||
}
|
||||
|
||||
public void setAimless( boolean aimless ) {
|
||||
isAimless = aimless;
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.mogo.map.impl.automap.navi;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/6/3
|
||||
* <p>
|
||||
* 高德公版地图状态值
|
||||
*/
|
||||
public interface MapStateValue {
|
||||
|
||||
int START_NAVI = 8;
|
||||
|
||||
int STOP_NAVI = 9;
|
||||
|
||||
int START_EMULATOR_NAVI = 10;
|
||||
|
||||
int STOP_EMULATOR_NAVI = 12;
|
||||
|
||||
int START_AIMLESS_NAVI = 24;
|
||||
|
||||
int STOP_AIMLESS_NAVI = 25;
|
||||
|
||||
int EXIT_APP = 45;
|
||||
|
||||
int DESTINATION = 39;
|
||||
|
||||
int APP_START = 0;
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.mogo.map.impl.automap.navi;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.map.IMogoMapApiBuilder;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/12/10
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class MogoMapApi {
|
||||
|
||||
private static IMogoMapApiBuilder sApiBuilder;
|
||||
|
||||
public static IMogoMapApiBuilder getApiBuilder() {
|
||||
if (sApiBuilder == null) {
|
||||
synchronized (AutoNaviClient.class) {
|
||||
if (sApiBuilder == null) {
|
||||
sApiBuilder = ARouter.getInstance().navigation(IMogoMapApiBuilder.class);
|
||||
}
|
||||
}
|
||||
}
|
||||
return sApiBuilder;
|
||||
}
|
||||
}
|
||||
@@ -450,11 +450,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if (mCurrentUI == EnumMapUI.Type_VR) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (visible && NaviClient.getInstance(getContext()).isNaviing()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (checkAMapView()) {
|
||||
MyLocationStyle style = mMapView.getMapAutoViewHelper().getMyLocationStyle();
|
||||
if (visible) {
|
||||
@@ -468,9 +463,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
@Override
|
||||
public void showMyLocation(View view) {
|
||||
Logger.d(TAG, "showMyLocation %s", "view");
|
||||
if (NaviClient.getInstance(getContext()).isNaviing()) {
|
||||
return;
|
||||
}
|
||||
if (DebugConfig.isDebug()) {
|
||||
Logger.d(TAG, Log.getStackTraceString(new Throwable()));
|
||||
}
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
package com.mogo.map.impl.custom.navi;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
import android.location.Location;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.map.impl.custom.AMapWrapper;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.navi.MogoCalculatePath;
|
||||
import com.mogo.map.navi.MogoCarLocationChangedListenerRegister;
|
||||
import com.mogo.map.navi.MogoNaviConfig;
|
||||
import com.mogo.map.navi.OnCalculatePathItemClickInteraction;
|
||||
@@ -26,40 +23,21 @@ import java.util.List;
|
||||
*/
|
||||
public class NaviClient implements IMogoNavi {
|
||||
|
||||
/**
|
||||
* 巡航状态控制
|
||||
*/
|
||||
public static final String KEY_AIMLESS_STATUS = "KEY_AIMLESS_STATUS";
|
||||
|
||||
private static final String TAG = "NaviClient";
|
||||
private final Context mContext;
|
||||
|
||||
private MapAutoViewHelper mAMapNavi;
|
||||
|
||||
/**
|
||||
* 导航策略配置
|
||||
*/
|
||||
|
||||
private MogoNaviConfig mMogoNaviConfig = new MogoNaviConfig();
|
||||
|
||||
private static volatile NaviClient sInstance;
|
||||
private boolean mIsRealNavi;
|
||||
|
||||
private Location mCarLocation = new Location("GPS");
|
||||
/**
|
||||
* 巡航模式配置状态
|
||||
*/
|
||||
private boolean mAimlessModeStatus;
|
||||
|
||||
/**
|
||||
* 巡航状态
|
||||
*/
|
||||
private boolean mAimlessStatus;
|
||||
|
||||
private NaviClient(Context context) {
|
||||
mCarLocation.setLongitude(116.97000);
|
||||
mCarLocation.setLatitude(39.97000);
|
||||
mContext = context;
|
||||
mAMapNavi = AMapWrapper.getAMap();
|
||||
}
|
||||
|
||||
@@ -88,11 +66,6 @@ public class NaviClient implements IMogoNavi {
|
||||
naviTo(endPoint, null, config);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo(MogoLatLng endPoint, List<MogoLatLng> wayPoints) {
|
||||
naviTo(endPoint, wayPoints, mMogoNaviConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo(MogoLatLng endPoint, List<MogoLatLng> wayPoints, MogoNaviConfig config) {
|
||||
if (!checkAMapNavi()) {
|
||||
@@ -105,74 +78,16 @@ public class NaviClient implements IMogoNavi {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reCalculateRoute(MogoNaviConfig config) {
|
||||
if (!checkAMapNavi()) {
|
||||
return;
|
||||
}
|
||||
mMogoNaviConfig = config;
|
||||
if (mMogoNaviConfig == null) {
|
||||
mMogoNaviConfig = new MogoNaviConfig();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopNavi() {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void startNavi(boolean isRealNavi) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNaviing() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MogoCalculatePath> getCalculatedStrategies() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MogoLatLng> getCalculatedPathPos() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OnCalculatePathItemClickInteraction getItemClickInteraction() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLineClickInteraction(OnCalculatePathItemClickInteraction lineClickInteraction) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearCalculatePaths() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCalculatePathDisplayBounds(Rect bounds) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoNaviConfig getNaviConfig() {
|
||||
return mMogoNaviConfig;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setBroadcastMode(int mode) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MogoLatLng> getNaviPathCoordinates() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoLatLng getCarLocation() {
|
||||
if (mCarLocation != null) {
|
||||
@@ -219,46 +134,4 @@ public class NaviClient implements IMogoNavi {
|
||||
public void stopAimlessMode() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAimlessModeStatus(boolean open) {
|
||||
this.mAimlessModeStatus = open;
|
||||
SharedPrefsMgr.getInstance(mContext).putBoolean(KEY_AIMLESS_STATUS, open);
|
||||
if (open) {
|
||||
if (!mAimlessStatus) {
|
||||
startAimlessMode();
|
||||
}
|
||||
} else {
|
||||
if (mAimlessStatus) {
|
||||
stopAimlessMode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayOverview(Rect bounds) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUseExtraGPSData(boolean use) {
|
||||
Logger.d(TAG, "设置外部gps源状态 %s", use);
|
||||
mAMapNavi.setIsUseExtraGPSData(use);
|
||||
AMapWrapper.getAMap().setMyLocationEnabled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtraGPSData(double lon, double lat, float speed, float accuracy, float bearing, long timestamp) {
|
||||
if (!mAMapNavi.getIsUseExtraGPSData()) {
|
||||
Logger.d(TAG, "拒绝外部GPS数据");
|
||||
return;
|
||||
}
|
||||
Location location = new Location("外部GPS源");
|
||||
location.setLongitude(lon);
|
||||
location.setLatitude(lat);
|
||||
location.setSpeed(speed);
|
||||
location.setAccuracy(accuracy);
|
||||
location.setBearing(bearing);
|
||||
location.setTime(timestamp);
|
||||
//type字段传1时代表WGS84坐标
|
||||
mAMapNavi.setExtraGPSData(2, location);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.mogo.map.navi;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import android.location.Location;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
@@ -30,14 +29,6 @@ public interface IMogoNavi extends IMogoCarLocationChangedListenerRegister, IMo
|
||||
*/
|
||||
void naviTo( MogoLatLng endPoint, MogoNaviConfig config );
|
||||
|
||||
/**
|
||||
* 开启路径规划并导航
|
||||
*
|
||||
* @param endPoint 导航目的地
|
||||
* @param wayPoints 途经点
|
||||
*/
|
||||
void naviTo( MogoLatLng endPoint, List< MogoLatLng > wayPoints );
|
||||
|
||||
/**
|
||||
* 开启路径规划并导航
|
||||
*
|
||||
@@ -47,17 +38,6 @@ public interface IMogoNavi extends IMogoCarLocationChangedListenerRegister, IMo
|
||||
*/
|
||||
void naviTo( MogoLatLng endPoint, List< MogoLatLng > wayPoints, MogoNaviConfig config );
|
||||
|
||||
/**
|
||||
* 重新算路
|
||||
*
|
||||
* @param config 规划路线策略
|
||||
*/
|
||||
void reCalculateRoute( MogoNaviConfig config );
|
||||
|
||||
/**
|
||||
* 退出导航
|
||||
*/
|
||||
void stopNavi();
|
||||
|
||||
/**
|
||||
* 开始导航
|
||||
@@ -66,70 +46,6 @@ public interface IMogoNavi extends IMogoCarLocationChangedListenerRegister, IMo
|
||||
*/
|
||||
void startNavi( boolean isRealNavi );
|
||||
|
||||
/**
|
||||
* 是否正在导航
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
boolean isNaviing();
|
||||
|
||||
/**
|
||||
* 获取路线规划策略
|
||||
*
|
||||
* @return 规划的路线
|
||||
*/
|
||||
List< MogoCalculatePath > getCalculatedStrategies();
|
||||
|
||||
|
||||
/**
|
||||
* 获取路线坐标点
|
||||
*
|
||||
* @return 规划的路线上所有的坐标点
|
||||
*/
|
||||
List< MogoLatLng > getCalculatedPathPos();
|
||||
|
||||
|
||||
/**
|
||||
* 获取列表Item点击回调
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
OnCalculatePathItemClickInteraction getItemClickInteraction();
|
||||
|
||||
/**
|
||||
* 清除规划的路线
|
||||
*/
|
||||
void clearCalculatePaths();
|
||||
|
||||
/**
|
||||
* 设置显示规划路线的范围
|
||||
*
|
||||
* @param bounds 范围
|
||||
*/
|
||||
void setCalculatePathDisplayBounds( Rect bounds );
|
||||
|
||||
/**
|
||||
* 导航配置
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
MogoNaviConfig getNaviConfig();
|
||||
|
||||
/**
|
||||
* 设置播报模式
|
||||
*
|
||||
* @param mode
|
||||
* @return
|
||||
*/
|
||||
boolean setBroadcastMode( int mode );
|
||||
|
||||
/**
|
||||
* 获取导航沿途路线的点
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List< MogoLatLng > getNaviPathCoordinates();
|
||||
|
||||
/**
|
||||
* 获取车标经纬度
|
||||
*
|
||||
@@ -154,27 +70,4 @@ public interface IMogoNavi extends IMogoCarLocationChangedListenerRegister, IMo
|
||||
*/
|
||||
void stopAimlessMode();
|
||||
|
||||
/**
|
||||
* 设置巡航模式状态
|
||||
*
|
||||
* @param open
|
||||
*/
|
||||
void setAimlessModeStatus( boolean open );
|
||||
|
||||
/**
|
||||
* 查看全程
|
||||
*/
|
||||
void displayOverview( Rect bounds );
|
||||
|
||||
/**
|
||||
* 设置使用外部定位源
|
||||
*
|
||||
* @param use true - 使用,false - 不适用
|
||||
*/
|
||||
void setUseExtraGPSData( boolean use );
|
||||
|
||||
/**
|
||||
* 设置外部数据源
|
||||
*/
|
||||
void setExtraGPSData( double lon, double lat, float speed, float accuracy, float bearing, long timestamp );
|
||||
}
|
||||
|
||||
@@ -45,7 +45,6 @@ dependencies {
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
implementation rootProject.ext.dependencies.mogomapapi
|
||||
api rootProject.ext.dependencies.mapautomap
|
||||
implementation rootProject.ext.dependencies.mogocommons
|
||||
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
@@ -53,7 +52,6 @@ dependencies {
|
||||
} else {
|
||||
implementation project(':core:mogo-core-utils')
|
||||
implementation project(':libraries:mogo-map-api')
|
||||
api project(':libraries:map-autonavi')
|
||||
implementation project(':foudations:mogo-commons')
|
||||
|
||||
implementation project(':core:mogo-core-data')
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
package com.mogo.map;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.map.navi.IMogoAimless;
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
* @since 2020-11-05
|
||||
* <p>
|
||||
* 巡航代理
|
||||
*/
|
||||
public class MogoAimless implements IMogoAimless {
|
||||
|
||||
private IMogoAimless mDelegate;
|
||||
|
||||
private static volatile MogoAimless sInstance;
|
||||
|
||||
private MogoAimless( Context context ) {
|
||||
mDelegate = MogoMapDelegateFactory.getAimless( context );
|
||||
}
|
||||
|
||||
public static MogoAimless getInstance( Context context ) {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( MogoAimless.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new MogoAimless( context );
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startAimlessMode() {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.startAimlessMode();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopAimlessMode() {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.stopAimlessMode();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAimlessModeStatus( boolean open ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.setAimlessModeStatus( open );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,12 +3,7 @@ package com.mogo.map;
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils;
|
||||
import com.mogo.map.impl.automap.navi.AutoNaviClient;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.navi.IMogoAimless;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.search.geo.IMogoGeoSearch;
|
||||
import com.mogo.map.search.poisearch.IMogoPoiSearch;
|
||||
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
|
||||
@@ -51,24 +46,10 @@ class MogoMapDelegateFactory {
|
||||
return getApiBuilder().getMapUIController();
|
||||
}
|
||||
|
||||
public static IMogoNavi getNaviDelegate(Context context) {
|
||||
|
||||
if (DebugConfig.isUseCustomNavi()) {
|
||||
return getApiBuilder().getNavi(context);
|
||||
} else if (AppUtils.isAppInstalled(context, "com.autonavi.amapauto")) {
|
||||
return AutoNaviClient.getInstance(context);
|
||||
}
|
||||
return getApiBuilder().getNavi(context);
|
||||
}
|
||||
|
||||
public static IMogoPoiSearch getPoiSearchClientDelegate(Context context, MogoPoiSearchQuery query) {
|
||||
return getApiBuilder().getPoiSearchClient(context, query);
|
||||
}
|
||||
|
||||
public static IMogoAimless getAimless(Context context) {
|
||||
return getApiBuilder().getAimless(context);
|
||||
}
|
||||
|
||||
public static void destroy() {
|
||||
getApiBuilder().destroy();
|
||||
}
|
||||
|
||||
@@ -1,235 +0,0 @@
|
||||
package com.mogo.map;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
import android.location.Location;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.navi.MogoCalculatePath;
|
||||
import com.mogo.map.navi.MogoCarLocationChangedListenerRegister;
|
||||
import com.mogo.map.navi.MogoNaviConfig;
|
||||
import com.mogo.map.navi.MogoOperationListenerRegister;
|
||||
import com.mogo.map.navi.OnCalculatePathItemClickInteraction;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-25
|
||||
* <p>
|
||||
* 导航代理
|
||||
*/
|
||||
public class MogoNavi implements IMogoNavi {
|
||||
|
||||
private IMogoNavi mDelegate;
|
||||
|
||||
private static volatile MogoNavi sInstance;
|
||||
|
||||
private MogoNavi( Context context ) {
|
||||
mDelegate = MogoMapDelegateFactory.getNaviDelegate( context );
|
||||
}
|
||||
|
||||
public static MogoNavi getInstance( Context context ) {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( MogoNavi.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new MogoNavi( context );
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo( MogoLatLng endPoint ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.naviTo( endPoint );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo( MogoLatLng endPoint, MogoNaviConfig config ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.naviTo( endPoint, config );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo( MogoLatLng endPoint, List< MogoLatLng > wayPoints ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.naviTo( endPoint, wayPoints );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo( MogoLatLng endPoint, List< MogoLatLng > wayPoints, MogoNaviConfig config ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.naviTo( endPoint, wayPoints, config );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reCalculateRoute( MogoNaviConfig config ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.reCalculateRoute( config );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopNavi() {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.stopNavi();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startNavi( boolean isRealNavi ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.startNavi( isRealNavi );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNaviing() {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.isNaviing();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List< MogoCalculatePath > getCalculatedStrategies() {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getCalculatedStrategies();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List< MogoLatLng > getCalculatedPathPos() {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getCalculatedPathPos();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OnCalculatePathItemClickInteraction getItemClickInteraction() {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getItemClickInteraction();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLineClickInteraction( OnCalculatePathItemClickInteraction itemClickInteraction ) {
|
||||
MogoOperationListenerRegister.getInstance().setLineClickInteraction( itemClickInteraction );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearCalculatePaths() {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.clearCalculatePaths();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCalculatePathDisplayBounds( Rect bounds ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.setCalculatePathDisplayBounds( bounds );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoNaviConfig getNaviConfig() {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getNaviConfig();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setBroadcastMode( int mode ) {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.setBroadcastMode( mode );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List< MogoLatLng > getNaviPathCoordinates() {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getNaviPathCoordinates();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoLatLng getCarLocation() {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getCarLocation();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location getCarLocation2() {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getCarLocation2();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCarLocationChangedListener( IMogoCarLocationChangedListener2 listener ) {
|
||||
MogoCarLocationChangedListenerRegister.getInstance().registerCarLocationChangedListener( listener );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startAimlessMode() {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.startAimlessMode();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopAimlessMode() {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.stopAimlessMode();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAimlessModeStatus( boolean open ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.setAimlessModeStatus( open );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayOverview( Rect bounds ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.displayOverview( bounds );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUseExtraGPSData( boolean use ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.setUseExtraGPSData( use );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtraGPSData( double lon, double lat, float speed, float accuracy, float bearing, long timestamp ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.setExtraGPSData( lon, lat, speed, accuracy, bearing, timestamp );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,6 @@
|
||||
:foudations:mogo-commons
|
||||
:tts:tts-di
|
||||
:tts:tts-noop
|
||||
:libraries:map-autonavi
|
||||
:libraries:map-custom
|
||||
:libraries:mogo-map
|
||||
:modules:mogo-module-carchattingprovider
|
||||
|
||||
@@ -11,9 +11,6 @@ import com.mogo.service.map.IMogoMapService;
|
||||
public class ExtensionServiceManager {
|
||||
private static boolean isInit;
|
||||
private static Context mContext;
|
||||
private static IMogoServiceApis mMogoServiceApis;
|
||||
private static IMogoMapService mMapService;
|
||||
private static IMogoNavi mNavi;
|
||||
|
||||
private ExtensionServiceManager() {
|
||||
|
||||
@@ -23,10 +20,6 @@ public class ExtensionServiceManager {
|
||||
if (!isInit) {
|
||||
isInit = true;
|
||||
mContext = context;
|
||||
mMogoServiceApis = MogoApisHandler.getInstance().getApis();
|
||||
|
||||
mMapService = mMogoServiceApis.getMapServiceApi();
|
||||
mNavi = mMapService.getNavi(context);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,9 +27,5 @@ public class ExtensionServiceManager {
|
||||
return mContext;
|
||||
}
|
||||
|
||||
public static IMogoNavi getNavi() {
|
||||
return mNavi;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,12 +8,12 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.main.EventDispatchCenter;
|
||||
import com.mogo.module.main.cards.MogoModulesManager;
|
||||
@@ -49,7 +49,6 @@ class MogoMainService extends Service implements IMogoLocationListener {
|
||||
loadBaseModules();
|
||||
startTanluService();
|
||||
initADAS();
|
||||
initGpsSimulatorListener();
|
||||
HdMapBuildConfig.isMapLoaded = true;
|
||||
}, 5_000L
|
||||
);
|
||||
@@ -81,12 +80,6 @@ class MogoMainService extends Service implements IMogoLocationListener {
|
||||
}
|
||||
}
|
||||
|
||||
private void initGpsSimulatorListener() {
|
||||
if (mServiceApis != null) {
|
||||
mServiceApis.getMapServiceApi().getNavi(this).registerCarLocationChangedListener(EventDispatchCenter.getInstance());
|
||||
}
|
||||
}
|
||||
|
||||
private void loadBaseModules() {
|
||||
Logger.d(TAG, "加载基本模块");
|
||||
MogoModulesManager.getInstance().loadBaseModule();
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
#-----ModuleMap-----
|
||||
-keep class com.mogo.module.map.NavConstants{*;}
|
||||
-keep class com.mogo.module.map.VoiceConstants{*;}
|
||||
@@ -1,147 +0,0 @@
|
||||
package com.mogo.module.map;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.mogo.map.navi.MogoNaviConfig;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.intent.IMogoIntentManager;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/7/30
|
||||
*
|
||||
* 接收高德地图车机版广播
|
||||
*/
|
||||
class AutoNaviBroadcastIntentHandler implements IMogoIntentListener {
|
||||
|
||||
public static final String TAG = "AutoNaviBroadcastReceiver";
|
||||
|
||||
// 发送高德:部分是小智语音发给高德的,这里顺便接收处理,都是历史遗留问题
|
||||
public static final String AUTONAVI_STANDARD_BROADCAST_RECV = "AUTONAVI_STANDARD_BROADCAST_RECV";
|
||||
|
||||
// 接收高德
|
||||
public static final String AUTONAVI_STANDARD_BROADCAST_SEND = "AUTONAVI_STANDARD_BROADCAST_SEND";
|
||||
private EnumMapUI mLastAMapUiType = null;
|
||||
|
||||
public void register( IMogoIntentManager manager ) {
|
||||
manager.registerIntentListener( AUTONAVI_STANDARD_BROADCAST_RECV, this );
|
||||
manager.registerIntentListener( AUTONAVI_STANDARD_BROADCAST_SEND, this );
|
||||
}
|
||||
|
||||
public void unregister( IMogoIntentManager manager ) {
|
||||
mCallback = null;
|
||||
manager.unregisterIntentListener( AUTONAVI_STANDARD_BROADCAST_RECV, this );
|
||||
manager.unregisterIntentListener( AUTONAVI_STANDARD_BROADCAST_SEND, this );
|
||||
}
|
||||
|
||||
private OnMapControlCallback mCallback;
|
||||
|
||||
public void setCallback( OnMapControlCallback mCallback ) {
|
||||
this.mCallback = mCallback;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onIntentReceived( String intentStr, Intent intent ) {
|
||||
String action = intent.getAction();
|
||||
|
||||
int keyType = intent.getIntExtra( "KEY_TYPE", 0 );
|
||||
int type = intent.getIntExtra( "EXTRA_TYPE", -1 );
|
||||
int operaType = intent.getIntExtra( "EXTRA_OPERA", -1 );
|
||||
|
||||
if ( !TextUtils.equals( action, AUTONAVI_STANDARD_BROADCAST_RECV )
|
||||
&& !TextUtils.equals( action, AUTONAVI_STANDARD_BROADCAST_SEND ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( mCallback == null ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( keyType == 10027 ) {
|
||||
if ( type == 0 ) {
|
||||
mCallback.onTrafficModeChanged( operaType == 0 );
|
||||
} else if ( type == 2 ) {
|
||||
if ( operaType == 0 ) {
|
||||
mCallback.onCameraModeChanged( EnumMapUI.CarUp_2D );
|
||||
} else if ( operaType == 1 ) {
|
||||
mCallback.onCameraModeChanged( EnumMapUI.NorthUP_2D );
|
||||
} else if ( operaType == 2 ) {
|
||||
mCallback.onCameraModeChanged( EnumMapUI.CarUp_3D );
|
||||
}
|
||||
}
|
||||
} else if ( keyType == 10048 ) {
|
||||
if ( !intent.getBooleanExtra( "callback", true ) ) {
|
||||
return;
|
||||
}
|
||||
//0:自动; 1:白天; 2:黑夜;
|
||||
int dayNightMode = intent.getIntExtra( "EXTRA_DAY_NIGHT_MODE", -1 );
|
||||
if ( dayNightMode == 0 ) {
|
||||
mCallback.onDayNightModeChanged( EnumMapUI.Type_AUTO_LIGHT_Night );
|
||||
} else if ( dayNightMode == 1 ) {
|
||||
mCallback.onDayNightModeChanged( EnumMapUI.Type_Light );
|
||||
} else if ( dayNightMode == 2 ) {
|
||||
mCallback.onDayNightModeChanged( EnumMapUI.Type_Night );
|
||||
}
|
||||
} else if ( keyType == 10049 ) {
|
||||
//继续导航
|
||||
boolean extraEnduranceData = intent.getBooleanExtra( "EXTRA_ENDURANCE_DATA", false );
|
||||
if ( extraEnduranceData ) {
|
||||
mCallback.onContinueNavi();
|
||||
}
|
||||
} else if ( keyType == 20009 ) {
|
||||
mCallback.onOpenNavi();
|
||||
} else if ( keyType == 10038 || keyType == 10007 ) {
|
||||
double lat;
|
||||
double lon;
|
||||
|
||||
if ( type == 10007 ) {
|
||||
lat = intent.getDoubleExtra( "ENTRY_LAT", 0.0 );
|
||||
lon = intent.getDoubleExtra( "ENTRY_LON", 0.0 );
|
||||
} else {
|
||||
lat = intent.getDoubleExtra( "LAT", 0.0 );
|
||||
lon = intent.getDoubleExtra( "LON", 0.0 );
|
||||
}
|
||||
mCallback.onCalculatePath( lon, lat );
|
||||
} else if ( keyType == 10021 ) {
|
||||
mCallback.onStopNaviInternal( intent );
|
||||
} else if ( keyType == 10005 ) {
|
||||
// 仅在导航场景下,⽀持第三⽅进⾏路线偏好的重新选择。
|
||||
// 避免收费 | 1
|
||||
// 多策略算路 | 2
|
||||
// 不走高速 | 3
|
||||
// 躲避拥堵 | 4
|
||||
// 不走高速且避免收费 | 5
|
||||
// 不走高速且躲避拥堵 | 6
|
||||
// 躲避收费和拥堵 | 7
|
||||
// 不走高速躲避收费和拥堵 | 8
|
||||
// 高速优先 | 20
|
||||
// 躲避拥堵且高速优先 | 24
|
||||
int prefer = intent.getIntExtra( "NAVI_ROUTE_PREFER", 0 );
|
||||
MogoNaviConfig config = new MogoNaviConfig().congestion( prefer == 4 )
|
||||
.cost( prefer == 1 || prefer == 7 )
|
||||
.highSpeed( prefer == 20 )
|
||||
.avoidSpeed( prefer == 3 );
|
||||
mCallback.onReCalculatePath( config );
|
||||
} else if ( keyType == 10019 ) {
|
||||
int extraState = intent.getIntExtra( "EXTRA_STATE", -1 );
|
||||
// 高德改变黑夜白天模式后,传递给launcher,顺便改变其他
|
||||
if ( extraState == 37 ) {
|
||||
// 白天模式
|
||||
mLastAMapUiType = EnumMapUI.Type_Light;
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().changeAdasControlMode( EnumMapUI.Type_Light );
|
||||
} else if ( extraState == 38 ) {
|
||||
// 夜间模式
|
||||
mLastAMapUiType = EnumMapUI.Type_Night;
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().changeAdasControlMode( EnumMapUI.Type_Night );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public EnumMapUI getLastAMapUiType() {
|
||||
return mLastAMapUiType;
|
||||
}
|
||||
}
|
||||
@@ -1,107 +0,0 @@
|
||||
package com.mogo.module.map;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils;
|
||||
import com.mogo.map.navi.MogoNaviInfo;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.map.CustomNaviInterrupter;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
|
||||
/**
|
||||
* @author zyz
|
||||
* 2020-01-17.
|
||||
*/
|
||||
public class MapBroadCastHelper implements IMogoStatusChangedListener {
|
||||
|
||||
private static final String TAG = "MapBroadCastHelper";
|
||||
|
||||
private static volatile MapBroadCastHelper sInstance;
|
||||
private static final String ACTION_NAV_SEND = "AUTONAVI_STANDARD_BROADCAST_SEND";
|
||||
private static final int STATUS_NAV_FRONT = 3;
|
||||
private static final int STATUS_NAV_BACKGROUND = 4;
|
||||
private static final int STATUS_NAV_START = 8;
|
||||
private static final int STATUS_NAV_STOP = 9;
|
||||
private Context mContext;
|
||||
|
||||
private MapBroadCastHelper( Context context ) {
|
||||
this.mContext = context;
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().registerStatusChangedListener( TAG, StatusDescriptor.AI_ASSIST_READY, this );
|
||||
}
|
||||
|
||||
public static MapBroadCastHelper getInstance( Context context ) {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( MapBroadCastHelper.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new MapBroadCastHelper( context );
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public void notifyXiaozhi( MogoNaviInfo naviinfo ) {
|
||||
if ( CustomNaviInterrupter.getInstance().interrupt() ) {
|
||||
return;
|
||||
}
|
||||
Intent intent = new Intent( ACTION_NAV_SEND );
|
||||
intent.putExtra( "KEY_TYPE", 10001 );
|
||||
intent.putExtra( "NEXT_ROAD_NAME", naviinfo.getNextRoadName() );
|
||||
intent.putExtra( "ROUTE_REMAIN_TIME_AUTO", naviinfo.getVoiceRetainTime() );
|
||||
intent.putExtra( "ROUTE_REMAIN_DIS_AUTO", naviinfo.getVoiceRetainDistance() );
|
||||
intent.putExtra( "ICON", naviinfo.getIconResId() );
|
||||
mContext.sendBroadcast( intent );
|
||||
Log.v( "MapBroadCastHelper", "action=" + ACTION_NAV_SEND + " NaviInfo" );
|
||||
}
|
||||
|
||||
|
||||
public void notifyXizhiNavStatus( int status ) {
|
||||
if ( CustomNaviInterrupter.getInstance().interrupt() ) {
|
||||
return;
|
||||
}
|
||||
Intent intent = new Intent( ACTION_NAV_SEND );
|
||||
intent.putExtra( "KEY_TYPE", 10019 );
|
||||
intent.putExtra( "EXTRA_STATE", status );
|
||||
intent.putExtra( "SOURCE_APP", mContext.getPackageName() );
|
||||
mContext.sendBroadcast( intent );
|
||||
Log.v( "MapBroadCastHelper", "NavStatus=" + status );
|
||||
}
|
||||
|
||||
public void mapFrount() {
|
||||
notifyXizhiNavStatus( STATUS_NAV_FRONT );
|
||||
}
|
||||
|
||||
public void mapBackground() {
|
||||
notifyXizhiNavStatus( STATUS_NAV_BACKGROUND );
|
||||
}
|
||||
|
||||
public void startNavi() {
|
||||
notifyXizhiNavStatus( STATUS_NAV_START );
|
||||
}
|
||||
|
||||
public void stopNavi() {
|
||||
notifyXizhiNavStatus( STATUS_NAV_STOP );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusChanged( StatusDescriptor descriptor, boolean isTrue ) {
|
||||
if ( descriptor == StatusDescriptor.AI_ASSIST_READY ) {
|
||||
if ( isTrue ) {
|
||||
if ( AppUtils.isApplicationBroughtToBackground( mContext ) ) {
|
||||
mapBackground();
|
||||
} else {
|
||||
mapFrount();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void release(){
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().unregisterStatusChangedListener( TAG, StatusDescriptor.AI_ASSIST_READY, this );
|
||||
mContext = null;
|
||||
sInstance = null;
|
||||
}
|
||||
}
|
||||
@@ -1,143 +0,0 @@
|
||||
package com.mogo.module.map;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/7/30
|
||||
* <p>
|
||||
* 语音控制地图
|
||||
*/
|
||||
class MapControlCommandHandler {
|
||||
|
||||
private static final String TAG = "CustomVoiceCommandHandler";
|
||||
|
||||
private OnMapControlCallback mCallback;
|
||||
|
||||
public void setCallback( OnMapControlCallback mCallback ) {
|
||||
this.mCallback = mCallback;
|
||||
}
|
||||
|
||||
public void handleVoiceCommand( String cmd ) {
|
||||
Logger.d( TAG, cmd );
|
||||
switch ( cmd ) {
|
||||
case VoiceConstants.CMD_MAP_TRAFFIC_MODE_UN_WAKEUP:
|
||||
case VoiceConstants.CMD_MAP_TRAFFIC_MODE:
|
||||
mCallback.onTrafficModeChanged( true );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE_UN_WAKEUP:
|
||||
case VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE:
|
||||
mCallback.onTrafficModeChanged( false );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_ZOOM_IN_UN_WAKEUP:
|
||||
case VoiceConstants.CMD_MAP_ZOOM_IN:
|
||||
mCallback.onZoomMap( true );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_ZOOM_OUT_UN_WAKEUP:
|
||||
case VoiceConstants.CMD_MAP_ZOOM_OUT:
|
||||
mCallback.onZoomMap( false );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_2D_UN_WAKEUP:
|
||||
case VoiceConstants.CMD_MAP_2D:
|
||||
case VoiceConstants.CMD_MAP_NORTH_UP_MODE_UN_WAKEUP:
|
||||
case VoiceConstants.CMD_MAP_NORTH_UP_MODE:
|
||||
mCallback.onCameraModeChanged( EnumMapUI.NorthUP_2D );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_3D_UN_WAKEUP:
|
||||
case VoiceConstants.CMD_MAP_3D:
|
||||
mCallback.onCameraModeChanged( EnumMapUI.CarUp_3D );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_DAY_TIME_MODE_UN_WAKEUP:
|
||||
case VoiceConstants.CMD_MAP_DAY_TIME_MODE:
|
||||
mCallback.onDayNightModeChanged( EnumMapUI.Type_Light );
|
||||
notifyAMap( EnumMapUI.Type_Light );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_HISTORY_UN_WAKEUP:
|
||||
case VoiceConstants.CMD_MAP_HISTORY:
|
||||
mCallback.onOpenNavi();
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_STOP_NAVI_MODE_UN_WAKEUP:
|
||||
case VoiceConstants.CMD_MAP_STOP_NAVI_MODE:
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_NIGHT_MODE_UN_WAKEUP:
|
||||
case VoiceConstants.CMD_MAP_NIGHT_MODE:
|
||||
mCallback.onDayNightModeChanged( EnumMapUI.Type_Night );
|
||||
notifyAMap( EnumMapUI.Type_Night );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE_UN_WAKEUP:
|
||||
case VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE:
|
||||
mCallback.onDayNightModeChanged( EnumMapUI.Type_AUTO_LIGHT_Night );
|
||||
notifyAMap( EnumMapUI.Type_AUTO_LIGHT_Night );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE:
|
||||
mCallback.onDisplayOverview();
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE:
|
||||
mCallback.onContinueNavi();
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_CAR_UP_MODE_UN_WAKEUP:
|
||||
case VoiceConstants.CMD_MAP_CAR_UP_MODE:
|
||||
mCallback.onCameraModeChanged( EnumMapUI.CarUp_2D );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_SPEAK_DRAFT_MODE:
|
||||
case VoiceConstants.CMD_MAP_SPEAK_DRAFT_MODE_UN_WAKEUP:
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_SPEAK_DETAIL_MODE:
|
||||
case VoiceConstants.CMD_MAP_SPEAK_DETAIL_MODE_UN_WAKEUP:
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_SPEAK_REMAIN:
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_OPEN_VR:
|
||||
case VoiceConstants.CMD_MAP_OPEN_VR_UN_WAKEUP:
|
||||
MogoApisHandler.getInstance().getApis().getMapFrameControllerApi().changeToVRMode();
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_CLOSE_VR:
|
||||
case VoiceConstants.CMD_MAP_CLOSE_VR_UN_WAKEUP:
|
||||
MogoApisHandler.getInstance().getApis().getMapFrameControllerApi().changeTo2dMode();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void notifyAMap( EnumMapUI ui ) {
|
||||
if ( ui == null ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( mCallback.getAMapLastType() == ui ) {
|
||||
return;
|
||||
}
|
||||
|
||||
int KEY_TYPE = 10048;
|
||||
int state = 0;//2黑夜;1白天 ;0自动
|
||||
switch ( ui ) {
|
||||
case Type_Light:
|
||||
state = 1;
|
||||
break;
|
||||
case Type_Night:
|
||||
state = 2;
|
||||
break;
|
||||
case Type_AUTO_LIGHT_Night:
|
||||
state = 0;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
Intent intent = new Intent();
|
||||
intent.setAction( "AUTONAVI_STANDARD_BROADCAST_RECV" );
|
||||
intent.putExtra( "KEY_TYPE", KEY_TYPE );
|
||||
intent.setFlags( Intent.FLAG_INCLUDE_STOPPED_PACKAGES );
|
||||
// 避免在内部再次调用
|
||||
intent.putExtra( "callback", false );
|
||||
intent.putExtra( "EXTRA_DAY_NIGHT_MODE", state );
|
||||
AbsMogoApplication.getApp().sendBroadcast( intent );
|
||||
}
|
||||
}
|
||||
@@ -94,7 +94,6 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter >
|
||||
mMogoMap = mMogoMapView.getMap();
|
||||
if ( mMogoMap != null ) {
|
||||
mMogoMap.getUIController().showMyLocation( true );
|
||||
mMogoMap.getUIController().recoverLockMode();// 启动锁车
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,7 +127,6 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter >
|
||||
if ( mMogoMapView != null ) {
|
||||
mMogoMapView.onPause();
|
||||
}
|
||||
MapBroadCastHelper.getInstance( getContext() ).mapBackground();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -140,7 +138,6 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter >
|
||||
if ( mMogoMapView != null ) {
|
||||
mMogoMapView.onResume();
|
||||
}
|
||||
MapBroadCastHelper.getInstance( getContext() ).mapFrount();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -178,9 +175,6 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter >
|
||||
uiSettings.setZoomControlsEnabled( false );
|
||||
//设置双指缩放手势是否可用。
|
||||
uiSettings.setZoomGesturesEnabled( true );
|
||||
if ( mMogoMap.getUIController() != null ) {
|
||||
mMogoMap.getUIController().changeMapMode( EnumMapUI.CarUp_2D );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,7 +190,6 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter >
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
MapBroadCastHelper.getInstance( getContext() ).release();
|
||||
if ( mMogoMapView != null ) {
|
||||
mMogoMapView.onDestroy();
|
||||
mMogoMapView = null;
|
||||
@@ -222,17 +215,16 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter >
|
||||
mMogoMapView.getMap().getUIController().changeCurrentIcon(iconId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* sight mode
|
||||
* @param mode
|
||||
*/
|
||||
|
||||
public static final int SIGHT_MODE_NORMAL = 0;
|
||||
public static final int SIGHT_MODE_TOP = 1;
|
||||
public static final int SIGHT_MODE_BACK = 2;
|
||||
public static final int SIGHT_MODE_CROSS = 3;
|
||||
public static final int SIGHT_MODE_FAR = 4;
|
||||
|
||||
@Override
|
||||
public void setMapDAngle(int mode) {
|
||||
float angle = getSightModeAngle(mode);
|
||||
|
||||
@@ -1,40 +1,6 @@
|
||||
package com.mogo.module.map;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Rect;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
|
||||
import com.mogo.commons.voice.VoicePreemptType;
|
||||
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.UiThreadHandler;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.navi.IMogoNaviListener2;
|
||||
import com.mogo.map.navi.MogoNaviConfig;
|
||||
import com.mogo.map.navi.MogoNaviInfo;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.MapControlResult;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.map.CustomNaviInterrupter;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.adas.IMogoADASControlStatusChangedListener;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.intent.IMogoIntentManager;
|
||||
import com.mogo.service.map.IMogoMapService;
|
||||
import com.mogo.service.module.IMogoRegisterCenter;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.service.strategy.IMogoRefreshStrategyController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -42,315 +8,12 @@ import java.util.Map;
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class MapPresenter extends Presenter< MapView > implements
|
||||
IMogoIntentListener,
|
||||
IMogoVoiceCmdCallBack,
|
||||
IMogoNaviListener2,
|
||||
OnMapControlCallback,
|
||||
IMogoADASControlStatusChangedListener {
|
||||
public class MapPresenter extends Presenter<MapView> {
|
||||
|
||||
private static final String TAG = "MapPresenter";
|
||||
private IMogoServiceApis mApis;
|
||||
private IMogoMapService mMogoMapService;
|
||||
private IMogoIntentManager mMogoIntentManager;
|
||||
private IMogoRefreshStrategyController mRefreshStrategyController;
|
||||
private IMogoStatusManager mStatusManager;
|
||||
private IMogoRegisterCenter mRegisterCenter;
|
||||
private Rect mDisplayOverviewBounds;
|
||||
|
||||
|
||||
private Runnable mLockCarRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if ( !mStatusManager.isDisplayOverview() ) {
|
||||
return;
|
||||
}
|
||||
mStatusManager.setDisplayOverview( TAG, false );
|
||||
mView.getUIController().recoverLockMode();
|
||||
}
|
||||
};
|
||||
private AutoNaviBroadcastIntentHandler mAutoNaviReceiver;
|
||||
private MapControlCommandHandler mCustomVoiceCommandHandler;
|
||||
|
||||
public MapPresenter( MapView view ) {
|
||||
super( view );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTrafficModeChanged( boolean open ) {
|
||||
mView.getUIController().setTrafficEnabled( open );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCameraModeChanged( EnumMapUI mode ) {
|
||||
mView.getUIController().changeMapMode( mode );
|
||||
mApis.getAdasControllerApi().changeAdasControlMode( mode );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDayNightModeChanged( EnumMapUI mode ) {
|
||||
mView.getUIController().changeMapMode( mode );
|
||||
mApis.getAdasControllerApi().changeAdasControlMode( mode );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapUiModeChanged( EnumMapUI mapUI ) {
|
||||
mView.getUIController().changeMapMode( mapUI );
|
||||
mCustomVoiceCommandHandler.notifyAMap( mapUI );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onContinueNavi() {
|
||||
if ( CustomNaviInterrupter.getInstance().interrupt() ) {
|
||||
return;
|
||||
}
|
||||
if ( mStatusManager.isMainPageOnResume() ) {
|
||||
mStatusManager.setDisplayOverview( TAG, false );
|
||||
mView.getUIController().recoverLockMode();
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "已为您继续导航" );
|
||||
UiThreadHandler.removeCallbacks( mLockCarRunnable );
|
||||
} else {
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
try {
|
||||
mStatusManager.setDisplayOverview( TAG, false );
|
||||
mView.getUIController().recoverLockMode();
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "已为您继续导航" );
|
||||
UiThreadHandler.removeCallbacks( mLockCarRunnable );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}, 2_000L );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOpenNavi() {
|
||||
if ( CustomNaviInterrupter.getInstance().interrupt() ) {
|
||||
return;
|
||||
}
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "已打开" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCalculatePath( double lon, double lat ) {
|
||||
if ( CustomNaviInterrupter.getInstance().interrupt() ) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopNaviInternal( Intent intent ) {
|
||||
mMogoMapService.getNavi( getContext() ).stopNavi();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReCalculatePath( MogoNaviConfig config ) {
|
||||
if ( CustomNaviInterrupter.getInstance().interrupt() ) {
|
||||
return;
|
||||
}
|
||||
mMogoMapService.getNavi( getContext() ).reCalculateRoute( config );
|
||||
}
|
||||
|
||||
private boolean hasOthersActivity() {
|
||||
ActivityManager am = ( ActivityManager ) getContext().getSystemService( Context.ACTIVITY_SERVICE );
|
||||
List< ActivityManager.RunningTaskInfo > list = am.getRunningTasks( 1 );
|
||||
if ( list != null && !list.isEmpty() ) {
|
||||
for ( ActivityManager.RunningTaskInfo runningTaskInfo : list ) {
|
||||
if ( TextUtils.equals( runningTaskInfo.topActivity.getPackageName(), getContext().getPackageName() ) ) {
|
||||
return runningTaskInfo.numActivities > 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisplayOverview() {
|
||||
if ( !mMogoMapService.getNavi( getContext() ).isNaviing() ) {
|
||||
Logger.d( TAG, "未开始导航." );
|
||||
return;
|
||||
}
|
||||
if ( mStatusManager.isV2XShow() ) {
|
||||
Logger.d( TAG, "ADAS模式忽略该请求." );
|
||||
return;
|
||||
}
|
||||
if ( !mStatusManager.isMainPageOnResume() ) {
|
||||
mStatusManager.setUserInteractionStatus( TAG, true, false );
|
||||
mStatusManager.setDisplayOverview( TAG, true );
|
||||
mView.getUIController().displayOverview( mDisplayOverviewBounds );
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "展示全程路线" );
|
||||
} else {
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
mStatusManager.setUserInteractionStatus( TAG, true, false );
|
||||
mStatusManager.setDisplayOverview( TAG, true );
|
||||
mView.getUIController().displayOverview( mDisplayOverviewBounds );
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "展示全程路线" );
|
||||
}, 2_000L );
|
||||
}
|
||||
|
||||
UiThreadHandler.postDelayed( mLockCarRunnable, 20_000 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onZoomMap( boolean zoomIn ) {
|
||||
boolean isLocked = mMogoMapService.getMapUIController().isCarLocked();
|
||||
MapControlResult result = mView.getUIController().changeZoom( zoomIn );
|
||||
if ( !CustomNaviInterrupter.getInstance().interrupt() ) {
|
||||
if ( result == MapControlResult.TARGET ) {
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
if ( zoomIn ) {
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "地图已是最大", VoicePreemptType.PREEMPT_TYPE_NEXT, null );
|
||||
} else {
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "地图已是最小", VoicePreemptType.PREEMPT_TYPE_NEXT, null );
|
||||
}
|
||||
}, 1_000L ); // 避免小智障播放完毕之前播报
|
||||
return;
|
||||
}
|
||||
}
|
||||
if ( isLocked ) {
|
||||
// 保持锁车状态
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
mView.getUIController().setLockZoom( ( ( int ) mMogoMapService.getMapUIController().getZoomLevel() ) );
|
||||
mMogoMapService.getMapUIController().recoverLockMode();//缩放地图会导致锁车发生改变,这里强制锁车
|
||||
}, 1_000 );
|
||||
} else {
|
||||
// 30s后锁车刷新
|
||||
mRefreshStrategyController.restartAutoRefreshAtTime( 30_000 );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate( @NonNull LifecycleOwner owner ) {
|
||||
super.onCreate( owner );
|
||||
|
||||
mApis = MogoApisHandler.getInstance().getApis();
|
||||
mMogoMapService = mApis.getMapServiceApi();
|
||||
mMogoIntentManager = mApis.getIntentManagerApi();
|
||||
mRefreshStrategyController = mApis.getRefreshStrategyControllerApi();
|
||||
mStatusManager = mApis.getStatusManagerApi();
|
||||
mRegisterCenter = mApis.getRegisterCenterApi();
|
||||
mRegisterCenter.registerMogoNaviListener( TAG, this );
|
||||
|
||||
IMogoNavi mogoNavi = mMogoMapService.getNavi( getContext() );
|
||||
mogoNavi.setCalculatePathDisplayBounds( new Rect(
|
||||
ResourcesHelper.getDimensionPixelSize( getContext(), R.dimen.module_map_calculate_path_display_overview_left_margin ),
|
||||
ResourcesHelper.getDimensionPixelSize( getContext(), R.dimen.module_map_calculate_path_display_overview_top_margin ),
|
||||
ResourcesHelper.getDimensionPixelSize( getContext(), R.dimen.module_map_calculate_path_display_overview_right_margin ),
|
||||
ResourcesHelper.getDimensionPixelSize( getContext(), R.dimen.module_map_calculate_path_display_overview_bottom_margin )
|
||||
) );
|
||||
|
||||
mDisplayOverviewBounds = new Rect(
|
||||
ResourcesHelper.getDimensionPixelSize( getContext(), R.dimen.module_map_display_overview_left_margin ),
|
||||
ResourcesHelper.getDimensionPixelSize( getContext(), R.dimen.module_map_display_overview_top_margin ),
|
||||
ResourcesHelper.getDimensionPixelSize( getContext(), R.dimen.module_map_display_overview_right_margin ),
|
||||
ResourcesHelper.getDimensionPixelSize( getContext(), R.dimen.module_map_display_overview_bottom_margin )
|
||||
);
|
||||
|
||||
for ( String cmd : VoiceConstants.sUnUnRegisterCmds ) {
|
||||
mMogoIntentManager.registerIntentListener( cmd, this );
|
||||
}
|
||||
for ( Map.Entry< String, String[] > entry : VoiceConstants.sUnRegisterVoiceCmds.entrySet() ) {
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( entry.getKey(), entry.getValue(), this );
|
||||
}
|
||||
|
||||
initBroadcast();
|
||||
mCustomVoiceCommandHandler = new MapControlCommandHandler();
|
||||
mCustomVoiceCommandHandler.setCallback( this );
|
||||
mRegisterCenter.registerADASControlStatusChangedListener( TAG, this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumMapUI getAMapLastType() {
|
||||
if ( mAutoNaviReceiver != null ) {
|
||||
return mAutoNaviReceiver.getLastAMapUiType();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void initBroadcast() {
|
||||
mAutoNaviReceiver = new AutoNaviBroadcastIntentHandler();
|
||||
mAutoNaviReceiver.setCallback( this );
|
||||
mAutoNaviReceiver.register( mMogoIntentManager );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume( @NonNull LifecycleOwner owner ) {
|
||||
super.onResume( owner );
|
||||
registerVoiceCmd();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause( @NonNull LifecycleOwner owner ) {
|
||||
super.onPause( owner );
|
||||
unregisterVoiceCmd();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy( @NonNull LifecycleOwner owner ) {
|
||||
super.onDestroy( owner );
|
||||
if ( mAutoNaviReceiver != null ) {
|
||||
mAutoNaviReceiver.unregister( mMogoIntentManager );
|
||||
}
|
||||
mRegisterCenter.unregisterMogoNaviListener( TAG );
|
||||
mRegisterCenter.unregisterADASControlStatusChangedListener( TAG );
|
||||
|
||||
for ( String cmd : VoiceConstants.sUnUnRegisterCmds ) {
|
||||
mMogoIntentManager.unregisterIntentListener( cmd, this );
|
||||
}
|
||||
for ( Map.Entry< String, String[] > entry : VoiceConstants.sUnRegisterVoiceCmds.entrySet() ) {
|
||||
AIAssist.getInstance( getContext() ).unregisterUnWakeupCommand( entry.getKey(), this );
|
||||
}
|
||||
}
|
||||
|
||||
private void registerVoiceCmd() {
|
||||
|
||||
for ( Map.Entry< String, String[] > entry : VoiceConstants.sVoiceCmds.entrySet() ) {
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( entry.getKey(), entry.getValue(), this );
|
||||
}
|
||||
|
||||
for ( String cmd : VoiceConstants.sCmds ) {
|
||||
mMogoIntentManager.registerIntentListener( cmd, this );
|
||||
}
|
||||
}
|
||||
|
||||
private void unregisterVoiceCmd() {
|
||||
|
||||
for ( Map.Entry< String, String[] > entry : VoiceConstants.sVoiceCmds.entrySet() ) {
|
||||
AIAssist.getInstance( getContext() ).unregisterUnWakeupCommand( entry.getKey(), this );
|
||||
}
|
||||
|
||||
for ( String cmd : VoiceConstants.sCmds ) {
|
||||
mMogoIntentManager.unregisterIntentListener( cmd, this );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onIntentReceived( String command, Intent intent ) {
|
||||
if ( TextUtils.isEmpty( command ) ) {
|
||||
return;
|
||||
}
|
||||
onCmdSelected( command );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCmdSelected( String cmd ) {
|
||||
Logger.d( TAG, cmd );
|
||||
mCustomVoiceCommandHandler.handleVoiceCommand( cmd );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviInfoUpdate( MogoNaviInfo naviinfo ) {
|
||||
MapBroadCastHelper.getInstance( getContext() ).notifyXiaozhi( naviinfo );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartNavi() {
|
||||
MapBroadCastHelper.getInstance( getContext() ).startNavi();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopNavi() {
|
||||
MapBroadCastHelper.getInstance( getContext() ).stopNavi();
|
||||
public MapPresenter(MapView view) {
|
||||
super(view);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.mogo.module.map;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
import com.mogo.map.navi.MogoNaviConfig;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
|
||||
public interface OnMapControlCallback {
|
||||
|
||||
// 交通态势
|
||||
void onTrafficModeChanged( boolean open );
|
||||
|
||||
// 2d、3d模式切换、正北、车头
|
||||
void onCameraModeChanged( EnumMapUI mode);
|
||||
|
||||
// 白天、黑夜模式切换
|
||||
void onDayNightModeChanged( EnumMapUI mode );
|
||||
|
||||
// 继续导航
|
||||
void onContinueNavi();
|
||||
|
||||
// 打开导航
|
||||
void onOpenNavi();
|
||||
|
||||
// 开始路径规划
|
||||
void onCalculatePath( double lon, double lat );
|
||||
|
||||
// 调用停止导航方法
|
||||
void onStopNaviInternal( Intent intent );
|
||||
|
||||
// 重新规划路线
|
||||
void onReCalculatePath( MogoNaviConfig config );
|
||||
|
||||
// 查看全程
|
||||
void onDisplayOverview();
|
||||
|
||||
// 缩放地图
|
||||
void onZoomMap( boolean zoomIn );
|
||||
|
||||
// 高德地图上次类型
|
||||
EnumMapUI getAMapLastType();
|
||||
}
|
||||
@@ -1,212 +0,0 @@
|
||||
package com.mogo.module.map;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-09
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class VoiceConstants {
|
||||
|
||||
// 地图免唤醒语音注册
|
||||
/**
|
||||
* 放大地图
|
||||
*/
|
||||
public static final String CMD_MAP_ZOOM_IN = "com.ileja.navi.map.enlarge";
|
||||
public static final String CMD_MAP_ZOOM_IN_UN_WAKEUP = "CMD_MAP_ZOOM_IN_UN_WAKEUP";
|
||||
public static final String[] CMD_MAP_ZOOM_IN_TRIGGER_WORDS = {"放大地图"};
|
||||
|
||||
/**
|
||||
* 导航历史记录
|
||||
*/
|
||||
public static final String CMD_MAP_HISTORY = "com.zhidao.navi.history.query";
|
||||
public static final String CMD_MAP_HISTORY_UN_WAKEUP = "CMD_MAP_HISTORY_UN_WAKEUP";
|
||||
public static final String[] CMD_MAP_HISTORY_TRIGGER_WORDS = {"查询导航历史记录"};
|
||||
|
||||
|
||||
/**
|
||||
* 缩小地图
|
||||
*/
|
||||
public static final String CMD_MAP_ZOOM_OUT = "com.ileja.navi.map.reduce";
|
||||
public static final String CMD_MAP_ZOOM_OUT_UN_WAKEUP = "CMD_MAP_ZOOM_OUT_UN_WAKEUP";
|
||||
public static final String[] CMD_MAP_ZOOM_OUT_TRIGGER_WORDS = {"缩小地图"};
|
||||
|
||||
/**
|
||||
* 2D模式
|
||||
*/
|
||||
public static final String CMD_MAP_2D = "com.ileja.navi.mode.2d";
|
||||
public static final String CMD_MAP_2D_UN_WAKEUP = "CMD_MAP_2D_UN_WAKEUP";
|
||||
public static final String[] CMD_MAP_2D_TRIGGER_WORDS = {"二地模式"};
|
||||
|
||||
/**
|
||||
* 打开vr
|
||||
*/
|
||||
public static final String CMD_MAP_OPEN_VR = "com.ileja.navi.mode.vr.open";
|
||||
public static final String CMD_MAP_OPEN_VR_UN_WAKEUP = "CMD_MAP_OPEN_VR_UN_WAKEUP";
|
||||
public static final String[] CMD_MAP_OPEN_VR_TRIGGER_WORDS = {"打开VR模式", "VR模式", "切换到VR模式"};
|
||||
|
||||
/**
|
||||
* 关闭vr
|
||||
*/
|
||||
public static final String CMD_MAP_CLOSE_VR = "com.ileja.navi.mode.vr.close";
|
||||
public static final String CMD_MAP_CLOSE_VR_UN_WAKEUP = "CMD_MAP_CLOSE_VR_UN_WAKEUP";
|
||||
public static final String[] CMD_MAP_CLOSE_VR_TRIGGER_WORDS = {"关闭VR模式", "切换到地图模式"};
|
||||
|
||||
/**
|
||||
* 3D模式
|
||||
*/
|
||||
public static final String CMD_MAP_3D = "com.ileja.navi.mode.3d";
|
||||
public static final String CMD_MAP_3D_UN_WAKEUP = "CMD_MAP_3D_UN_WAKEUP";
|
||||
public static final String[] CMD_MAP_3D_TRIGGER_WORDS = {"三地模式"};
|
||||
|
||||
/**
|
||||
* 白天模式
|
||||
*/
|
||||
public static final String CMD_MAP_DAY_TIME_MODE = "com.ileja.navi.mode.daytime";
|
||||
public static final String CMD_MAP_DAY_TIME_MODE_UN_WAKEUP = "CMD_MAP_DAY_TIME_MODE_UN_WAKEUP";
|
||||
public static final String[] CMD_MAP_DAY_TIME_MODE_TRIGGER_WORDS = {"白天模式"};
|
||||
|
||||
/**
|
||||
* 黑夜模式
|
||||
*/
|
||||
public static final String CMD_MAP_NIGHT_MODE = "com.ileja.navi.mode.night";
|
||||
public static final String CMD_MAP_NIGHT_MODE_UN_WAKEUP = "CMD_MAP_NIGHT_MODE_UN_WAKEUP";
|
||||
public static final String[] CMD_MAP_NIGHT_MODE_TRIGGER_WORDS = {"夜间模式"};
|
||||
|
||||
/**
|
||||
* 自动模式
|
||||
*/
|
||||
public static final String CMD_MAP_AUTO_LIGHT_NIGHT_MODE = "com.ileja.navi.mode.autodaynight";
|
||||
public static final String CMD_MAP_AUTO_LIGHT_NIGHT_MODE_UN_WAKEUP = "CMD_MAP_AUTO_LIGHT_NIGHT_MODE_UN_WAKEUP";
|
||||
public static final String[] CMD_MAP_AUTO_LIGHT_NIGHT_MODE_TRIGGER_WORDS = {"自动模式"};
|
||||
|
||||
/**
|
||||
* 查看路况
|
||||
*/
|
||||
public static final String CMD_MAP_TRAFFIC_MODE = "com.ileja.navi.traffic.open";
|
||||
public static final String CMD_MAP_TRAFFIC_MODE_UN_WAKEUP = "CMD_MAP_TRAFFIC_MODE_UN_WAKEUP";
|
||||
public static final String[] CMD_MAP_TRAFFIC_MODE_TRIGGER_WORDS = {"打开路况", "打开实况"};
|
||||
/**
|
||||
* 关闭路况
|
||||
*/
|
||||
public static final String CMD_MAP_UN_TRAFFIC_MODE = "com.ileja.navi.traffic.close";
|
||||
public static final String CMD_MAP_UN_TRAFFIC_MODE_UN_WAKEUP = "CMD_MAP_UN_TRAFFIC_MODE_UN_WAKEUP";
|
||||
public static final String[] CMD_MAP_UN_TRAFFIC_MODE_TRIGGER_WORDS = {"关闭路况", "关闭实况"};
|
||||
|
||||
/**
|
||||
* 导航全览
|
||||
*/
|
||||
public static final String CMD_MAP_DISPLAY_OVERVIEW_MODE = "com.ileja.navi.map.full";
|
||||
|
||||
/**
|
||||
* 继续导航
|
||||
*/
|
||||
public static final String CMD_MAP_CONTINUE_NAVI_MODE = "com.ileja.navi.route.continue";
|
||||
|
||||
|
||||
/**
|
||||
* 停止导航
|
||||
*/
|
||||
public static final String CMD_MAP_STOP_NAVI_MODE = "com.ileja.navi.route.stop";
|
||||
public static final String CMD_MAP_STOP_NAVI_MODE_UN_WAKEUP = "CMD_MAP_STOP_NAVI_MODE_UN_WAKEUP";
|
||||
public static final String[] CMD_MAP_STOP_NAVI_MODE_TRIGGER_WORDS = {"停止导航/结束导航/取消导航/放弃导航/退出导航/关闭导航"};
|
||||
|
||||
/**
|
||||
* 附近类命令
|
||||
*/
|
||||
public static final String CMD_MAP_GEO_NEARBY = "com.ileja.navi.geo.nearby";
|
||||
public static final String CMD_MAP_GEO_NEARBY_WAKEUP = "CMD_MAP_GEO_NEARBY_WAKEUP";
|
||||
public static final String[] CMD_MAP_GEO_NEARBY_TRIGGER_WORDS = {"查找附近的", "查找附近的"};
|
||||
|
||||
/**
|
||||
* 车头朝上
|
||||
*/
|
||||
public static final String CMD_MAP_CAR_UP_MODE = "com.ileja.traffic.head.up";
|
||||
public static final String CMD_MAP_CAR_UP_MODE_UN_WAKEUP = "CMD_MAP_CAR_UP_MODE_UN_WAKEUP";
|
||||
public static final String[] CMD_MAP_CAR_UP_MODE_TRIGGER_WORDS = {"车头朝上"};
|
||||
|
||||
/**
|
||||
* 北朝上
|
||||
*/
|
||||
public static final String CMD_MAP_NORTH_UP_MODE = "com.ileja.traffic.north.up";
|
||||
public static final String CMD_MAP_NORTH_UP_MODE_UN_WAKEUP = "CMD_MAP_NORTH_UP_MODE_UN_WAKEUP";
|
||||
public static final String[] CMD_MAP_NORTH_UP_MODE_TRIGGER_WORDS = {"正北朝上","北朝上"};
|
||||
/**
|
||||
* 简洁模式
|
||||
*/
|
||||
public static final String CMD_MAP_SPEAK_DRAFT_MODE = "com.ileja.traffic.speak.draft";
|
||||
public static final String CMD_MAP_SPEAK_DRAFT_MODE_UN_WAKEUP = "CMD_MAP_SPEAK_DRAFT_MODE_UN_WAKEUP";
|
||||
public static final String[] CMD_MAP_SPEAK_DRAFT_MODE_TRIGGER_WORDS = {"简洁模式", "简洁播报"};
|
||||
|
||||
|
||||
/**
|
||||
* 详细模式
|
||||
*/
|
||||
public static final String CMD_MAP_SPEAK_DETAIL_MODE = "com.ileja.traffic.speak.detail";
|
||||
public static final String CMD_MAP_SPEAK_DETAIL_MODE_UN_WAKEUP = "CMD_MAP_SPEAK_DETAIL_MODE_UN_WAKEUP";
|
||||
public static final String[] CMD_MAP_SPEAK_DETAIL_MODE_TRIGGER_WORDS = {"详细模式", "详细播报"};
|
||||
|
||||
/**
|
||||
* 播报当前导航剩余里程和时间
|
||||
*/
|
||||
public static final String CMD_MAP_SPEAK_REMAIN = "com.ileja.traffic.speak.remain";
|
||||
public static final String CMD_MAP_SPEAK_REMAIN_UN_WAKEUP = "CMD_MAP_SPEAK_REMAIN_UN_WAKEUP";
|
||||
public static final String[] CMD_MAP_SPEAK_REMAIN_TRIGGER_WORDS = {"还有多久", "多久到", "还有多远"};
|
||||
|
||||
// 免唤醒
|
||||
public static final Map< String, String[] > sVoiceCmds = new HashMap<>();
|
||||
// 不注销的免唤醒
|
||||
public static final Map< String, String[] > sUnRegisterVoiceCmds = new HashMap<>();
|
||||
// 唤醒
|
||||
public static final List< String > sCmds = new ArrayList<>();
|
||||
// 不注销的唤醒
|
||||
public static final List< String > sUnUnRegisterCmds = new ArrayList<>();
|
||||
|
||||
static {
|
||||
// 免唤醒
|
||||
sVoiceCmds.put( VoiceConstants.CMD_MAP_ZOOM_IN_UN_WAKEUP, VoiceConstants.CMD_MAP_ZOOM_IN_TRIGGER_WORDS );
|
||||
sVoiceCmds.put( VoiceConstants.CMD_MAP_ZOOM_OUT_UN_WAKEUP, VoiceConstants.CMD_MAP_ZOOM_OUT_TRIGGER_WORDS );
|
||||
sVoiceCmds.put( VoiceConstants.CMD_MAP_TRAFFIC_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_TRAFFIC_MODE_TRIGGER_WORDS );
|
||||
sVoiceCmds.put( VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE_TRIGGER_WORDS );
|
||||
sVoiceCmds.put( VoiceConstants.CMD_MAP_CAR_UP_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_CAR_UP_MODE_TRIGGER_WORDS );
|
||||
sVoiceCmds.put( VoiceConstants.CMD_MAP_NORTH_UP_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_NORTH_UP_MODE_TRIGGER_WORDS );
|
||||
sVoiceCmds.put( VoiceConstants.CMD_MAP_HISTORY_UN_WAKEUP, VoiceConstants.CMD_MAP_HISTORY_TRIGGER_WORDS );
|
||||
sVoiceCmds.put( VoiceConstants.CMD_MAP_SPEAK_DETAIL_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_SPEAK_DETAIL_MODE_TRIGGER_WORDS );
|
||||
sVoiceCmds.put( VoiceConstants.CMD_MAP_SPEAK_DRAFT_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_SPEAK_DRAFT_MODE_TRIGGER_WORDS );
|
||||
|
||||
sUnRegisterVoiceCmds.put( VoiceConstants.CMD_MAP_DAY_TIME_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_DAY_TIME_MODE_TRIGGER_WORDS );
|
||||
sUnRegisterVoiceCmds.put( VoiceConstants.CMD_MAP_NIGHT_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_NIGHT_MODE_TRIGGER_WORDS );
|
||||
sUnRegisterVoiceCmds.put( VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE_TRIGGER_WORDS );
|
||||
sUnRegisterVoiceCmds.put( VoiceConstants.CMD_MAP_OPEN_VR_UN_WAKEUP, VoiceConstants.CMD_MAP_OPEN_VR_TRIGGER_WORDS );
|
||||
sUnRegisterVoiceCmds.put( VoiceConstants.CMD_MAP_CLOSE_VR_UN_WAKEUP, VoiceConstants.CMD_MAP_CLOSE_VR_TRIGGER_WORDS );
|
||||
|
||||
// 唤醒
|
||||
sCmds.add( VoiceConstants.CMD_MAP_ZOOM_IN );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_ZOOM_OUT );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_2D );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_3D );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_TRAFFIC_MODE );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_CAR_UP_MODE );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_NORTH_UP_MODE );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_STOP_NAVI_MODE );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_SPEAK_DRAFT_MODE );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_SPEAK_DETAIL_MODE );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_SPEAK_REMAIN );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_OPEN_VR );
|
||||
sCmds.add( VoiceConstants.CMD_MAP_CLOSE_VR );
|
||||
|
||||
// 退到后台不注销的命令
|
||||
sUnUnRegisterCmds.add( VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE );
|
||||
sUnUnRegisterCmds.add( VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE );
|
||||
sUnUnRegisterCmds.add( VoiceConstants.CMD_MAP_HISTORY );
|
||||
sUnUnRegisterCmds.add( VoiceConstants.CMD_MAP_DAY_TIME_MODE );
|
||||
sUnUnRegisterCmds.add( VoiceConstants.CMD_MAP_NIGHT_MODE );
|
||||
sUnUnRegisterCmds.add( VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE );
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,4 @@
|
||||
-keep interface com.mogo.module.service.network.RefreshCallback{*;}
|
||||
-keep interface com.mogo.module.service.network.bean.DemoUserInfoEntity{*;}
|
||||
-keep interface com.mogo.module.service.ttsConfig.TtsConfigApiService{*;}
|
||||
-keep class com.mogo.module.service.strategy.CarIconDisplayStrategy{
|
||||
public static final <fields>;
|
||||
}
|
||||
-keep class com.mogo.module.service.ServiceConst{*;}
|
||||
@@ -25,11 +25,7 @@
|
||||
-keep class com.mogo.module.service.network.RefreshBody.*{*;}
|
||||
-keep class com.mogo.module.service.network.bean.DemoUserInfoEntity.*{*;}
|
||||
-keep interface com.mogo.module.service.intent.IntentHandler
|
||||
-keep interface com.mogo.module.service.marker.IMarkerView
|
||||
-keep interface com.mogo.module.service.network.RefreshApiService
|
||||
-keep interface com.mogo.module.service.network.RefreshCallback
|
||||
-keep interface com.mogo.module.service.network.bean.DemoUserInfoEntity
|
||||
-keep class com.mogo.module.service.strategy.CarIconDisplayStrategy{
|
||||
public static final <fields>;
|
||||
}
|
||||
-keep class com.mogo.module.service.ServiceConst
|
||||
@@ -7,7 +7,6 @@ import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerManager;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.overlay.IMogoOverlayManager;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
@@ -44,7 +43,6 @@ public class MarkerServiceHandler {
|
||||
|
||||
private static IMogoMapService sMapService;
|
||||
private static IMogoMarkerManager sMarkerManager;
|
||||
private static IMogoNavi sNavi;
|
||||
private static IMogoMapUIController sMapUIController;
|
||||
private static IMogoLocationClient sLocationClient;
|
||||
private static IMogoStatusManager sMogoStatusManager;
|
||||
@@ -60,8 +58,6 @@ public class MarkerServiceHandler {
|
||||
private static ICarsChattingProvider sCarChatting;
|
||||
private static IMogoOverlayManager sIMogoOverlayManager;
|
||||
|
||||
// private static IMogoGpsSimulatorManager sGpsSimulatorManager;
|
||||
|
||||
public static synchronized void init( final Context context ) {
|
||||
|
||||
if ( sCarChatting != null ) {
|
||||
@@ -76,7 +72,6 @@ public class MarkerServiceHandler {
|
||||
sMogoAnalytics = sApis.getAnalyticsApi();
|
||||
sMarkerManager = sMapService.getMarkerManager( context );
|
||||
sIMogoOverlayManager = sMapService.getOverlayManager(context);
|
||||
sNavi = sMapService.getNavi( context );
|
||||
sMapUIController = sMapService.getMapUIController();
|
||||
sLocationClient = sMapService.getSingletonLocationClient( context );
|
||||
sRegisterCenter = sApis.getRegisterCenterApi();
|
||||
@@ -88,8 +83,6 @@ public class MarkerServiceHandler {
|
||||
sCarChatting = ( ICarsChattingProvider ) ARouter.getInstance().build( CallChattingProviderConstant.CAR_CALL_PROVIDER ).navigation( context );
|
||||
|
||||
MapMarkerManager.getInstance().init( context );
|
||||
|
||||
// sGpsSimulatorManager = ARouter.getInstance().navigation( IMogoGpsSimulatorManager.class );
|
||||
}
|
||||
|
||||
public static IMogoServiceApis getApis() {
|
||||
@@ -104,10 +97,6 @@ public class MarkerServiceHandler {
|
||||
return sMarkerManager;
|
||||
}
|
||||
|
||||
public static IMogoNavi getNavi() {
|
||||
return sNavi;
|
||||
}
|
||||
|
||||
public static IMogoMapUIController getMapUIController() {
|
||||
return sMapUIController;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.navi.IMogoAimlessModeListener;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.navi.IMogoNaviListener;
|
||||
import com.mogo.map.navi.MogoTraffic;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
@@ -50,7 +49,6 @@ import com.mogo.module.service.receiver.MogoReceiver;
|
||||
import com.mogo.module.service.refresh.AutoRefreshStrategy;
|
||||
import com.mogo.module.service.refresh.CustomRefreshStrategy;
|
||||
import com.mogo.module.service.refresh.RefreshObject;
|
||||
import com.mogo.module.service.strategy.CarIconDisplayStrategy;
|
||||
import com.mogo.module.service.timedelay.TimeDelayUploadManager;
|
||||
import com.mogo.module.service.ttsConfig.TtsConfigModleData;
|
||||
import com.mogo.realtime.api.MoGoAiCloudRealTime;
|
||||
@@ -150,7 +148,6 @@ public class MogoServices implements IMogoMapListener,
|
||||
private IMogoActionManager mActionManager;
|
||||
private IMogoADASController mADASController;
|
||||
private IMogoFragmentManager mFragmentManager;
|
||||
private IMogoNavi mNavi;
|
||||
private IMogoRegisterCenter mRegisterCenter;
|
||||
|
||||
|
||||
@@ -316,7 +313,6 @@ public class MogoServices implements IMogoMapListener,
|
||||
mTtsModle = new TtsConfigModleData();
|
||||
mMogoMapService = MarkerServiceHandler.getMapService();
|
||||
mUiController = mMogoMapService.getMapUIController();
|
||||
mNavi = mMogoMapService.getNavi( context );
|
||||
|
||||
mStatusManager = MarkerServiceHandler.getMogoStatusManager();
|
||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE, StatusDescriptor.USER_INTERACTED, statusChangedListener );
|
||||
@@ -333,7 +329,6 @@ public class MogoServices implements IMogoMapListener,
|
||||
|
||||
public void init( Context context ) {
|
||||
|
||||
|
||||
initWorkThread();
|
||||
|
||||
registerMogoReceiver( context );
|
||||
@@ -377,8 +372,6 @@ public class MogoServices implements IMogoMapListener,
|
||||
|
||||
mFragmentManager.addMainFragmentStackTransactionListener( this );
|
||||
|
||||
CarIconDisplayStrategy.getInstance().changeCarIconStatus( mStatusManager.isSeekHelping() );
|
||||
|
||||
AutoPilotRemoteController.getInstance().start();
|
||||
|
||||
Intent intent = new Intent( "com.freedom.ser.ACTION" );
|
||||
@@ -864,11 +857,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
if ( mStatusManager.isSearchUIShow() ) {
|
||||
mStatusManager.setSearchUIShow( TAG, false );
|
||||
}
|
||||
if ( mNavi.isNaviing() ) {
|
||||
MapCenterPointStrategy.setMapCenterPointByScene( mUiController, Scene.NAVI );
|
||||
} else {
|
||||
MapCenterPointStrategy.setMapCenterPointByScene( mUiController, Scene.AIMLESS );
|
||||
}
|
||||
MapCenterPointStrategy.setMapCenterPointByScene( mUiController, Scene.AIMLESS );
|
||||
mUiController.recoverLockMode();
|
||||
mADASController.showADAS();
|
||||
} else {
|
||||
|
||||
@@ -9,7 +9,6 @@ import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.service.launchercard.LauncherCardRefresher;
|
||||
import com.mogo.module.service.marker.MapMarkerManager;
|
||||
import com.mogo.module.service.strategy.CarIconDisplayStrategy;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.zhidao.carchattingprovider.CallChattingProviderConstant;
|
||||
@@ -121,7 +120,6 @@ abstract class StatusChangedAdapter implements IMogoStatusChangedListener {
|
||||
}
|
||||
|
||||
public void onSeekHelpingStatusChanged(boolean isSeekingHelping) {
|
||||
CarIconDisplayStrategy.getInstance().changeCarIconStatus(isSeekingHelping);
|
||||
notifySeekHelpingStatusChanged(isSeekingHelping);
|
||||
}
|
||||
|
||||
|
||||
@@ -133,55 +133,6 @@ public class MockIntentHandler implements IntentHandler {
|
||||
}
|
||||
break;
|
||||
}
|
||||
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));
|
||||
break;
|
||||
}
|
||||
case 14: {//测试点的动画移动,模拟周边车辆移动
|
||||
List<MogoLatLng> mogoLatLngs = new ArrayList<>();
|
||||
mogoLatLngs.add(new MogoLatLng(39.615986, 116.396716));
|
||||
|
||||
@@ -1,282 +0,0 @@
|
||||
package com.mogo.module.service.strategy;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.uicontroller.CarCursorOption;
|
||||
import com.mogo.module.common.utils.CarSeries;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.R;
|
||||
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-04-16
|
||||
* <p>
|
||||
* 上报故障求助之后自车的图标显示策略
|
||||
*/
|
||||
public class CarIconDisplayStrategy {
|
||||
|
||||
private static final String TAG = "CarIconDisplayStrategy";
|
||||
|
||||
public static final int MSG_SEEK_HELPING_ANIM = 2000;
|
||||
public static final int MSG_STOP_SEEK_HELPING_ANIM = 2001;
|
||||
|
||||
// F 系列才有这个帧动画
|
||||
public static final int[] sFrame = {
|
||||
R.drawable.module_service_ic_warning_circle_orange_00000,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00001,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00002,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00003,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00004,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00005,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00006,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00007,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00008,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00009,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00010,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00011,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00012,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00013,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00014,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00015,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00016,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00017,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00018,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00019,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00020,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00021,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00022,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00023,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00024,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00025,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00026,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00027,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00028,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00029,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00030,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00031,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00032,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00033,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00034,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00035,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00036,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00037,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00038,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00039,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00040,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00041,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00042,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00043,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00044,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00045,
|
||||
R.drawable.module_service_ic_warning_circle_orange_00046
|
||||
};
|
||||
|
||||
// F 系列才有这个帧动画
|
||||
public static final int[] sFrameVr = {
|
||||
R.drawable.module_service_ic_car_for_help_0000,
|
||||
R.drawable.module_service_ic_car_for_help_0001,
|
||||
R.drawable.module_service_ic_car_for_help_0002,
|
||||
R.drawable.module_service_ic_car_for_help_0003,
|
||||
R.drawable.module_service_ic_car_for_help_0004,
|
||||
R.drawable.module_service_ic_car_for_help_0005,
|
||||
R.drawable.module_service_ic_car_for_help_0006,
|
||||
R.drawable.module_service_ic_car_for_help_0007,
|
||||
R.drawable.module_service_ic_car_for_help_0008,
|
||||
R.drawable.module_service_ic_car_for_help_0009,
|
||||
R.drawable.module_service_ic_car_for_help_0010,
|
||||
R.drawable.module_service_ic_car_for_help_0011,
|
||||
R.drawable.module_service_ic_car_for_help_0012,
|
||||
R.drawable.module_service_ic_car_for_help_0013,
|
||||
R.drawable.module_service_ic_car_for_help_0014,
|
||||
R.drawable.module_service_ic_car_for_help_0015,
|
||||
R.drawable.module_service_ic_car_for_help_0016,
|
||||
R.drawable.module_service_ic_car_for_help_0017,
|
||||
R.drawable.module_service_ic_car_for_help_0018,
|
||||
R.drawable.module_service_ic_car_for_help_0019,
|
||||
R.drawable.module_service_ic_car_for_help_0020,
|
||||
R.drawable.module_service_ic_car_for_help_0021,
|
||||
R.drawable.module_service_ic_car_for_help_0022,
|
||||
R.drawable.module_service_ic_car_for_help_0023,
|
||||
R.drawable.module_service_ic_car_for_help_0024
|
||||
};
|
||||
|
||||
private static volatile CarIconDisplayStrategy sInstance;
|
||||
|
||||
private IMogoMarker mSeekHelpingMarker;
|
||||
private ArrayList<Bitmap> mBitmapFrames = new ArrayList<>();
|
||||
|
||||
private CarIconDisplayStrategy() {
|
||||
mOption =
|
||||
new CarCursorOption.Builder().carCursorRes(R.drawable.module_service_ic_seek_helping).build();
|
||||
}
|
||||
|
||||
public static CarIconDisplayStrategy getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (CarIconDisplayStrategy.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new CarIconDisplayStrategy();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
private Handler mSeekHelpingHandler;
|
||||
private CarCursorOption mOption;
|
||||
private MogoMarkerOptions seekHelpMarkerOptions;
|
||||
// private IMogoMarker seekHelpMarker;
|
||||
|
||||
|
||||
public void changeCarIconStatus(boolean seekHelpingStatus) {
|
||||
if (CarSeries.isF8xxSeries()) {
|
||||
if (seekHelpingStatus) {
|
||||
playSeekHelpingAnim();
|
||||
} else {
|
||||
stopSeekHelpingAnim();
|
||||
}
|
||||
} else {
|
||||
if (seekHelpingStatus) {
|
||||
MarkerServiceHandler.getMapUIController().showMyLocation(false);
|
||||
mSeekHelpingMarker = MarkerServiceHandler.getMarkerManager().addMarker(
|
||||
TAG,
|
||||
new MogoMarkerOptions()
|
||||
.icon(BitmapFactory.decodeResource(AbsMogoApplication.getApp().getResources(), R.drawable.module_service_ic_seek_helping))
|
||||
.period(1)
|
||||
.zIndex(1000)
|
||||
.autoManager(false)
|
||||
.anchor(0.5f, 0.5f)
|
||||
.position(MarkerServiceHandler.getMapService().getNavi(AbsMogoApplication.getApp()).getCarLocation2()));
|
||||
// MarkerServiceHandler.getMapUIController().setCarCursorOption( mOption );
|
||||
} else {
|
||||
MarkerServiceHandler.getMapUIController().showMyLocation(true);
|
||||
try {
|
||||
if (mSeekHelpingMarker != null) {
|
||||
mSeekHelpingMarker.destroy();
|
||||
mSeekHelpingMarker = null;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// MarkerServiceHandler.getMapUIController().setCarCursorOption(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void playSeekHelpingAnim() {
|
||||
initHandler();
|
||||
Message msg = Message.obtain();
|
||||
msg.what = MSG_SEEK_HELPING_ANIM;
|
||||
mSeekHelpingHandler.sendMessageDelayed(msg, 0);
|
||||
}
|
||||
|
||||
private void initHandler() {
|
||||
if (mSeekHelpingHandler != null) {
|
||||
return;
|
||||
}
|
||||
mSeekHelpingHandler = new Handler(WorkThreadHandler.getInstance().getLooper()) {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
super.handleMessage(msg);
|
||||
switch (msg.what) {
|
||||
case MSG_SEEK_HELPING_ANIM:
|
||||
try {
|
||||
stopAnim();
|
||||
playAnim();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
break;
|
||||
case MSG_STOP_SEEK_HELPING_ANIM:
|
||||
try {
|
||||
stopAnim();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void stopSeekHelpingAnim() {
|
||||
initHandler();
|
||||
Message msg = Message.obtain();
|
||||
msg.what = MSG_STOP_SEEK_HELPING_ANIM;
|
||||
mSeekHelpingHandler.sendMessageDelayed(msg, 0);
|
||||
}
|
||||
|
||||
private void playAnim() {
|
||||
try {
|
||||
if (MarkerServiceHandler.getMogoStatusManager().isVrMode()) {
|
||||
for (int i : sFrameVr) {
|
||||
mBitmapFrames.add(BitmapFactory.decodeResource(AbsMogoApplication.getApp().getResources(), i));
|
||||
}
|
||||
} else {
|
||||
for (int i : sFrame) {
|
||||
mBitmapFrames.add(BitmapFactory.decodeResource(AbsMogoApplication.getApp().getResources(), i));
|
||||
}
|
||||
}
|
||||
|
||||
mSeekHelpingMarker = MarkerServiceHandler.getMarkerManager().addMarker(TAG,
|
||||
new MogoMarkerOptions()
|
||||
.icons(mBitmapFrames)
|
||||
.period(20)
|
||||
.zIndex(0)
|
||||
.scale(MarkerServiceHandler.getMogoStatusManager().isVrMode() ? 0.4f : 1.0f)
|
||||
.autoManager(false)
|
||||
.anchor(0.5f, 0.5f)
|
||||
.position(MarkerServiceHandler.getMapService().getMapUIController().getWindowCenterLocation()));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
mSeekHelpingMarker = MarkerServiceHandler.getMarkerManager().addMarker(
|
||||
TAG,
|
||||
new MogoMarkerOptions()
|
||||
.icon(BitmapFactory.decodeResource(AbsMogoApplication.getApp().getResources(), R.drawable.module_service_ic_seek_helping))
|
||||
.period(1)
|
||||
.zIndex(1000)
|
||||
.autoManager(false)
|
||||
.anchor(0.5f, 0.5f)
|
||||
.position(MarkerServiceHandler.getMapService().getNavi(AbsMogoApplication.getApp()).getCarLocation2()));
|
||||
// MarkerServiceHandler.getMapUIController().setCarCursorOption(new CarCursorOption.Builder().carCursorRes(R.drawable.module_service_ic_seek_helping_00036).build());
|
||||
}
|
||||
MarkerServiceHandler.getMapUIController().showMyLocation(false);
|
||||
}
|
||||
|
||||
private void stopAnim() {
|
||||
try {
|
||||
if (mSeekHelpingMarker != null) {
|
||||
mSeekHelpingMarker.destroy();
|
||||
mSeekHelpingMarker = null;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
try {
|
||||
if (!mBitmapFrames.isEmpty()) {
|
||||
for (Bitmap bitmapFrame : mBitmapFrames) {
|
||||
if (bitmapFrame != null && !bitmapFrame.isRecycled()) {
|
||||
bitmapFrame.recycle();
|
||||
}
|
||||
}
|
||||
mBitmapFrames.clear();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
MarkerServiceHandler.getMapUIController().showMyLocation(true);
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 9.8 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 117 KiB |
|
Before Width: | Height: | Size: 138 KiB |
|
Before Width: | Height: | Size: 159 KiB |
|
Before Width: | Height: | Size: 168 KiB |
|
Before Width: | Height: | Size: 176 KiB |
|
Before Width: | Height: | Size: 183 KiB |
|
Before Width: | Height: | Size: 186 KiB |
|
Before Width: | Height: | Size: 198 KiB |
|
Before Width: | Height: | Size: 203 KiB |
|
Before Width: | Height: | Size: 214 KiB |
|
Before Width: | Height: | Size: 218 KiB |
|
Before Width: | Height: | Size: 227 KiB |
|
Before Width: | Height: | Size: 228 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 58 KiB |