diff --git a/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/MogoOCHBusPassenger.java b/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/MogoOCHBusPassenger.java index 30cbec38f9..f4d202ef6c 100644 --- a/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/MogoOCHBusPassenger.java +++ b/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/MogoOCHBusPassenger.java @@ -6,15 +6,14 @@ import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentActivity; import com.alibaba.android.arouter.facade.annotation.Route; -import com.elegant.utils.UiThreadHandler; +import com.mogo.commons.module.status.IMogoStatusChangedListener; +import com.mogo.commons.module.status.MogoStatusManager; +import com.mogo.commons.module.status.StatusDescriptor; import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.map.MogoMapUIController; -import com.mogo.module.common.MogoApisHandler; import com.mogo.och.bus.passenger.constant.BusPassengerConst; import com.mogo.och.bus.passenger.ui.BusPassengerRouteFragment; -import com.mogo.service.statusmanager.IMogoStatusChangedListener; -import com.mogo.service.statusmanager.StatusDescriptor; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -64,8 +63,7 @@ public class MogoOCHBusPassenger implements IMogoOCH, IMogoStatusChangedListener @Override public void init(Context context) { - MogoApisHandler.getInstance().getApis().getStatusManagerApi().registerStatusChangedListener("OchBus" - , StatusDescriptor.VR_MODE, this); + MogoStatusManager.getInstance().registerStatusChangedListener("OchBus",StatusDescriptor.VR_MODE, this); } @Override @@ -106,4 +104,5 @@ public class MogoOCHBusPassenger implements IMogoOCH, IMogoStatusChangedListener mActivity.getSupportFragmentManager().beginTransaction().hide(mPassengerFragment).commitAllowingStateLoss(); } } + } diff --git a/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/model/BusPassengerModel.java b/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/model/BusPassengerModel.java index 2be7474aeb..cec4565c8c 100644 --- a/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/model/BusPassengerModel.java +++ b/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/model/BusPassengerModel.java @@ -15,12 +15,18 @@ import com.mogo.aicloud.services.socket.IMogoLifecycleListener; import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager; import com.mogo.cloud.commons.utils.CoordinateUtils; import com.mogo.commons.debug.DebugConfig; +import com.mogo.commons.module.intent.IMogoIntentListener; +import com.mogo.commons.module.intent.IntentManager; +import com.mogo.commons.module.status.IMogoStatusChangedListener; +import com.mogo.commons.module.status.MogoStatusManager; +import com.mogo.commons.module.status.StatusDescriptor; import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo; import com.mogo.eagle.core.data.config.FunctionBuildConfig; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager; +import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager; import com.mogo.eagle.core.network.utils.GsonUtil; import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; @@ -42,9 +48,6 @@ import com.mogo.och.bus.passenger.network.BusPassengerModelLoopManager; import com.mogo.och.bus.passenger.network.BusPassengerServiceManager; import com.mogo.och.common.module.biz.network.OchCommonServiceCallback; import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil; -import com.mogo.service.intent.IMogoIntentListener; -import com.mogo.service.statusmanager.IMogoStatusChangedListener; -import com.mogo.service.statusmanager.StatusDescriptor; import org.jetbrains.annotations.NotNull; @@ -247,14 +250,8 @@ public class BusPassengerModel { // 2021.11.1重构自动驾驶 实现接口 IMoGoAutopilotStatusListener 注册监听 替换IMogoAdasOCHCallback接口 CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener); - MogoApisHandler.getInstance() - .getApis() - .getIntentManagerApi() - .registerIntentListener( ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener ); - MogoApisHandler.getInstance() - .getApis() - .getStatusManagerApi() - .registerStatusChangedListener( TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener ); + IntentManager.getInstance().registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener ); + MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener ); // 达到起始站围栏监听 MogoApisHandler.getInstance() .getApis() @@ -266,10 +263,7 @@ public class BusPassengerModel { } private void releaseListeners() { - MogoApisHandler.getInstance() - .getApis() - .getStatusManagerApi() - .unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener); + MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener); // 注销到达起始站围栏监听 MogoApisHandler.getInstance() @@ -297,15 +291,12 @@ public class BusPassengerModel { } }; - private final IMogoStatusChangedListener mMogoStatusChangedListener = new IMogoStatusChangedListener() { - // VR mode变更回调 - @Override - public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) { - if (StatusDescriptor.VR_MODE == descriptor) { - if (mControllerStatusCallbackMap.size() > 0) { - for (IBusPassengerControllerStatusCallback callback :mControllerStatusCallbackMap.values()){ - callback.onVRModeChanged(isTrue); - } + // VR mode变更回调 + private final IMogoStatusChangedListener mMogoStatusChangedListener = (descriptor, isTrue) -> { + if (StatusDescriptor.VR_MODE == descriptor) { + if (mControllerStatusCallbackMap.size() > 0) { + for (IBusPassengerControllerStatusCallback callback :mControllerStatusCallbackMap.values()){ + callback.onVRModeChanged(isTrue); } } } diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/BusProvider.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/BusProvider.java index e60a54e1a6..629183bbb7 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/BusProvider.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/BusProvider.java @@ -10,13 +10,13 @@ import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; import com.alibaba.android.arouter.facade.annotation.Route; +import com.mogo.commons.module.status.IMogoStatusChangedListener; +import com.mogo.commons.module.status.MogoStatusManager; +import com.mogo.commons.module.status.StatusDescriptor; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.map.MogoMapUIController; -import com.mogo.module.common.MogoApisHandler; import com.mogo.och.bus.constant.BusConst; import com.mogo.och.bus.fragment.BusFragment; -import com.mogo.service.statusmanager.IMogoStatusChangedListener; -import com.mogo.service.statusmanager.StatusDescriptor; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -38,15 +38,15 @@ public class BusProvider implements IMogoOCH { /** * 进入鹰眼模式,设置手势缩放地图失效 */ - private void stepIntoVrMode(){ - CallerLogger.INSTANCE.d( M_BUS + TAG, "进入vr模式" ); + private void stepIntoVrMode() { + CallerLogger.INSTANCE.d(M_BUS + TAG, "进入vr模式"); MogoMapUIController.getInstance() .stepInVrMode(false); } @Override public void init(Context context) { - MogoApisHandler.getInstance().getApis().getStatusManagerApi().registerStatusChangedListener("OchBus" + MogoStatusManager.getInstance().registerStatusChangedListener("OchBus" , StatusDescriptor.VR_MODE, statusChangedListener); } @@ -55,12 +55,12 @@ public class BusProvider implements IMogoOCH { if (busFragment == null) { CallerLogger.INSTANCE.d(TAG, "准备add fragment======"); Fragment fragmentByTag = supportFragmentManager.findFragmentByTag(BusFragment.TAG); - if(fragmentByTag instanceof BusFragment){ - busFragment = (BusFragment)fragmentByTag; - }else { + if (fragmentByTag instanceof BusFragment) { + busFragment = (BusFragment) fragmentByTag; + } else { busFragment = new BusFragment(); } - supportFragmentManager.beginTransaction().add(containerId, busFragment,BusFragment.TAG).commitAllowingStateLoss(); + supportFragmentManager.beginTransaction().add(containerId, busFragment, BusFragment.TAG).commitAllowingStateLoss(); return; } CallerLogger.INSTANCE.d(TAG, "准备show fragment"); @@ -83,7 +83,7 @@ public class BusProvider implements IMogoOCH { } else { hideFragment(); } - } else if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) { + } else if (MogoStatusManager.getInstance().isVrMode()) { // topView进行展示时推出网约车界面,但是不隐藏整个fragment if (busFragment != null && isTrue) { busFragment.hideOchBus(); @@ -115,7 +115,9 @@ public class BusProvider implements IMogoOCH { @Override public void onDestroy() { - //若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠 + //若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠 + MogoStatusManager.getInstance().unregisterStatusChangedListener("OchBus" + , StatusDescriptor.VR_MODE, statusChangedListener); if (activity == null) return; activity.finish(); } diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java index d45ddd4deb..ad9e8b5b50 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java @@ -44,8 +44,7 @@ import com.mogo.map.MogoMarkerManager; import com.mogo.map.listener.IMogoMapListener; import com.mogo.map.uicontroller.VisualAngleMode; import com.mogo.module.common.MogoApisHandler; -import com.mogo.module.common.constants.DataTypes; -import com.mogo.module.common.view.OnPreventFastClickListener; +import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener; import com.mogo.och.bus.R; import com.mogo.och.bus.bean.BusRoutesResult; import com.mogo.och.bus.constant.BusConst; @@ -67,7 +66,7 @@ import record_cache.RecordPanelOuterClass; * * @author tongchenfei */ -public abstract class BaseBusTabFragment> extends MvpFragment implements IMogoMapListener, IMoGoAutopilotRecordListener { +public abstract class BaseBusTabFragment> extends MvpFragment implements IMogoMapListener, IMoGoAutopilotRecordListener { private static final String TAG = "BaseOchFragment"; @@ -158,19 +157,9 @@ public abstract class BaseBusTabFragment } }); - if (DebugConfig.isDebug()) { - mTrafficDataView.setLongClickable(true); - mTrafficDataView.setOnLongClickListener(v -> { - CallerLogger.INSTANCE.d(M_BUS + TAG, "长按显示状态工具栏"); - Intent intent = new Intent(); - intent.putExtra("oper", 52); - MogoApisHandler.getInstance().getApis().getIntentManagerApi().invoke("com.mogo.mock", intent); - return true; - }); - } initListener(); setAutopilotBtnStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState()); - ctvAutopilotStatus.setOnClickListener(new OnPreventFastClickListener(){ + ctvAutopilotStatus.setOnClickListener(new OnPreventFastClickListener() { @Override public void onClickImpl(View v) { @@ -221,7 +210,7 @@ public abstract class BaseBusTabFragment } mAICollectBtn = findViewById(R.id.module_mogo_och_ai_collet_rl); - if (mAICollectBtn != null){ + if (mAICollectBtn != null) { CallerDevaToolsManager.INSTANCE.initAiCollect(mAICollectBtn); } } @@ -236,7 +225,7 @@ public abstract class BaseBusTabFragment protected abstract void onArriveStation(); - private void updateSwitchMapIcon(){ + private void updateSwitchMapIcon() { if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isLongSight()) { mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long); } else if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isMediumSight()) { @@ -296,14 +285,15 @@ public abstract class BaseBusTabFragment /** * 设置进站按钮状态 + * * @param isClickable */ - public void setArrivedClikable(boolean isClickable){ + public void setArrivedClikable(boolean isClickable) { getActivity().runOnUiThread(() -> { tvArrived.setEnabled(isClickable); - if (isClickable){ + if (isClickable) { tvArrived.setTextColor(getResources().getColor(R.color.bus_white)); - }else { + } else { tvArrived.setTextColor(getResources().getColor(R.color.bus_arrived_btn_un_clickable_color)); } }); @@ -318,9 +308,10 @@ public abstract class BaseBusTabFragment }); } - public void playDI(){ + public void playDI() { SoundPoolHelper.getSoundPoolHelper().playSoundWithRedId(getContext(), R.raw.bus_di); } + /** * 改变自动驾驶状态 * @@ -348,13 +339,13 @@ public abstract class BaseBusTabFragment ctvAutopilotStatus.setClickable(true); if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == autopilotStatus) {//1可用 ctvAutopilotStatus.setSelected(false); - }else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == autopilotStatus){ + } else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == autopilotStatus) { ctvAutopilotStatus.setSelected(true); } } } - public void updateAutopilotStatus(int autopilotStatus){ + public void updateAutopilotStatus(int autopilotStatus) { if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == autopilotStatus) {//2 running ctvAutopilotStatusIv.setImageResource(R.drawable.bus_right_autopilot_icon); @@ -362,7 +353,7 @@ public abstract class BaseBusTabFragment ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_success_tv)); ctvAutopilotStatus.setSelected(false); ctvAutopilotStatus.setClickable(false); - }else { + } else { ctvAutopilotStatusIv.setImageResource(R.drawable.bus_wrong_autopilot_icon); ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal)); ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_failure_tv)); @@ -374,7 +365,7 @@ public abstract class BaseBusTabFragment public void run() { setAutopilotBtnStatus(autopilotStatus); } - },1000); + }, 1000); } private void changeAutopilotBtnView(int autopilotStatus, boolean isAnimateRunning) { @@ -462,19 +453,20 @@ public abstract class BaseBusTabFragment } - private void startingAutoApilotCountDown(){ + private void startingAutoApilotCountDown() { //10s 若自动驾驶没有开启,则结束动画 UiThreadHandler.postDelayed(new Runnable() { @Override public void run() { //未启动成功做处理 - if (isAnimateRunning){// 只判断动画是否在进行,根据自动驾驶当前状态去设置自动驾驶状态 + if (isAnimateRunning) {// 只判断动画是否在进行,根据自动驾驶当前状态去设置自动驾驶状态 stopAutopilotAnimation(); updateAutopilotStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState()); } } - },TIMER_START_AUTOPILOT_INTERVAL); + }, TIMER_START_AUTOPILOT_INTERVAL); } + /** * 停止自动驾驶中间动画 */ @@ -494,7 +486,7 @@ public abstract class BaseBusTabFragment */ public void updateSpeedView(float newSpeed) { int speed = (int) (Math.abs(newSpeed) * 3.6F); // 倒车时工控机反馈定位信息中speed为负值 - if (mTrafficDataView != null){ + if (mTrafficDataView != null) { mTrafficDataView.updateSpeedWithValue(speed); } } @@ -529,7 +521,7 @@ public abstract class BaseBusTabFragment /** * Bus调试信息:线路、轨迹等信息 - * + *

* START */ private View busTestBar; diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/model/BusOrderModel.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/model/BusOrderModel.java index cc1a76cebf..3cd5556952 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/model/BusOrderModel.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/model/BusOrderModel.java @@ -18,6 +18,9 @@ import com.elegant.network.utils.GsonUtil; import com.mogo.cloud.commons.utils.CoordinateUtils; import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.debug.DebugConfig; +import com.mogo.commons.module.status.IMogoStatusChangedListener; +import com.mogo.commons.module.status.MogoStatusManager; +import com.mogo.commons.module.status.StatusDescriptor; import com.mogo.commons.voice.AIAssist; import com.mogo.eagle.core.data.BaseData; import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters; @@ -63,8 +66,6 @@ import com.mogo.och.common.module.utils.PinYinUtil; import com.mogo.och.common.module.utils.SoundPoolHelper; import com.mogo.och.common.module.utils.ToastUtilsOch; import com.mogo.och.common.module.voice.VoiceNotice; -import com.mogo.service.statusmanager.IMogoStatusChangedListener; -import com.mogo.service.statusmanager.StatusDescriptor; import java.io.IOException; import java.util.ArrayList; @@ -78,7 +79,7 @@ import mogo.telematics.pad.MessagePad; /** * @author congtaowang * @since 2021/3/23 - * + *

* 小巴订单管理 */ public class BusOrderModel { @@ -122,7 +123,7 @@ public class BusOrderModel { private final Handler handler = new Handler(new Handler.Callback() { @Override public boolean handleMessage(Message msg) { - if ( msg.what == MSG_QUERY_BUS_STATION ) { + if (msg.what == MSG_QUERY_BUS_STATION) { queryBusRoutes(); return true; } @@ -131,9 +132,9 @@ public class BusOrderModel { }); public static BusOrderModel getInstance() { - if ( sInstance == null ) { - synchronized ( BusOrderModel.class ) { - if ( sInstance == null ) { + if (sInstance == null) { + synchronized (BusOrderModel.class) { + if (sInstance == null) { sInstance = new BusOrderModel(); } } @@ -155,10 +156,7 @@ public class BusOrderModel { .getApis() .getRegisterCenterApi() .registerCarLocationChangedListener(TAG, mCarLocationChangedListener2); - MogoApisHandler.getInstance() - .getApis() - .getStatusManagerApi() - .registerStatusChangedListener( TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener ); + MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener); //自动驾驶路线规划接口 CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG, moGoAutopilotPlanningListener); @@ -176,31 +174,31 @@ public class BusOrderModel { public void accept(Throwable e) { if (e instanceof UndeliverableException) { e = e.getCause(); - CallerLogger.INSTANCE.d(M_BUS + TAG,"UndeliverableException"); + CallerLogger.INSTANCE.d(M_BUS + TAG, "UndeliverableException"); } if ((e instanceof IOException)) {// // fine, irrelevant network problem or API that throws on cancellation - CallerLogger.INSTANCE.d(M_BUS + TAG,"IOException"); + CallerLogger.INSTANCE.d(M_BUS + TAG, "IOException"); return; } if (e instanceof InterruptedException) { // fine, some blocking code was interrupted by a dispose call - CallerLogger.INSTANCE.d(M_BUS + TAG,"InterruptedException"); + CallerLogger.INSTANCE.d(M_BUS + TAG, "InterruptedException"); return; } if ((e instanceof NullPointerException) || (e instanceof IllegalArgumentException)) { // that's likely a bug in the application - CallerLogger.INSTANCE.d(M_BUS + TAG,"NullPointerException or IllegalArgumentException"); + CallerLogger.INSTANCE.d(M_BUS + TAG, "NullPointerException or IllegalArgumentException"); Thread.currentThread().getUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), e); return; } if (e instanceof IllegalStateException) { // that's a bug in RxJava or in a custom operator - CallerLogger.INSTANCE.d(M_BUS + TAG,"IllegalStateException"); + CallerLogger.INSTANCE.d(M_BUS + TAG, "IllegalStateException"); Thread.currentThread().getUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), e); return; } - CallerLogger.INSTANCE.d(M_BUS + TAG,"Undeliverable exception"); + CallerLogger.INSTANCE.d(M_BUS + TAG, "Undeliverable exception"); } }); } @@ -213,11 +211,11 @@ public class BusOrderModel { this.refreshBusStationsCallback = callback; } - public void setPassengerCallback(IPassengerCallback callback){ + public void setPassengerCallback(IPassengerCallback callback) { this.mPassengerCallback = callback; } - public void setSlidePanelHideCallback(ISlidePannelHideCallback callback){ + public void setSlidePanelHideCallback(ISlidePannelHideCallback callback) { this.slidePanelHideCallback = callback; } @@ -234,9 +232,9 @@ public class BusOrderModel { @Override public void onAutopilotRotting(MessagePad.GlobalPathResp routeList) { - if (null != routeList && routeList.getWayPointsList().size() > 0){ + if (null != routeList && routeList.getWayPointsList().size() > 0) { points.clear(); - points.addAll(coordinateConverterWgsToGcjList(mContext,routeList.getWayPointsList())); + points.addAll(coordinateConverterWgsToGcjList(mContext, routeList.getWayPointsList())); updateOrderRoute(); } } @@ -259,12 +257,12 @@ public class BusOrderModel { * 上报订单全路径规划数据 */ public void updateOrderRoute() { - if (!isGoingToNextStation || backgroundCurrentStationIndex+1 >= stationList.size() || points.size() == 0){ + if (!isGoingToNextStation || backgroundCurrentStationIndex + 1 >= stationList.size() || points.size() == 0) { return; } - BusStationBean currentStation = stationList.get( backgroundCurrentStationIndex); - BusStationBean nextStation = stationList.get( backgroundCurrentStationIndex +1); + BusStationBean currentStation = stationList.get(backgroundCurrentStationIndex); + BusStationBean nextStation = stationList.get(backgroundCurrentStationIndex + 1); BusServiceManager.updateOrderRoute(mContext, currentLineId, currentStation.getSiteId() , nextStation.getSiteId(), points, new OchCommonServiceCallback() { @@ -275,27 +273,24 @@ public class BusOrderModel { @Override public void onFail(int code, String failMsg) { - if (isGoingToNextStation){//重试 + if (isGoingToNextStation) {//重试 updateOrderRoute(); } } }); } - public void debugUpdateOrderRoute(List list){ + public void debugUpdateOrderRoute(List list) { points.clear(); - points.addAll(coordinateConverterWgsToGcjList(mContext,list)); + points.addAll(coordinateConverterWgsToGcjList(mContext, list)); updateOrderRoute(); } - public void release(){ + public void release() { startOrStopOrderLoop(false); startOrStopQueryPassengerWriteOff(false); - MogoApisHandler.getInstance() - .getApis() - .getStatusManagerApi() - .unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener); + MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener); // 注销到达起始站围栏监听 MogoApisHandler.getInstance() @@ -315,7 +310,7 @@ public class BusOrderModel { return sInstance; } - private IMogoStatusChangedListener mMogoStatusChangedListener = new IMogoStatusChangedListener() { + private final IMogoStatusChangedListener mMogoStatusChangedListener = new IMogoStatusChangedListener() { // VR mode变更回调 @Override public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) { @@ -342,7 +337,7 @@ public class BusOrderModel { private final IMogoCarLocationChangedListener2 mCarLocationChangedListener2 = new IMogoCarLocationChangedListener2() { @Override - public void onCarLocationChanged2( Location location ) { + public void onCarLocationChanged2(Location location) { // CallerLogger.INSTANCE.d(M_BUS + TAG,"location = "+location.getLongitude()+","+location.getLatitude()); mLongitude = location.getLongitude(); mLatitude = location.getLatitude(); @@ -351,7 +346,7 @@ public class BusOrderModel { } //是否到站的围栏判断 离站状态并且自动驾驶还未触发到站 - if (isGoingToNextStation && !isArrivedStation){ + if (isGoingToNextStation && !isArrivedStation) { judgeArrivedStation(location); } } @@ -360,21 +355,21 @@ public class BusOrderModel { //根据围栏判断,是否到达站点 private void judgeArrivedStation(Location location) { - if (backgroundCurrentStationIndex +1 > stationList.size() - 1 ){ - CallerLogger.INSTANCE.e( M_BUS + TAG, "到站数组越界" ); + if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) { + CallerLogger.INSTANCE.e(M_BUS + TAG, "到站数组越界"); return; } - BusStationBean upcomingStation = stationList.get( backgroundCurrentStationIndex +1); + BusStationBean upcomingStation = stationList.get(backgroundCurrentStationIndex + 1); double startLon = upcomingStation.getGcjLon(); double startLat = upcomingStation.getGcjLat(); double distance = CoordinateUtils.calculateLineDistance( startLon, startLat, - location.getLongitude(), location.getLatitude() ); + location.getLongitude(), location.getLatitude()); - if ( distance <= BusConst.ARRIVE_AT_END_STATION_DISTANCE ) { - CallerLogger.INSTANCE.d(M_BUS + TAG,"行程日志-judgeArrivedStation() distance = " + distance - +" to " + upcomingStation.getName()); + if (distance <= BusConst.ARRIVE_AT_END_STATION_DISTANCE) { + CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-judgeArrivedStation() distance = " + distance + + " to " + upcomingStation.getName()); onArriveAt(null); //无自动驾驶到站信息传null return; } @@ -388,13 +383,13 @@ public class BusOrderModel { BusServiceManager.queryBusRoutes(mContext, new OchCommonServiceCallback() { @Override public void onSuccess(BusRoutesResponse data) { - if ( data == null + if (data == null || data.getResult() == null || data.getResult().getSites() == null - || data.getResult().getSites().isEmpty() ) { + || data.getResult().getSites().isEmpty()) { //当为空时,显示无绑定路线图 - CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据:空 " ); - if (refreshBusStationsCallback != null){ + CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据:空 "); + if (refreshBusStationsCallback != null) { refreshBusStationsCallback.updateEmptyUi(); } clearAutopilotControlParameters(); @@ -402,9 +397,10 @@ public class BusOrderModel { clearStartAutopilotTag(); return; } - CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据: " + data ); - updateBusStatus( data.getResult()); + CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据: " + data); + updateBusStatus(data.getResult()); } + @Override public void onFail(int code, String failMsg) { // 重复请求小巴路线,直至成功 @@ -417,26 +413,27 @@ public class BusOrderModel { /** * 更新正在运行的任务UI + * * @param stations */ private void updateBusTaskStatus(List stations) { int arrivingOrArrivedStationIndex = 0;//已经到站或者即将到站的索引呢 - for (int i =0 ; i< stations.size(); i++){ + for (int i = 0; i < stations.size(); i++) { BusStationBean station = stations.get(i); - if (i == 0){ // 首发站 显示在最上面 + if (i == 0) { // 首发站 显示在最上面 if (station.getDrivingStatus() == STATION_STATUS_STOPPED - && !station.isLeaving()){ //到达第一站 + && !station.isLeaving()) { //到达第一站 arrivingOrArrivedStationIndex = i; break; } - }else { - BusStationBean preStation = stations.get(i-1); + } else { + BusStationBean preStation = stations.get(i - 1); if ((station.getDrivingStatus() == STATION_STATUS_STOPPED && !station.isLeaving()) || (station.getDrivingStatus() == STATION_STATUS_ARRIVING - && preStation.isLeaving())){ + && preStation.isLeaving())) { //到站未离开 | 即将到站 显示在最中间 arrivingOrArrivedStationIndex = i; break; @@ -452,16 +449,16 @@ public class BusOrderModel { if (arrivingOrArrivedStationIndex == 0 || arrivingOrArrivedStation.getDrivingStatus() == STATION_STATUS_STOPPED - && !arrivingOrArrivedStation.isLeaving()){ - if (refreshBusStationsCallback != null){ - refreshBusStationsCallback.updateBusTaskStatus(busRoutesResult.getName(),lineTime, - stationList,arrivingOrArrivedStationIndex,true); + && !arrivingOrArrivedStation.isLeaving()) { + if (refreshBusStationsCallback != null) { + refreshBusStationsCallback.updateBusTaskStatus(busRoutesResult.getName(), lineTime, + stationList, arrivingOrArrivedStationIndex, true); } clearAutopilotControlParameters(); - }else { - if (refreshBusStationsCallback != null){ - refreshBusStationsCallback.updateBusTaskStatus(busRoutesResult.getName(),lineTime, - stationList,arrivingOrArrivedStationIndex,false); + } else { + if (refreshBusStationsCallback != null) { + refreshBusStationsCallback.updateBusTaskStatus(busRoutesResult.getName(), lineTime, + stationList, arrivingOrArrivedStationIndex, false); } updateAutopilotControlParameters(); } @@ -471,25 +468,25 @@ public class BusOrderModel { * 重置路线站点状态--结束路线,当前路线恢复到始发站 */ public void abortTask() { - CallerLogger.INSTANCE.d( M_BUS + TAG, "结束当前路线abortTask"); + CallerLogger.INSTANCE.d(M_BUS + TAG, "结束当前路线abortTask"); BusServiceManager.abortTask(mContext, currentTaskId , new OchCommonServiceCallback() { - @Override - public void onSuccess(BaseData o) { - CallerLogger.INSTANCE.d(M_BUS + TAG, "abortTask success: " + o); - if (o.code == 0){ // 重置成功 - endOrAbortTaskSuccess(); - clearBusStationDatas(); - queryBusRoutes(); - startOrStopQueryPassengerWriteOff(false); - } - } + @Override + public void onSuccess(BaseData o) { + CallerLogger.INSTANCE.d(M_BUS + TAG, "abortTask success: " + o); + if (o.code == 0) { // 重置成功 + endOrAbortTaskSuccess(); + clearBusStationDatas(); + queryBusRoutes(); + startOrStopQueryPassengerWriteOff(false); + } + } - @Override - public void onFail(int code, String failMsg) { - ToastUtils.showShort(failMsg); - } - }); + @Override + public void onFail(int code, String failMsg) { + ToastUtils.showShort(failMsg); + } + }); } @@ -501,12 +498,12 @@ public class BusOrderModel { isGoingToNextStation = false; backgroundCurrentStationIndex = 0; - if (busRoutesResult != null){ + if (busRoutesResult != null) { BusSendTripInfoManager.INSTANCE.sendBusTripInfo(BusSendTripInfoManager.END_TRIP , busRoutesResult.getName() - ,"" - ,"" - ,false); + , "" + , "" + , false); } } @@ -515,23 +512,23 @@ public class BusOrderModel { * 服务端返回的OchBusRoutesResult逻辑, 离开站为当前站, 到达下一站后才会将下一站置为当前站, * 车机端展示是离开当前站,下一站设置为当前站, 所以服务端数据回来要做处理,不能直接渲染 */ - private void leaveStationSuccess(int leaveIndex,String leaveStation,String nextStation) { + private void leaveStationSuccess(int leaveIndex, String leaveStation, String nextStation) { onStartAutopilot(leaveIndex); leaveTTSTips(nextStation); - if (busRoutesResult != null){ + if (busRoutesResult != null) { boolean isLastStop = false; - if (leaveIndex + 1 == stationList.size() -1){ + if (leaveIndex + 1 == stationList.size() - 1) { isLastStop = true; } //给bus外屏发送 BusSendTripInfoManager.INSTANCE.sendBusTripInfo(BusSendTripInfoManager.LEAVE_STATION , busRoutesResult.getName() - ,leaveStation - ,nextStation - ,isLastStop); + , leaveStation + , nextStation + , isLastStop); } } @@ -539,27 +536,28 @@ public class BusOrderModel { //开启自动驾驶 2.10.0: 如果自动驾驶状态下开启, 非自动驾驶状态下不开启,需手动点击自动驾驶按钮开启 isGoingToNextStation = true; if (CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState() - == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){ - startAutopilot(false,leaveIndex); - }else { + == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) { + startAutopilot(false, leaveIndex); + } else { firstStartAutopilot = 0; } } /** * 开启自动驾驶 + * * @param isRestart */ - private void startAutopilot(boolean isRestart,int leaveIndex) { + private void startAutopilot(boolean isRestart, int leaveIndex) { - if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().getAutopilotAbilityStatus()){ + if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().getAutopilotAbilityStatus()) { ToastUtils.showLong(OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason() + ", 请稍候重试"); triggerUnableStartAPReasonEvent(); return; } - firstStartAutopilot ++; + firstStartAutopilot++; triggerStartServiceEvent(isRestart, false); @@ -571,9 +569,9 @@ public class BusOrderModel { CallerAutoPilotManager.INSTANCE.startAutoPilot(parameters); - CallerLogger.INSTANCE.d( M_BUS + TAG, "行程日志-开启自动驾驶====" + GsonUtil.jsonFromObject(parameters) - +" startLatLon="+parameters.startName+",endLatLon="+parameters.endName + - "isRestart = " + isRestart); + CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-开启自动驾驶====" + GsonUtil.jsonFromObject(parameters) + + " startLatLon=" + parameters.startName + ",endLatLon=" + parameters.endName + + "isRestart = " + isRestart); if (mControllerStatusCallback != null) { mControllerStatusCallback.startOpenAutopilot(); @@ -583,21 +581,21 @@ public class BusOrderModel { /** * 到站查询核销乘客 */ - public void queryPassengerWriteOff(){ - if ( backgroundCurrentStationIndex > stationList.size() - 1 ) { //到站短时间内调用多次 - CallerLogger.INSTANCE.e( M_BUS + TAG, "数组越界" ); + public void queryPassengerWriteOff() { + if (backgroundCurrentStationIndex > stationList.size() - 1) { //到站短时间内调用多次 + CallerLogger.INSTANCE.e(M_BUS + TAG, "数组越界"); return; } BusServiceManager.queryStationWriteOffPassengers(mContext, currentTaskId, stationList.get(backgroundCurrentStationIndex).getSiteId(), prePassengerWriteOffTime, - new OchCommonServiceCallback(){ + new OchCommonServiceCallback() { @Override public void onSuccess(BusQueryWriteOffPassengersResponse o) { - if (o.code !=0 || o.data == null || o.data.isEmpty()){ - return; + if (o.code != 0 || o.data == null || o.data.isEmpty()) { + return; } List passengers = o.data; playWriteOffPassengersMsg(passengers); @@ -611,21 +609,21 @@ public class BusOrderModel { } private void playWriteOffPassengersMsg(List passengers) { - for (int i=0; i< passengers.size();i++){ + for (int i = 0; i < passengers.size(); i++) { WriteOffPassenger passenger = passengers.get(i); - CallerLogger.INSTANCE.e( M_BUS + TAG, "size = " + passenger.passengerSize+ - " time = "+passenger.writeOffTime); + CallerLogger.INSTANCE.e(M_BUS + TAG, "size = " + passenger.passengerSize + + " time = " + passenger.writeOffTime); prePassengerWriteOffTime = passenger.writeOffTime; - if (mPassengerCallback != null){ + if (mPassengerCallback != null) { mPassengerCallback.playPassenger(passenger); } } } - private void startOrStopQueryPassengerWriteOff(boolean isStart){ - if (isStart){ + private void startOrStopQueryPassengerWriteOff(boolean isStart) { + if (isStart) { BusModelLoopManager.getInstance().startQueryPassengerWriteOffLoop(); - }else { + } else { prePassengerWriteOffTime = 0; SoundPoolHelper.getSoundPoolHelper().releaseSoundPool(); BusModelLoopManager.getInstance().stopQueryPassengerWriteOffLoop(); @@ -636,26 +634,26 @@ public class BusOrderModel { * 到站后重置站点状态 */ private void arriveSiteStation() { - if ( backgroundCurrentStationIndex +1 > stationList.size() - 1 ) { //到站短时间内调用多次 - CallerLogger.INSTANCE.e( M_BUS + TAG, "数组越界" ); + if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) { //到站短时间内调用多次 + CallerLogger.INSTANCE.e(M_BUS + TAG, "数组越界"); return; } int arrivedStationIndex = backgroundCurrentStationIndex + 1; String arriveStation = stationList.get(arrivedStationIndex).getName(); String departureStopName = stationList.get(backgroundCurrentStationIndex).getName(); - CallerLogger.INSTANCE.d(M_BUS + TAG,"arriveSiteStation-currentStationIndex = "+ arrivedStationIndex); + CallerLogger.INSTANCE.d(M_BUS + TAG, "arriveSiteStation-currentStationIndex = " + arrivedStationIndex); - BusServiceManager.arriveSiteStation(mContext , + BusServiceManager.arriveSiteStation(mContext, stationList.get(arrivedStationIndex).getSeq(), stationList.get(arrivedStationIndex).getSiteId(), - currentTaskId , + currentTaskId, new OchCommonServiceCallback() { @Override public void onSuccess(BaseData o) { - CallerLogger.INSTANCE.d(M_BUS + TAG,"行程日志-arriveSiteStation success"); + CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-arriveSiteStation success"); queryBusRoutes(); - arriveStationSuccess(arrivedStationIndex,departureStopName,arriveStation); + arriveStationSuccess(arrivedStationIndex, departureStopName, arriveStation); //5s轮询核销乘客 startOrStopQueryPassengerWriteOff(true); @@ -665,10 +663,10 @@ public class BusOrderModel { public void onFail(int code, String failMsg) { isArrivedStation = false; isGoingToNextStation = true; - if (ToastUtilsOch.isCustomFastClick(5000)){ + if (ToastUtilsOch.isCustomFastClick(5000)) { if (!NetworkUtils.isConnected(mContext)) { ToastUtils.showShort("网络异常,请稍后重试"); - }else { + } else { ToastUtils.showShort(failMsg); } } @@ -676,18 +674,18 @@ public class BusOrderModel { }); } - private void arriveStationSuccess(int arrivedStationIndex,String departureStopName,String arriveStation) { - if (busRoutesResult != null){ + private void arriveStationSuccess(int arrivedStationIndex, String departureStopName, String arriveStation) { + if (busRoutesResult != null) { boolean isLastStop = false; - if (arrivedStationIndex == busRoutesResult.getSites().size() - 1 ){ + if (arrivedStationIndex == busRoutesResult.getSites().size() - 1) { isLastStop = true; } //给bus外屏发送 BusSendTripInfoManager.INSTANCE.sendBusTripInfo(BusSendTripInfoManager.ARRIVE_STATION , busRoutesResult.getName() - ,departureStopName - ,arriveStation - ,isLastStop); + , departureStopName + , arriveStation + , isLastStop); } VoiceNotice.showNotice(String.format(mContext @@ -698,10 +696,10 @@ public class BusOrderModel { /** * 离站上报 */ - public void leaveStation(){ - CallerLogger.INSTANCE.d(M_BUS + TAG,"leaveStation-backgroundCurrentStationIndex = "+backgroundCurrentStationIndex); + public void leaveStation() { + CallerLogger.INSTANCE.d(M_BUS + TAG, "leaveStation-backgroundCurrentStationIndex = " + backgroundCurrentStationIndex); String nextStationName = ""; - if (backgroundCurrentStationIndex < stationList.size() - 1){ + if (backgroundCurrentStationIndex < stationList.size() - 1) { nextStationName = stationList.get(backgroundCurrentStationIndex + 1).getName(); } final String currentStationName = stationList.get(backgroundCurrentStationIndex).getName(); @@ -714,18 +712,19 @@ public class BusOrderModel { @Override public void onSuccess(BaseData o) { isArrivedStation = false; - CallerLogger.INSTANCE.d( M_BUS + TAG, "行程日志-离站成功开往下一站====" ); + CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-离站成功开往下一站===="); //需要更改当前站和下一站的状态 然后渲染 - startOrStopQueryPassengerWriteOff(false); - queryBusRoutes(); - leaveStationSuccess(backgroundCurrentStationIndex,currentStationName,finalNextStationName); + startOrStopQueryPassengerWriteOff(false); + queryBusRoutes(); + leaveStationSuccess(backgroundCurrentStationIndex, currentStationName, finalNextStationName); } + @Override public void onFail(int code, String failMsg) { if (!NetworkUtils.isConnected(mContext)) { ToastUtils.showShort("网络异常,请稍后重试"); - }else{ - ToastUtils.showShort("离站上报失败:"+failMsg); + } else { + ToastUtils.showShort("离站上报失败:" + failMsg); } } }); @@ -735,7 +734,7 @@ public class BusOrderModel { private void leaveTTSTips(String nextStation) { VoiceNotice.showNotice(String.format(mContext .getString(R.string.bus_leave_station_tip), - nextStation),DELAY_10S); + nextStation), DELAY_10S); } /** @@ -754,7 +753,7 @@ public class BusOrderModel { * 开启自动驾驶到下一站 */ public void autoDriveToNextStation() { - if ( backgroundCurrentStationIndex >= stationList.size() - 1 ) { + if (backgroundCurrentStationIndex >= stationList.size() - 1) { // 当前站是最后一站,结束当前行程 travelOver(); return; @@ -766,6 +765,7 @@ public class BusOrderModel { * 渲染站点信息 * 服务端返回的OchBusRoutesResult逻辑, 离开站为当前站, 到达下一站后才会将下一站置为当前站, * 车机端展示 三站: 中间为即将到到达或者刚到达的站 + * * @param result */ private void updateBusStatus(BusRoutesResult result) { @@ -775,20 +775,20 @@ public class BusOrderModel { currentTaskId = result.getTaskId(); currentLineId = result.getLineId(); stationList.clear(); - stationList.addAll( site ); + stationList.addAll(site); - for ( int i = 0; i < stationList.size(); i++ ) { - BusStationBean s = stationList.get( i ); + for (int i = 0; i < stationList.size(); i++) { + BusStationBean s = stationList.get(i); - CallerLogger.INSTANCE.d( M_BUS + "updateBusStationsStatus--", - "Index="+ i+" ,name = "+s.getName()+" ,"+s.isLeaving()+","+s.getDrivingStatus()); + CallerLogger.INSTANCE.d(M_BUS + "updateBusStationsStatus--", + "Index=" + i + " ,name = " + s.getName() + " ," + s.isLeaving() + "," + s.getDrivingStatus()); // 是否正在开往下一站 - if ( s.isLeaving()) { + if (s.isLeaving()) { isGoingToNextStation = true; } // 当前站点信息 - if (s.getDrivingStatus() == STATION_STATUS_STOPPED ) { + if (s.getDrivingStatus() == STATION_STATUS_STOPPED) { backgroundCurrentStationIndex = i; break; } @@ -796,40 +796,40 @@ public class BusOrderModel { if (backgroundCurrentStationIndex == 0 && stationList.get(0).getDrivingStatus() == STATION_STATUS_STOPPED - && !stationList.get(0).isLeaving()){ //默认是第一站到站查询 - if (busRoutesResult != null){ // 第一站到站也是行程开始的时候 + && !stationList.get(0).isLeaving()) { //默认是第一站到站查询 + if (busRoutesResult != null) { // 第一站到站也是行程开始的时候 BusSendTripInfoManager.INSTANCE.sendBusTripInfo(BusSendTripInfoManager.START_TRIP - ,busRoutesResult.getName(),"","",false); + , busRoutesResult.getName(), "", "", false); } startOrStopQueryPassengerWriteOff(true); } BusStationBean currentStation = stationList.get(backgroundCurrentStationIndex); - CallerLogger.INSTANCE.d( M_BUS + TAG, + CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-STATION_STATUS_STOPPED-backgroundCurrentStationIndex=" - +backgroundCurrentStationIndex - +" isLeaving()="+currentStation.isLeaving()); + + backgroundCurrentStationIndex + + " isLeaving()=" + currentStation.isLeaving()); // 美化是否开始 if (FunctionBuildConfig.isDemoMode && (backgroundCurrentStationIndex >= 0 - && backgroundCurrentStationIndex <= stationList.size()-1)){//行驶过程中设置美化 - if (stationList.get(backgroundCurrentStationIndex).isLeaving()){ + && backgroundCurrentStationIndex <= stationList.size() - 1)) {//行驶过程中设置美化 + if (stationList.get(backgroundCurrentStationIndex).isLeaving()) { startBeautificationMode(); CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:置为true(每次滑动出发)"); - }else if (backgroundCurrentStationIndex >0 && backgroundCurrentStationIndex < stationList.size()-1){ + } else if (backgroundCurrentStationIndex > 0 && backgroundCurrentStationIndex < stationList.size() - 1) { //美化模式下 中间站点到站 引导线要一直绘制,所以此处不出强制绘制不传false CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false); CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:false(到达中间站)"); clearStartAutopilotTag(); - }else{ + } else { closeBeautificationMode(); clearStartAutopilotTag(); } } - if ( currentStation.isLeaving() && slidePanelHideCallback != null) { + if (currentStation.isLeaving() && slidePanelHideCallback != null) { slidePanelHideCallback.hideSlidePanel(); } @@ -850,8 +850,8 @@ public class BusOrderModel { CallerAutoPilotManager.INSTANCE.setIPCDemoMode(true); } - public void clearBusStationDatas(){ - if (refreshBusStationsCallback != null){ + public void clearBusStationDatas() { + if (refreshBusStationsCallback != null) { refreshBusStationsCallback.clearBusStationsMarkers(); } } @@ -860,19 +860,19 @@ public class BusOrderModel { * 延时查询站点信心 */ private void queryBusStationDelay() { - handler.sendEmptyMessageDelayed( MSG_QUERY_BUS_STATION, QUERY_BUS_STATION_DELAY ); + handler.sendEmptyMessageDelayed(MSG_QUERY_BUS_STATION, QUERY_BUS_STATION_DELAY); } /** * 在踩刹车、控制方向盘等操作后,会停止自动驾驶,重启自动驾驶的话相当于重新设置自动驾驶目的地 */ public void restartAutopilot() { - CallerLogger.INSTANCE.d( M_BUS + TAG, "行程日志-重启自动驾驶===" + isGoingToNextStation ); + CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-重启自动驾驶===" + isGoingToNextStation); //只去启动自动驾驶,不再去上报离站 - startAutopilot(firstStartAutopilot >= 1,-1); + startAutopilot(firstStartAutopilot >= 1, -1); } - public boolean isRestartAutopilot(){ + public boolean isRestartAutopilot() { return firstStartAutopilot > 1; } @@ -881,11 +881,11 @@ public class BusOrderModel { */ private void travelOver() { - if ( backgroundCurrentStationIndex >= stationList.size() ) { - CallerLogger.INSTANCE.e( M_BUS + TAG, "travel over index out of station list" ); + if (backgroundCurrentStationIndex >= stationList.size()) { + CallerLogger.INSTANCE.e(M_BUS + TAG, "travel over index out of station list"); return; } - CallerLogger.INSTANCE.d( M_BUS + TAG, "单程结束====" ); + CallerLogger.INSTANCE.d(M_BUS + TAG, "单程结束===="); CallerAutoPilotManager.INSTANCE.cancelAutoPilot(); endTask(); @@ -895,13 +895,13 @@ public class BusOrderModel { * task正常结束 */ private void endTask() { - CallerLogger.INSTANCE.d( M_BUS + TAG, "任务正常走完endTask()"); + CallerLogger.INSTANCE.d(M_BUS + TAG, "任务正常走完endTask()"); BusServiceManager.endTask(mContext, currentTaskId , new OchCommonServiceCallback() { @Override public void onSuccess(BaseData o) { CallerLogger.INSTANCE.d(M_BUS + TAG, "endTask success: " + o); - if (o.code == 0){ + if (o.code == 0) { endOrAbortTaskSuccess(); clearBusStationDatas(); queryBusRoutes();// 重新获取任务 @@ -919,28 +919,29 @@ public class BusOrderModel { /** * 到站 + * * @param data */ - public void onArriveAt( MessagePad.ArrivalNotification data){ - if ( backgroundCurrentStationIndex +1 > stationList.size() - 1 ) { - CallerLogger.INSTANCE.e( M_BUS + TAG, "行程日志-到站异常,取消后续操作结束" ); + public void onArriveAt(MessagePad.ArrivalNotification data) { + if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) { + CallerLogger.INSTANCE.e(M_BUS + TAG, "行程日志-到站异常,取消后续操作结束"); return; } //MAP 280 每隔100ms左右返回一次到站, 导致在到达中间站后再次滑动出发后会有时间差,收到一次到站,出现问题 //此处比对 自驾告诉的到站站点坐标和本地应到站站点坐标, 一致时才能到站 - if (data != null && data.getEndLocation() != null){ + if (data != null && data.getEndLocation() != null) { - String latitude = NumberFormatUtil.cutOutNumber(data.getEndLocation().getLatitude(),5); //wgs - String longitude = NumberFormatUtil.cutOutNumber(data.getEndLocation().getLongitude(),5); + String latitude = NumberFormatUtil.cutOutNumber(data.getEndLocation().getLatitude(), 5); //wgs + String longitude = NumberFormatUtil.cutOutNumber(data.getEndLocation().getLongitude(), 5); int arrivedStationIndex = backgroundCurrentStationIndex + 1; BusStationBean arriveStation = stationList.get(arrivedStationIndex); - String arriveLat = NumberFormatUtil.cutOutNumber(arriveStation.getLat(),5); - String arriveLon = NumberFormatUtil.cutOutNumber(arriveStation.getLon(),5); + String arriveLat = NumberFormatUtil.cutOutNumber(arriveStation.getLat(), 5); + String arriveLon = NumberFormatUtil.cutOutNumber(arriveStation.getLon(), 5); - if (!latitude.equals(arriveLat) || !longitude.equals(arriveLon)){ - CallerLogger.INSTANCE.e( M_BUS + TAG, "行程日志-到站拦截,到站坐标不一致" ); + if (!latitude.equals(arriveLat) || !longitude.equals(arriveLon)) { + CallerLogger.INSTANCE.e(M_BUS + TAG, "行程日志-到站拦截,到站坐标不一致"); return; } } @@ -948,7 +949,7 @@ public class BusOrderModel { if (isArrivedStation) return; isArrivedStation = true; - CallerLogger.INSTANCE.d( M_BUS + TAG, "行程日志-当前==backgroundCurrentStationIndex=" + CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-当前==backgroundCurrentStationIndex=" + backgroundCurrentStationIndex); isGoingToNextStation = false; @@ -987,25 +988,25 @@ public class BusOrderModel { // 登出 public void logout() { - loginService.loginOut(mLatitude,mLongitude); + loginService.loginOut(mLatitude, mLongitude); } public void triggerStartServiceEvent(boolean isRestart, boolean send) { - if (stationList == null || backgroundCurrentStationIndex >= stationList.size()-1) { + if (stationList == null || backgroundCurrentStationIndex >= stationList.size() - 1) { return; } - BusStationBean currentStation = stationList.get( backgroundCurrentStationIndex); - BusStationBean nextStation = stationList.get( backgroundCurrentStationIndex +1); + BusStationBean currentStation = stationList.get(backgroundCurrentStationIndex); + BusStationBean nextStation = stationList.get(backgroundCurrentStationIndex + 1); BusAnalyticsManager.getInstance().triggerStartAutopilotEvent(isRestart, send, currentStation.getName(), nextStation.getName(), currentLineId); } public void triggerUnableStartAPReasonEvent() { - if (stationList == null || backgroundCurrentStationIndex >= stationList.size()-1) { + if (stationList == null || backgroundCurrentStationIndex >= stationList.size() - 1) { return; } - BusStationBean currentStation = stationList.get( backgroundCurrentStationIndex); - BusStationBean nextStation = stationList.get( backgroundCurrentStationIndex +1); + BusStationBean currentStation = stationList.get(backgroundCurrentStationIndex); + BusStationBean nextStation = stationList.get(backgroundCurrentStationIndex + 1); BusAnalyticsManager.getInstance().triggerUnableStartAPReasonEvent( currentStation.getName(), nextStation.getName(), currentLineId, OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason()); @@ -1025,7 +1026,7 @@ public class BusOrderModel { private void updateAutopilotControlParameters() { AutopilotControlParameters parameters = initAutopilotControlParameters(-1); - if (null == parameters){ + if (null == parameters) { CallerLogger.INSTANCE.e(M_BUS + TAG, "AutopilotControlParameters is empty."); return; } @@ -1033,7 +1034,7 @@ public class BusOrderModel { CallerAutoPilotStatusListenerManager.INSTANCE.updateAutopilotControlParameters(parameters); } - private void clearAutopilotControlParameters(){ + private void clearAutopilotControlParameters() { CallerLogger.INSTANCE.d(M_BUS + TAG, "AutopilotControlParameters is clear."); CallerAutoPilotStatusListenerManager.INSTANCE.updateAutopilotControlParameters(null); } @@ -1042,20 +1043,20 @@ public class BusOrderModel { BusStationBean currentStation = null; BusStationBean nextStation = null; - if (leaveIndex < 0){ - if (backgroundCurrentStationIndex +1 > stationList.size() - 1 || !isGoingToNextStation){ + if (leaveIndex < 0) { + if (backgroundCurrentStationIndex + 1 > stationList.size() - 1 || !isGoingToNextStation) { CallerLogger.INSTANCE.e(M_BUS + TAG, "行程日志-mismatch condition1."); return null; } - currentStation = stationList.get( backgroundCurrentStationIndex); - nextStation = stationList.get( backgroundCurrentStationIndex + 1); - }else { - if (leaveIndex +1 > stationList.size() - 1 || !isGoingToNextStation){ + currentStation = stationList.get(backgroundCurrentStationIndex); + nextStation = stationList.get(backgroundCurrentStationIndex + 1); + } else { + if (leaveIndex + 1 > stationList.size() - 1 || !isGoingToNextStation) { CallerLogger.INSTANCE.e(M_BUS + TAG, "行程日志-mismatch condition2."); return null; } - currentStation = stationList.get( leaveIndex); - nextStation = stationList.get( leaveIndex + 1); + currentStation = stationList.get(leaveIndex); + nextStation = stationList.get(leaveIndex + 1); } AutopilotControlParameters parameters = new AutopilotControlParameters(); @@ -1064,9 +1065,9 @@ public class BusOrderModel { parameters.startName = PinYinUtil.getPinYinHeadChar(currentStation.getName()); parameters.endName = PinYinUtil.getPinYinHeadChar(nextStation.getName()); parameters.startLatLon = new AutopilotControlParameters - .AutoPilotLonLat( currentStation.getLat(), currentStation.getLon() ); + .AutoPilotLonLat(currentStation.getLat(), currentStation.getLon()); parameters.endLatLon = new AutopilotControlParameters - .AutoPilotLonLat( nextStation.getLat(), nextStation.getLon() ); + .AutoPilotLonLat(nextStation.getLat(), nextStation.getLon()); parameters.vehicleType = VEHICLE_TYPE; if (parameters.autoPilotLine == null) { parameters.autoPilotLine = new AutopilotControlParameters.AutoPilotLine( diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/ui/BusSwitchLineActivity.kt b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/ui/BusSwitchLineActivity.kt index bc2ebdf0c3..57d37c2805 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/ui/BusSwitchLineActivity.kt +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/ui/BusSwitchLineActivity.kt @@ -10,7 +10,6 @@ import android.widget.ImageView import android.widget.TextView import androidx.constraintlayout.widget.ConstraintLayout import androidx.recyclerview.widget.LinearLayoutManager -import androidx.recyclerview.widget.PagerSnapHelper import androidx.recyclerview.widget.RecyclerView import com.mogo.commons.mvp.MvpActivity import com.mogo.eagle.core.utilcode.util.SharedPrefs @@ -18,7 +17,7 @@ import com.mogo.och.bus.presenter.BusLinePresenter import com.mogo.och.bus.ui.adapter.SwitchLineAdapter import com.mogo.och.bus.bean.BusQueryLinesResponse import com.mogo.och.bus.ui.adapter.OpenItemAnimator -import com.mogo.module.common.view.SpacesItemDecoration +import com.mogo.eagle.core.utilcode.mogo.view.SpacesItemDecoration import com.mogo.eagle.core.utilcode.util.ToastUtils import com.mogo.och.bus.R import com.mogo.och.bus.bean.BusQueryLineTaskResponse @@ -74,7 +73,11 @@ class BusSwitchLineActivity : MvpActivity mLinesListView.setLayoutManager(linearLayoutManager) mLinesListView.setItemAnimator(OpenItemAnimator()) mAdapter = SwitchLineAdapter(applicationContext, mData) - mLinesListView.addItemDecoration(SpacesItemDecoration(4)) + mLinesListView.addItemDecoration( + SpacesItemDecoration( + 4 + ) + ) mLinesListView.setAdapter(mAdapter) //设置item 点击事件 mAdapter.setOnLineItemClickListener(object :SwitchLineAdapter.LineItemClickListener{ diff --git a/OCH/mogo-och-common-module/build.gradle b/OCH/mogo-och-common-module/build.gradle index 25fe5914f5..41c0d2ad9b 100644 --- a/OCH/mogo-och-common-module/build.gradle +++ b/OCH/mogo-och-common-module/build.gradle @@ -64,6 +64,7 @@ dependencies { implementation rootProject.ext.dependencies.mogo_core_data implementation rootProject.ext.dependencies.mogo_core_function_call implementation rootProject.ext.dependencies.mogo_core_function_v2x + implementation rootProject.ext.dependencies.mogo_core_function_hmi }else { implementation project(":core:mogo-core-utils") implementation project(":foudations:mogo-commons") @@ -71,6 +72,7 @@ dependencies { implementation project(':core:mogo-core-data') implementation project(':core:mogo-core-function-call') implementation project(':core:function-impl:mogo-core-function-v2x') + implementation project(':core:function-impl:mogo-core-function-hmi') } implementation project(':libraries:mogo-adas') diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/OCHCommitDialog.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/OCHCommitDialog.kt index 1e0fde8d5f..a9a27faf36 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/OCHCommitDialog.kt +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/OCHCommitDialog.kt @@ -3,7 +3,7 @@ package com.mogo.och.common.module.wigets import android.content.Context import android.widget.TextView import androidx.lifecycle.LifecycleObserver -import com.mogo.module.common.dialog.BaseFloatDialog +import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog import com.mogo.och.common.module.R /** diff --git a/OCH/mogo-och-noop/src/main/java/com/mogo/och/bus/MogoOCHNoop.java b/OCH/mogo-och-noop/src/main/java/com/mogo/och/bus/MogoOCHNoop.java index 431a3a1992..b55de4fa57 100644 --- a/OCH/mogo-och-noop/src/main/java/com/mogo/och/bus/MogoOCHNoop.java +++ b/OCH/mogo-och-noop/src/main/java/com/mogo/och/bus/MogoOCHNoop.java @@ -7,8 +7,8 @@ import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentActivity; import com.alibaba.android.arouter.facade.annotation.Route; -import com.mogo.service.statusmanager.IMogoStatusChangedListener; -import com.mogo.service.statusmanager.StatusDescriptor; +import com.mogo.commons.module.status.IMogoStatusChangedListener; +import com.mogo.commons.module.status.StatusDescriptor; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/SweeperProvider.java b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/SweeperProvider.java index 193a8a9bee..0db6a47aff 100644 --- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/SweeperProvider.java +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/SweeperProvider.java @@ -8,13 +8,13 @@ import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentActivity; import com.alibaba.android.arouter.facade.annotation.Route; +import com.mogo.commons.module.status.IMogoStatusChangedListener; +import com.mogo.commons.module.status.MogoStatusManager; +import com.mogo.commons.module.status.StatusDescriptor; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.map.MogoMapUIController; -import com.mogo.module.common.MogoApisHandler; import com.mogo.och.sweeper.constant.SweeperConst; import com.mogo.och.sweeper.fragment.SweeperFragment; -import com.mogo.service.statusmanager.IMogoStatusChangedListener; -import com.mogo.service.statusmanager.StatusDescriptor; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -44,7 +44,7 @@ public class SweeperProvider implements IMogoOCH { @Override public void init(Context context) { - MogoApisHandler.getInstance().getApis().getStatusManagerApi().registerStatusChangedListener("OchSweeper" + MogoStatusManager.getInstance().registerStatusChangedListener("OchSweeper" , StatusDescriptor.VR_MODE, statusChangedListener); } @@ -75,7 +75,7 @@ public class SweeperProvider implements IMogoOCH { } else { hideFragment(); } - } else if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) { + } else if (MogoStatusManager.getInstance().isVrMode()) { // topView进行展示时推出网约车界面,但是不隐藏整个fragment if (sweeperFragment != null && isTrue) { sweeperFragment.hideOchSweeper(); diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/fragment/BaseSweeperTabFragment.java b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/fragment/BaseSweeperTabFragment.java index 552523aaa0..e82be6de13 100644 --- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/fragment/BaseSweeperTabFragment.java +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/fragment/BaseSweeperTabFragment.java @@ -20,10 +20,12 @@ import androidx.constraintlayout.widget.Group; import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.debug.DebugConfig; +import com.mogo.commons.module.intent.IntentManager; import com.mogo.commons.mvp.IView; import com.mogo.commons.mvp.MvpFragment; import com.mogo.commons.mvp.Presenter; import com.mogo.eagle.core.data.config.HmiBuildConfig; +import com.mogo.eagle.core.data.constants.DataTypes; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; @@ -32,6 +34,7 @@ import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager; import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; import com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; +import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener; import com.mogo.eagle.core.utilcode.util.ToastUtils; import com.mogo.eagle.core.utilcode.util.UiThreadHandler; import com.mogo.map.MogoMapUIController; @@ -39,8 +42,6 @@ import com.mogo.map.MogoMarkerManager; import com.mogo.map.listener.IMogoMapListener; import com.mogo.map.uicontroller.VisualAngleMode; import com.mogo.module.common.MogoApisHandler; -import com.mogo.module.common.constants.DataTypes; -import com.mogo.module.common.view.OnPreventFastClickListener; import com.mogo.och.sweeper.R; import com.mogo.och.sweeper.bean.SweeperRoutesResult; import com.mogo.och.sweeper.constant.SweeperConst; @@ -74,7 +75,7 @@ public abstract class BaseSweeperTabFragment * START */ private View busTestBar; diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/model/SweeperOrderModel.java b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/model/SweeperOrderModel.java index acf237e086..46958b0642 100644 --- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/model/SweeperOrderModel.java +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/model/SweeperOrderModel.java @@ -15,6 +15,9 @@ import com.elegant.network.utils.GsonUtil; import com.mogo.cloud.commons.utils.CoordinateUtils; import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.debug.DebugConfig; +import com.mogo.commons.module.status.IMogoStatusChangedListener; +import com.mogo.commons.module.status.MogoStatusManager; +import com.mogo.commons.module.status.StatusDescriptor; import com.mogo.commons.voice.AIAssist; import com.mogo.eagle.core.data.BaseData; import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters; @@ -47,8 +50,6 @@ import com.mogo.och.sweeper.util.SweeperAnalyticsManager; import com.mogo.och.sweeper.util.SweeperTrajectoryManager; import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil; import com.mogo.och.common.module.utils.PinYinUtil; -import com.mogo.service.statusmanager.IMogoStatusChangedListener; -import com.mogo.service.statusmanager.StatusDescriptor; import com.zhjt.service.chain.ChainLog; import com.zhjt.service.chain.TracingConstants; @@ -64,7 +65,7 @@ import mogo.telematics.pad.MessagePad; /** * @author congtaowang * @since 2021/3/23 - * + *

* 小巴订单管理 */ public class SweeperOrderModel { @@ -101,21 +102,18 @@ public class SweeperOrderModel { private volatile boolean isArrivedStation = false; - private final Handler handler = new Handler(new Handler.Callback() { - @Override - public boolean handleMessage(Message msg) { - if ( msg.what == MSG_QUERY_BUS_STATION ) { - SweeperOrderModel.getInstance().querySweeperRoutes(); - return true; - } - return false; + private final Handler handler = new Handler(msg -> { + if (msg.what == MSG_QUERY_BUS_STATION) { + SweeperOrderModel.getInstance().querySweeperRoutes(); + return true; } + return false; }); public static SweeperOrderModel getInstance() { - if ( sInstance == null ) { - synchronized ( SweeperOrderModel.class ) { - if ( sInstance == null ) { + if (sInstance == null) { + synchronized (SweeperOrderModel.class) { + if (sInstance == null) { sInstance = new SweeperOrderModel(); } } @@ -136,10 +134,7 @@ public class SweeperOrderModel { .getApis() .getRegisterCenterApi() .registerCarLocationChangedListener(TAG, mCarLocationChangedListener2); - MogoApisHandler.getInstance() - .getApis() - .getStatusManagerApi() - .registerStatusChangedListener( TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener ); + MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener); //自动驾驶路线规划接口 CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG, moGoAutopilotPlanningListener); @@ -154,45 +149,45 @@ public class SweeperOrderModel { public void accept(Throwable e) { if (e instanceof UndeliverableException) { e = e.getCause(); - CallerLogger.INSTANCE.d(M_BUS + TAG,"UndeliverableException"); + CallerLogger.INSTANCE.d(M_BUS + TAG, "UndeliverableException"); } if ((e instanceof IOException)) {// // fine, irrelevant network problem or API that throws on cancellation - CallerLogger.INSTANCE.d(M_BUS + TAG,"IOException"); + CallerLogger.INSTANCE.d(M_BUS + TAG, "IOException"); return; } if (e instanceof InterruptedException) { // fine, some blocking code was interrupted by a dispose call - CallerLogger.INSTANCE.d(M_BUS + TAG,"InterruptedException"); + CallerLogger.INSTANCE.d(M_BUS + TAG, "InterruptedException"); return; } if ((e instanceof NullPointerException) || (e instanceof IllegalArgumentException)) { // that's likely a bug in the application - CallerLogger.INSTANCE.d(M_BUS + TAG,"NullPointerException or IllegalArgumentException"); + CallerLogger.INSTANCE.d(M_BUS + TAG, "NullPointerException or IllegalArgumentException"); Thread.currentThread().getUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), e); return; } if (e instanceof IllegalStateException) { // that's a bug in RxJava or in a custom operator - CallerLogger.INSTANCE.d(M_BUS + TAG,"IllegalStateException"); + CallerLogger.INSTANCE.d(M_BUS + TAG, "IllegalStateException"); Thread.currentThread().getUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), e); return; } - CallerLogger.INSTANCE.d(M_BUS + TAG,"Undeliverable exception"); + CallerLogger.INSTANCE.d(M_BUS + TAG, "Undeliverable exception"); } }); } - public void setCarOperationStatusCallback(ICarOperationStatusCallback callback){ + public void setCarOperationStatusCallback(ICarOperationStatusCallback callback) { this.carOperationStatusCallback = callback; } - public void setRefreshBusStationsCallback(IRefreshSweeperStationsCallback callback){ + public void setRefreshBusStationsCallback(IRefreshSweeperStationsCallback callback) { this.refreshBusStationsCallback = callback; } - public void setSlidePannelHideCallback(ISlidePannelHideCallback callback){ + public void setSlidePannelHideCallback(ISlidePannelHideCallback callback) { this.slidePannelHideCallback = callback; } @@ -209,9 +204,9 @@ public class SweeperOrderModel { @Override public void onAutopilotRotting(MessagePad.GlobalPathResp routeList) { - if (null != routeList && routeList.getWayPointsList().size() > 0){ + if (null != routeList && routeList.getWayPointsList().size() > 0) { points.clear(); - points.addAll(coordinateConverterWgsToGcjList(mContext,routeList.getWayPointsList())); + points.addAll(coordinateConverterWgsToGcjList(mContext, routeList.getWayPointsList())); updateOrderRoute(); } } @@ -234,12 +229,12 @@ public class SweeperOrderModel { * 上报订单全路径规划数据 */ public void updateOrderRoute() { - if (!isGoingToNextStation || backgroundCurrentStationIndex+1 >= stationList.size() || points.size() == 0){ + if (!isGoingToNextStation || backgroundCurrentStationIndex + 1 >= stationList.size() || points.size() == 0) { return; } - SweeperStationBean currentStation = stationList.get( backgroundCurrentStationIndex); - SweeperStationBean nextStation = stationList.get( backgroundCurrentStationIndex +1); + SweeperStationBean currentStation = stationList.get(backgroundCurrentStationIndex); + SweeperStationBean nextStation = stationList.get(backgroundCurrentStationIndex + 1); SweeperServiceManager.getInstance().updateOrderRoute(mContext, currentLineId, currentStation.getSiteId() , nextStation.getSiteId(), points, new ISweeperServiceCallback() { @@ -250,26 +245,22 @@ public class SweeperOrderModel { @Override public void onFail(String failMsg) { - if (isGoingToNextStation){//重试 + if (isGoingToNextStation) {//重试 updateOrderRoute(); } } }); } - public void debugUpdateOrderRoute(List list){ + public void debugUpdateOrderRoute(List list) { points.clear(); - points.addAll(coordinateConverterWgsToGcjList(mContext,list)); + points.addAll(coordinateConverterWgsToGcjList(mContext, list)); updateOrderRoute(); } - public void release(){ + public void release() { startOrStopOrderLoop(false); - MogoApisHandler.getInstance() - .getApis() - .getStatusManagerApi() - .unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener); - + MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener); // 注销到达起始站围栏监听 MogoApisHandler.getInstance() .getApis() @@ -285,7 +276,7 @@ public class SweeperOrderModel { return sInstance; } - private IMogoStatusChangedListener mMogoStatusChangedListener = new IMogoStatusChangedListener() { + private final IMogoStatusChangedListener mMogoStatusChangedListener = new IMogoStatusChangedListener() { // VR mode变更回调 @Override public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) { @@ -301,7 +292,7 @@ public class SweeperOrderModel { private final IMogoCarLocationChangedListener2 mCarLocationChangedListener2 = new IMogoCarLocationChangedListener2() { @Override - public void onCarLocationChanged2( Location location ) { + public void onCarLocationChanged2(Location location) { // CallerLogger.INSTANCE.d(M_BUS + TAG,"location = "+location.getLongitude()+","+location.getLatitude()); mLongitude = location.getLongitude(); mLatitude = location.getLatitude(); @@ -310,7 +301,7 @@ public class SweeperOrderModel { } //是否到站的围栏判断 离站状态并且自动驾驶还未触发到站 - if (isGoingToNextStation && !isArrivedStation){ + if (isGoingToNextStation && !isArrivedStation) { judgeStartStation(location); } } @@ -319,26 +310,26 @@ public class SweeperOrderModel { //根据围栏判断,是否到达起点 private void judgeStartStation(Location location) { - if (backgroundCurrentStationIndex +1 > stationList.size() - 1 ){ + if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) { return; } - SweeperStationBean upcomingStation = stationList.get( backgroundCurrentStationIndex +1); + SweeperStationBean upcomingStation = stationList.get(backgroundCurrentStationIndex + 1); double startLon = upcomingStation.getGcjLon(); double startLat = upcomingStation.getGcjLat(); double distance = CoordinateUtils.calculateLineDistance( startLon, startLat, - location.getLongitude(), location.getLatitude() ); + location.getLongitude(), location.getLatitude()); Logger.i(TAG, "judgeStartStation() distance = " + distance); - if ( distance > SweeperConst.ARRIVE_AT_END_STATION_DISTANCE ) { + if (distance > SweeperConst.ARRIVE_AT_END_STATION_DISTANCE) { distance = CoordinateUtils.calculateLineDistance(startLon, startLat, CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon(), CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat()); } - if ( distance <= SweeperConst.ARRIVE_AT_END_STATION_DISTANCE ) { + if (distance <= SweeperConst.ARRIVE_AT_END_STATION_DISTANCE) { onArriveAt(null); //无自动驾驶到站信息传null return; } @@ -352,15 +343,16 @@ public class SweeperOrderModel { SweeperServiceManager.getInstance().queryBusRoutes(mContext, new ISweeperServiceCallback() { @Override public void onSuccess(SweeperRoutesResponse data) { - if ( data == null + if (data == null || data.getResult() == null || data.getResult().getSites() == null - || data.getResult().getSites().isEmpty() ) { + || data.getResult().getSites().isEmpty()) { return; } - CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据: " + data ); - renderBusStationsStatus( data.getResult()); + CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据: " + data); + renderBusStationsStatus(data.getResult()); } + @Override public void onFail(String failMsg) { // 重复请求小巴路线,直至成功 @@ -374,62 +366,63 @@ public class SweeperOrderModel { * 测试、重置站点状态 */ public void debugResetStationStatus() { - CallerLogger.INSTANCE.d( M_BUS + TAG, "测试、重置站点状态"); + CallerLogger.INSTANCE.d(M_BUS + TAG, "测试、重置站点状态"); SweeperServiceManager.getInstance().resetStationStatus(mContext, currentLineId , new ISweeperServiceCallback() { - @Override - public void onSuccess(SweeperRoutesResponse o) { - CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据: " + o); - isGoingToNextStation = false; - if (o.getResult() == null || o.getResult().getSites() == null || o.getResult().getSites().isEmpty()) { - return; - } - renderBusStationsStatus(o.getResult()); - } + @Override + public void onSuccess(SweeperRoutesResponse o) { + CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据: " + o); + isGoingToNextStation = false; + if (o.getResult() == null || o.getResult().getSites() == null || o.getResult().getSites().isEmpty()) { + return; + } + renderBusStationsStatus(o.getResult()); + } - @Override - public void onFail(String failMsg) { - // 重复请求小巴路线,直至成功 - queryBusStationDelay(); - } - }); + @Override + public void onFail(String failMsg) { + // 重复请求小巴路线,直至成功 + queryBusStationDelay(); + } + }); } /** * 离站上报 */ - public void leaveStation(boolean isOneWayOver,boolean isRestart){ - CallerLogger.INSTANCE.d(M_BUS + TAG,"leaveStation-backgroundCurrentStationIndex = "+backgroundCurrentStationIndex); + public void leaveStation(boolean isOneWayOver, boolean isRestart) { + CallerLogger.INSTANCE.d(M_BUS + TAG, "leaveStation-backgroundCurrentStationIndex = " + backgroundCurrentStationIndex); SweeperServiceManager.getInstance().leaveStation(mContext, stationList.get(backgroundCurrentStationIndex).getSeq() , stationList.get(backgroundCurrentStationIndex).getSiteId(), new ISweeperServiceCallback() { - @Override - public void onSuccess(SweeperRoutesResponse o) { - if ( o.getResult() == null || o.getResult().getSites() == null || o.getResult().getSites().isEmpty() ) { - return; - } - isArrivedStation = false; - if (!isOneWayOver){ - CallerLogger.INSTANCE.d( M_BUS + TAG, "自动驾驶开启开往下一站====" ); - //需要更改当前站和下一站的状态 然后渲染 - leaveStationSuccess(o.getResult(),isRestart); - }else { - CallerLogger.INSTANCE.d( M_BUS + TAG, "单程真的结束了====" ); - isGoingToNextStation = false; - backgroundCurrentStationIndex = 0; - CallerAutoPilotManager.INSTANCE.cancelAutoPilot(); - querySweeperRoutes(); - } - } - @Override - public void onFail(String failMsg) { - if (!NetworkUtils.isConnected(mContext)) { - ToastUtils.showShort("网络异常,请稍后重试"); - }else{ - ToastUtils.showShort("离站上报失败:"+failMsg); - } - } - }); + @Override + public void onSuccess(SweeperRoutesResponse o) { + if (o.getResult() == null || o.getResult().getSites() == null || o.getResult().getSites().isEmpty()) { + return; + } + isArrivedStation = false; + if (!isOneWayOver) { + CallerLogger.INSTANCE.d(M_BUS + TAG, "自动驾驶开启开往下一站===="); + //需要更改当前站和下一站的状态 然后渲染 + leaveStationSuccess(o.getResult(), isRestart); + } else { + CallerLogger.INSTANCE.d(M_BUS + TAG, "单程真的结束了===="); + isGoingToNextStation = false; + backgroundCurrentStationIndex = 0; + CallerAutoPilotManager.INSTANCE.cancelAutoPilot(); + querySweeperRoutes(); + } + } + + @Override + public void onFail(String failMsg) { + if (!NetworkUtils.isConnected(mContext)) { + ToastUtils.showShort("网络异常,请稍后重试"); + } else { + ToastUtils.showShort("离站上报失败:" + failMsg); + } + } + }); } /** @@ -449,11 +442,12 @@ public class SweeperOrderModel { return; } isGoingToNextStation = true; - AIAssist.getInstance( mContext ).speakTTSVoice( "欢迎乘坐’蘑菇车联‘无人驾驶小巴车,请您坐好,注意乘车安全,行程即将开始" ); + AIAssist.getInstance(mContext).speakTTSVoice("欢迎乘坐’蘑菇车联‘无人驾驶小巴车,请您坐好,注意乘车安全,行程即将开始"); } /** * 开启自动驾驶 + * * @param isRestart */ private void startAutopilot(boolean isRestart) { @@ -491,7 +485,7 @@ public class SweeperOrderModel { // } // CallerLogger.INSTANCE.d( M_BUS + TAG, "开启自动驾驶====" + GsonUtil.jsonFromObject(parameters) // +" startLatLon="+currentStation.getName()+",endLatLon="+nextStation.getName()); - CallerLogger.INSTANCE.d( M_BUS + TAG, "开启自动驾驶====" + GsonUtil.jsonFromObject(parameters)); + CallerLogger.INSTANCE.d(M_BUS + TAG, "开启自动驾驶====" + GsonUtil.jsonFromObject(parameters)); CallerAutoPilotManager.INSTANCE.startAutoPilot(parameters); if (mControllerStatusCallback != null) { @@ -503,23 +497,23 @@ public class SweeperOrderModel { * 到站后重置站点状态 */ private void arriveSiteStation(boolean isRestart) { - if ( backgroundCurrentStationIndex +1 > stationList.size() - 1 ) { //到站短时间内调用多次 - CallerLogger.INSTANCE.e( M_BUS + TAG, "数组越界" ); + if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) { //到站短时间内调用多次 + CallerLogger.INSTANCE.e(M_BUS + TAG, "数组越界"); return; } int arrivedStationIndex = 0; - if (!isRestart){ + if (!isRestart) { arrivedStationIndex = backgroundCurrentStationIndex + 1; } - CallerLogger.INSTANCE.d(M_BUS + TAG,"arriveSiteStation-currentStationIndex = "+ arrivedStationIndex); + CallerLogger.INSTANCE.d(M_BUS + TAG, "arriveSiteStation-currentStationIndex = " + arrivedStationIndex); SweeperServiceManager.getInstance().arriveSiteStation(mContext , stationList.get(arrivedStationIndex).getSeq(), stationList.get(arrivedStationIndex).getSiteId() , new ISweeperServiceCallback() { @Override public void onSuccess(BaseData o) { - CallerLogger.INSTANCE.d(M_BUS + TAG,"arriveSiteStation success"); - if (!isRestart){ + CallerLogger.INSTANCE.d(M_BUS + TAG, "arriveSiteStation success"); + if (!isRestart) { renderArriveBusStation(); } } @@ -538,11 +532,11 @@ public class SweeperOrderModel { private void renderArriveBusStation() { List site = sweeperRoutesResult.getSites(); - if (site != null && site.size() > 0){ - backgroundCurrentStationIndex ++; - if (refreshBusStationsCallback != null){ - refreshBusStationsCallback.refreshBusStations(sweeperRoutesResult.getName(),stationList, backgroundCurrentStationIndex - , getNextStopStation(),true); + if (site != null && site.size() > 0) { + backgroundCurrentStationIndex++; + if (refreshBusStationsCallback != null) { + refreshBusStationsCallback.refreshBusStations(sweeperRoutesResult.getName(), stationList, backgroundCurrentStationIndex + , getNextStopStation(), true); } } } @@ -550,7 +544,7 @@ public class SweeperOrderModel { /** * 收车 */ - public void stopTakeOrder(){ + public void stopTakeOrder() { SweeperServiceManager.getInstance().stopTakeOrder(mContext, new ISweeperServiceCallback() { @Override public void onSuccess(BaseData o) { @@ -560,12 +554,13 @@ public class SweeperOrderModel { startOrStopOrderLoop(mIsWorking); SweeperTrajectoryManager.getInstance().stopTrajReqLoop(); } + @Override public void onFail(String failMsg) { if (!NetworkUtils.isConnected(mContext)) { ToastUtils.showShort("网络异常,请稍后重试"); - }else { - ToastUtils.showShort("收车失败:"+failMsg); + } else { + ToastUtils.showShort("收车失败:" + failMsg); } } }); @@ -585,25 +580,26 @@ public class SweeperOrderModel { /** * 出车 */ - public void startTakeOrder(){ + public void startTakeOrder() { SweeperServiceManager.getInstance().startTakeOrder(mContext, new ISweeperServiceCallback() { @Override public void onSuccess(BaseData o) { mIsWorking = !mIsWorking; startOrStopOrderLoop(mIsWorking); - if ( stationList != null && stationList.size() > 0 ) { - AIAssist.getInstance( mContext ).speakTTSVoice( "车辆已整备完毕,请前往" - + stationList.get( backgroundCurrentStationIndex ).getName() + "站点" ); + if (stationList != null && stationList.size() > 0) { + AIAssist.getInstance(mContext).speakTTSVoice("车辆已整备完毕,请前往" + + stationList.get(backgroundCurrentStationIndex).getName() + "站点"); } carOperationStatusCallback.changeOperationStatus(isWorking()); querySweeperRoutes(); } + @Override public void onFail(String failMsg) { if (!NetworkUtils.isConnected(mContext)) { ToastUtils.showShort("网络异常,请稍后重试"); - }else { - ToastUtils.showShort("出车失败:"+failMsg); + } else { + ToastUtils.showShort("出车失败:" + failMsg); } } }); @@ -613,34 +609,35 @@ public class SweeperOrderModel { * 查询运营状态 */ public void queryOperationStatus() { - CallerLogger.INSTANCE.d( M_BUS + TAG, "查询运营状态"); + CallerLogger.INSTANCE.d(M_BUS + TAG, "查询运营状态"); SweeperServiceManager.getInstance().queryOperationStatus(mContext , new ISweeperServiceCallback() { - @Override - public void onSuccess(SweeperOperationStatusResponse o) { - if ( o.data != null ) { - mIsWorking = o.data.serviceStatus == 1; - CallerLogger.INSTANCE.d( M_BUS + TAG, "查询运营状态 result.status: " + o.data.serviceStatus); - startOrStopOrderLoop(mIsWorking); - } - carOperationStatusCallback.changeOperationStatus(isWorking()); - } - @Override - public void onFail(String failMsg) { - if (!NetworkUtils.isConnected(mContext)) { - ToastUtils.showShort("网络异常,请稍后重试"); - }else { - ToastUtils.showShort("出车收车状态查询:"+failMsg); - } + @Override + public void onSuccess(SweeperOperationStatusResponse o) { + if (o.data != null) { + mIsWorking = o.data.serviceStatus == 1; + CallerLogger.INSTANCE.d(M_BUS + TAG, "查询运营状态 result.status: " + o.data.serviceStatus); + startOrStopOrderLoop(mIsWorking); + } + carOperationStatusCallback.changeOperationStatus(isWorking()); + } + + @Override + public void onFail(String failMsg) { + if (!NetworkUtils.isConnected(mContext)) { + ToastUtils.showShort("网络异常,请稍后重试"); + } else { + ToastUtils.showShort("出车收车状态查询:" + failMsg); + } // queryOperationStatus(); - } - }); + } + }); } /** * 开启自动驾驶到下一站 */ - public void autoDriveToNextStation( boolean isRestart ) { + public void autoDriveToNextStation(boolean isRestart) { // if ( backgroundCurrentStationIndex >= stationList.size() - 1 ) { // // 当前站是最后一站,结束当前行程 // travelOver(); @@ -654,6 +651,7 @@ public class SweeperOrderModel { * 渲染站点信息 * 服务端返回的OchBusRoutesResult逻辑, 离开站为当前站, 到达下一站后才会将下一站置为当前站, * 车机端展示 离开站为当前站点,前往站为下一站, 下一站到站后在置为当前站 + * * @param result */ private void renderBusStationsStatus(SweeperRoutesResult result) { @@ -662,19 +660,19 @@ public class SweeperOrderModel { List site = result.getSites(); currentLineId = result.getLineId(); stationList.clear(); - stationList.addAll( site ); - for ( int i = 0; i < stationList.size(); i++ ) { - SweeperStationBean s = stationList.get( i ); + stationList.addAll(site); + for (int i = 0; i < stationList.size(); i++) { + SweeperStationBean s = stationList.get(i); - CallerLogger.INSTANCE.d( M_BUS + "renderBusStationsStatus--", - "Index="+ i+" ,name = "+s.getName()+" ,"+s.isLeaving()+","+s.getDrivingStatus()); + CallerLogger.INSTANCE.d(M_BUS + "renderBusStationsStatus--", + "Index=" + i + " ,name = " + s.getName() + " ," + s.isLeaving() + "," + s.getDrivingStatus()); // 是否正在开往下一站 - if ( s.isLeaving()) { + if (s.isLeaving()) { isGoingToNextStation = true; } // 当前站点信息 - if (s.getDrivingStatus() == STATION_STATUS_STOPPED ) { + if (s.getDrivingStatus() == STATION_STATUS_STOPPED) { backgroundCurrentStationIndex = i; break; } @@ -682,31 +680,31 @@ public class SweeperOrderModel { SweeperStationBean currentStation = stationList.get(backgroundCurrentStationIndex); - CallerLogger.INSTANCE.d( M_BUS + TAG, - "渲染站点信息服务端currentStationIndex="+backgroundCurrentStationIndex - +" isLeaving()="+currentStation.isLeaving()); + CallerLogger.INSTANCE.d(M_BUS + TAG, + "渲染站点信息服务端currentStationIndex=" + backgroundCurrentStationIndex + + " isLeaving()=" + currentStation.isLeaving()); //当前站点是始发站,告诉服务端到达始发站。 如果没有这个节点, 服务器不知道始发站到达状态 // ,订单开始站下在始发站的状态流转有问题 - if (backgroundCurrentStationIndex == 0 && !currentStation.isLeaving()){ + if (backgroundCurrentStationIndex == 0 && !currentStation.isLeaving()) { arriveSiteStation(true); } // 美化是否开始 if (FunctionBuildConfig.isDemoMode && (backgroundCurrentStationIndex >= 0 - && backgroundCurrentStationIndex <= stationList.size()-1) - && stationList.get(backgroundCurrentStationIndex).isLeaving()){//行驶过程中设置美化 + && backgroundCurrentStationIndex <= stationList.size() - 1) + && stationList.get(backgroundCurrentStationIndex).isLeaving()) {//行驶过程中设置美化 FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true; CallerAutoPilotManager.INSTANCE.setIPCDemoMode(true); CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:置为true(每次滑动出发)"); } - if (refreshBusStationsCallback != null){ - refreshBusStationsCallback.refreshBusStations(result.getName(),stationList - , backgroundCurrentStationIndex, getNextStopStation(),!currentStation.isLeaving()); + if (refreshBusStationsCallback != null) { + refreshBusStationsCallback.refreshBusStations(result.getName(), stationList + , backgroundCurrentStationIndex, getNextStopStation(), !currentStation.isLeaving()); } - if ( currentStation.isLeaving() && slidePannelHideCallback != null) { + if (currentStation.isLeaving() && slidePannelHideCallback != null) { slidePannelHideCallback.hideSlidePanel(); } @@ -720,12 +718,12 @@ public class SweeperOrderModel { * @return -1 当前已是最后一个站点 */ private int getNextStopStation() { - if ( backgroundCurrentStationIndex >= stationList.size() - 1 ) { + if (backgroundCurrentStationIndex >= stationList.size() - 1) { return -1; } int nextStationIndex = backgroundCurrentStationIndex + 1; - for ( ; nextStationIndex < stationList.size() - 1; nextStationIndex++ ) { - if ( stationList.get( nextStationIndex ).getIfStop() == 1 ) { + for (; nextStationIndex < stationList.size() - 1; nextStationIndex++) { + if (stationList.get(nextStationIndex).getIfStop() == 1) { break; } break; @@ -737,7 +735,7 @@ public class SweeperOrderModel { * 延时查询站点信心 */ private void queryBusStationDelay() { - handler.sendEmptyMessageDelayed( MSG_QUERY_BUS_STATION, QUERY_BUS_STATION_DELAY ); + handler.sendEmptyMessageDelayed(MSG_QUERY_BUS_STATION, QUERY_BUS_STATION_DELAY); } /** @@ -755,26 +753,26 @@ public class SweeperOrderModel { * * @param awayPassengersResponse */ - private void playLeavePassengersMsg( QueryLeaveAwayPassengersResponse awayPassengersResponse ) { - CallerLogger.INSTANCE.d( M_BUS + TAG, "播报下车乘客信息currentStationIndex=" + private void playLeavePassengersMsg(QueryLeaveAwayPassengersResponse awayPassengersResponse) { + CallerLogger.INSTANCE.d(M_BUS + TAG, "播报下车乘客信息currentStationIndex=" + String.valueOf(backgroundCurrentStationIndex + 1)); - if ( backgroundCurrentStationIndex +1 > stationList.size() - 1 ) { + if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) { return; } - String station = stationList.get( backgroundCurrentStationIndex+1 ).getName(); - StringBuilder builder = new StringBuilder( "已到达" ); - builder.append( station ); - if ( !station.endsWith( "站" ) ) { - builder.append( "站" ); + String station = stationList.get(backgroundCurrentStationIndex + 1).getName(); + StringBuilder builder = new StringBuilder("已到达"); + builder.append(station); + if (!station.endsWith("站")) { + builder.append("站"); } - if ( awayPassengersResponse == null || awayPassengersResponse.data == null - || awayPassengersResponse.data.orders == null || awayPassengersResponse.data.orders.isEmpty() ) { - CallerLogger.INSTANCE.d( M_BUS + TAG, "播报下车乘客信息为null"); + if (awayPassengersResponse == null || awayPassengersResponse.data == null + || awayPassengersResponse.data.orders == null || awayPassengersResponse.data.orders.isEmpty()) { + CallerLogger.INSTANCE.d(M_BUS + TAG, "播报下车乘客信息为null"); } else { - builder.append( ",请尾号为 " ); - for ( QueryLeaveAwayPassengersResponse.LeaveAwayPassenger leaveAwayPassenger : awayPassengersResponse.data.orders ) { - if ( leaveAwayPassenger == null ) { + builder.append(",请尾号为 "); + for (QueryLeaveAwayPassengersResponse.LeaveAwayPassenger leaveAwayPassenger : awayPassengersResponse.data.orders) { + if (leaveAwayPassenger == null) { continue; } String tailNum = null; @@ -784,23 +782,23 @@ public class SweeperOrderModel { e.printStackTrace(); tailNum = leaveAwayPassenger.passengerPhone; } - builder.append( tailNum ).append( "。" ); + builder.append(tailNum).append("。"); } - builder.append( "的乘客下车" ); + builder.append("的乘客下车"); } builder.append(",带好随身物品,下车请注意安全"); CallerLogger.INSTANCE.d(M_BUS + TAG, "TTS:" + builder.toString()); - AIAssist.getInstance( mContext ).speakTTSVoice( builder.toString() ); + AIAssist.getInstance(mContext).speakTTSVoice(builder.toString()); } /** * 修改小巴运营状态 */ public void onChangeOperationStatus() { - CallerLogger.INSTANCE.d( M_BUS + TAG, "修改小巴运营状态"); - if (isWorking()){//收车 + CallerLogger.INSTANCE.d(M_BUS + TAG, "修改小巴运营状态"); + if (isWorking()) {//收车 stopTakeOrder(); - }else {//出车 + } else {//出车 startTakeOrder(); } } @@ -810,14 +808,14 @@ public class SweeperOrderModel { */ private void travelOver() { - if ( backgroundCurrentStationIndex >= stationList.size() ) { - CallerLogger.INSTANCE.e( M_BUS + TAG, "travel over index out of station list" ); + if (backgroundCurrentStationIndex >= stationList.size()) { + CallerLogger.INSTANCE.e(M_BUS + TAG, "travel over index out of station list"); return; } - CallerLogger.INSTANCE.d( M_BUS + TAG, "单程结束====" ); + CallerLogger.INSTANCE.d(M_BUS + TAG, "单程结束===="); CallerAutoPilotManager.INSTANCE.cancelAutoPilot(); - AIAssist.getInstance( mContext ).speakTTSVoice( "感谢您体验'蘑菇车联'无人驾驶小巴车,请您携带好随身物品,我们下次再见" ); - leaveStation(true,true); + AIAssist.getInstance(mContext).speakTTSVoice("感谢您体验'蘑菇车联'无人驾驶小巴车,请您携带好随身物品,我们下次再见"); + leaveStation(true, true); } public boolean isWorking() { @@ -826,9 +824,10 @@ public class SweeperOrderModel { /** * 到站 + * * @param data */ - public void onArriveAt( MessagePad.ArrivalNotification data){ + public void onArriveAt(MessagePad.ArrivalNotification data) { // if ( backgroundCurrentStationIndex +1 > stationList.size() - 1 ) { // CallerLogger.INSTANCE.e( M_BUS + TAG, "到站异常,取消后续操作结束" ); // return; @@ -842,7 +841,7 @@ public class SweeperOrderModel { CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false); CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:置为false(到最后一站)"); } - CallerLogger.INSTANCE.d( M_BUS + TAG, "到站====currentStationIndex=" + backgroundCurrentStationIndex); + CallerLogger.INSTANCE.d(M_BUS + TAG, "到站====currentStationIndex=" + backgroundCurrentStationIndex); isGoingToNextStation = false; // arriveSiteStation(false);//到站上报 @@ -878,11 +877,11 @@ public class SweeperOrderModel { } public void triggerStartServiceEvent(boolean isRestart, boolean send) { - if (stationList == null || backgroundCurrentStationIndex >= stationList.size()-1) { + if (stationList == null || backgroundCurrentStationIndex >= stationList.size() - 1) { return; } - SweeperStationBean currentStation = stationList.get( backgroundCurrentStationIndex); - SweeperStationBean nextStation = stationList.get( backgroundCurrentStationIndex +1); + SweeperStationBean currentStation = stationList.get(backgroundCurrentStationIndex); + SweeperStationBean nextStation = stationList.get(backgroundCurrentStationIndex + 1); SweeperAnalyticsManager.getInstance().triggerStartAutopilotEvent(isRestart, send, currentStation.getName(), nextStation.getName(), currentLineId); } diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/MogoOCHTaxiPassenger.java b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/MogoOCHTaxiPassenger.java index e633e71bb7..7dde2ad9e4 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/MogoOCHTaxiPassenger.java +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/MogoOCHTaxiPassenger.java @@ -8,14 +8,13 @@ import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentActivity; import com.alibaba.android.arouter.facade.annotation.Route; +import com.mogo.commons.module.status.IMogoStatusChangedListener; +import com.mogo.commons.module.status.MogoStatusManager; +import com.mogo.commons.module.status.StatusDescriptor; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; -import com.mogo.eagle.core.utilcode.util.UiThreadHandler; import com.mogo.map.MogoMapUIController; -import com.mogo.module.common.MogoApisHandler; import com.mogo.och.taxi.passenger.constant.TaxiPassengerConst; import com.mogo.och.taxi.passenger.ui.TaxiPassengerBaseFragment; -import com.mogo.service.statusmanager.IMogoStatusChangedListener; -import com.mogo.service.statusmanager.StatusDescriptor; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -27,26 +26,27 @@ public *

* 网约车-出租车-乘客端 */ -@Route( path = TaxiPassengerConst.PATH ) +@Route(path = TaxiPassengerConst.PATH) class MogoOCHTaxiPassenger implements IMogoOCH, IMogoStatusChangedListener { private static final String TAG = "MogoOCHTaxiPassenger"; private TaxiPassengerBaseFragment ochTaxiPassengerFragment; private FragmentActivity mActivity; private int mContainerId; + @Override - public void init( Context context ) { - CallerLogger.INSTANCE.d( M_TAXI_P + TAG, "init" ); - MogoApisHandler.getInstance().getApis().getStatusManagerApi().registerStatusChangedListener("ochTaxi", StatusDescriptor.VR_MODE,this); + public void init(Context context) { + CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "init"); + MogoStatusManager.getInstance().registerStatusChangedListener("ochTaxi", StatusDescriptor.VR_MODE, this); } /** * 进入鹰眼模式,设置手势缩放地图失效 */ private void stepIntoVrMode() { - CallerLogger.INSTANCE.d( M_TAXI_P + TAG, "进入vr模式" ); + CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "进入vr模式"); MogoMapUIController.getInstance() - .stepInVrMode( false ); + .stepInVrMode(false); } private void showFragment() { @@ -60,18 +60,18 @@ class MogoOCHTaxiPassenger implements IMogoOCH, IMogoStatusChangedListener { mActivity.getSupportFragmentManager().beginTransaction().show(ochTaxiPassengerFragment).commitAllowingStateLoss(); } - private void hideFragment(){ - if (ochTaxiPassengerFragment != null){ + private void hideFragment() { + if (ochTaxiPassengerFragment != null) { mActivity.getSupportFragmentManager().beginTransaction().hide(ochTaxiPassengerFragment).commitAllowingStateLoss(); } } @Override public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) { - if (descriptor == StatusDescriptor.VR_MODE){ - if (isTrue){ + if (descriptor == StatusDescriptor.VR_MODE) { + if (isTrue) { showFragment(); - }else { + } else { hideFragment(); } } @@ -101,6 +101,7 @@ class MogoOCHTaxiPassenger implements IMogoOCH, IMogoStatusChangedListener { @Override public void onDestroy() { // 若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠 + MogoStatusManager.getInstance().unregisterStatusChangedListener("ochTaxi", StatusDescriptor.VR_MODE, this); if (mActivity == null) return; mActivity.finish(); } diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.java b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.java index bcbe312e33..23fd508777 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.java +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.java @@ -15,6 +15,11 @@ import com.elegant.network.utils.GsonUtil; import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager; import com.mogo.cloud.commons.utils.CoordinateUtils; import com.mogo.commons.debug.DebugConfig; +import com.mogo.commons.module.intent.IMogoIntentListener; +import com.mogo.commons.module.intent.IntentManager; +import com.mogo.commons.module.status.IMogoStatusChangedListener; +import com.mogo.commons.module.status.MogoStatusManager; +import com.mogo.commons.module.status.StatusDescriptor; import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters; import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo; import com.mogo.eagle.core.data.config.FunctionBuildConfig; @@ -58,9 +63,6 @@ import com.mogo.och.taxi.passenger.constant.TaxiPassengerOrderStatusEnum; import com.mogo.och.taxi.passenger.network.TaxiPassengerServiceManager; import com.mogo.aicloud.services.socket.IMogoLifecycleListener; import com.mogo.och.taxi.passenger.utils.TaxiPassengerAnalyticsManager; -import com.mogo.service.intent.IMogoIntentListener; -import com.mogo.service.statusmanager.IMogoStatusChangedListener; -import com.mogo.service.statusmanager.StatusDescriptor; import org.jetbrains.annotations.NotNull; @@ -229,14 +231,8 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback // 2021.11.1重构自动驾驶 实现接口 IMoGoAutopilotStatusListener 注册监听 替换IMogoAdasOCHCallback接口 CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener); - MogoApisHandler.getInstance() - .getApis() - .getIntentManagerApi() - .registerIntentListener( ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener ); - MogoApisHandler.getInstance() - .getApis() - .getStatusManagerApi() - .registerStatusChangedListener( TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener ); + IntentManager.getInstance().registerIntentListener( ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener ); + MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener); // 达到起始站围栏监听 MogoApisHandler.getInstance() .getApis() @@ -251,10 +247,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback } private void releaseListeners() { - MogoApisHandler.getInstance() - .getApis() - .getStatusManagerApi() - .unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener); + MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener); // 注销到达起始站围栏监听 MogoApisHandler.getInstance() diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerBaseFragment.java b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerBaseFragment.java index 4af679e575..33f545fe1f 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerBaseFragment.java +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerBaseFragment.java @@ -12,7 +12,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.FragmentTransaction; -import com.mogo.commons.AbsMogoApplication; +import com.mogo.commons.module.status.MogoStatusManager; import com.mogo.commons.mvp.MvpFragment; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; import com.mogo.eagle.core.function.api.hmi.IMoGoHmiViewProxy; @@ -20,15 +20,11 @@ import com.mogo.eagle.core.function.api.hmi.view.IViewNotification; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; import com.mogo.eagle.core.function.call.map.CallerSmpManager; -import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.AiRoadMarker; import com.mogo.eagle.core.utilcode.util.OverlayViewUtils; import com.mogo.eagle.core.utilcode.util.UiThreadHandler; import com.mogo.map.MogoMapUIController; -import com.mogo.map.MogoMarkerManager; import com.mogo.map.listener.IMogoMapListener; import com.mogo.map.uicontroller.VisualAngleMode; -import com.mogo.module.common.MogoApisHandler; -import com.mogo.module.common.constants.DataTypes; import com.mogo.och.taxi.passenger.R; import com.mogo.och.taxi.passenger.callback.ITPClickStartAutopilotCallback; import com.mogo.och.taxi.passenger.event.UIStatus; @@ -65,7 +61,7 @@ public class TaxiPassengerBaseFragment extends MvpFragment mStartAutopilotView; protected TaxiPassengerServingOrderFragment ochServingOrderFragment = null; - private Handler mHandler = new Handler(Looper.getMainLooper()); + private final Handler mHandler = new Handler(Looper.getMainLooper()); @Nullable @Override @@ -102,11 +98,7 @@ public class TaxiPassengerBaseFragment extends MvpFragment?) { - BridgeApi.analytics()?.track(eventType, data) + AnalyticsUtils.track(eventType, data) } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-chat/src/main/java/com/mogo/eagle/core/function/chat/facade/bridge/BridgeApi.kt b/core/function-impl/mogo-core-function-chat/src/main/java/com/mogo/eagle/core/function/chat/facade/bridge/BridgeApi.kt index cba2a2e7ec..6e2b441239 100644 --- a/core/function-impl/mogo-core-function-chat/src/main/java/com/mogo/eagle/core/function/chat/facade/bridge/BridgeApi.kt +++ b/core/function-impl/mogo-core-function-chat/src/main/java/com/mogo/eagle/core/function/chat/facade/bridge/BridgeApi.kt @@ -2,17 +2,12 @@ package com.mogo.eagle.core.function.chat.facade.bridge import android.content.Context import com.mogo.eagle.core.utilcode.util.Utils -import com.mogo.module.common.MogoApisHandler import java.lang.ref.WeakReference internal object BridgeApi { private var contextHolder: WeakReference? = null - private val apis by lazy { - MogoApisHandler.getInstance().apis - } - internal fun init(context: Context?) { context?.let { contextHolder = WeakReference(context) @@ -21,13 +16,4 @@ internal object BridgeApi { internal fun context(): Context = contextHolder?.get() ?: Utils.getApp() - internal fun intentManager() = apis?.intentManagerApi - - internal fun statusManager() = apis?.statusManagerApi - - internal fun analytics() = apis?.analyticsApi - - internal fun topViewManager() = apis?.topViewManager - - internal fun floatViewManager() = apis?.windowManagerApi } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-chat/src/main/java/com/mogo/eagle/core/function/chat/facade/ui/CallChatWindowManager.kt b/core/function-impl/mogo-core-function-chat/src/main/java/com/mogo/eagle/core/function/chat/facade/ui/CallChatWindowManager.kt index 02d8a353b6..dc42dbfd5f 100644 --- a/core/function-impl/mogo-core-function-chat/src/main/java/com/mogo/eagle/core/function/chat/facade/ui/CallChatWindowManager.kt +++ b/core/function-impl/mogo-core-function-chat/src/main/java/com/mogo/eagle/core/function/chat/facade/ui/CallChatWindowManager.kt @@ -22,6 +22,7 @@ import com.mogo.eagle.core.function.api.chat.biz.ChatConsts import com.mogo.eagle.core.function.api.chat.biz.HangUpState import com.mogo.eagle.core.function.api.chat.biz.IMoGoVoiceControlFacade.IMoGoVoiceCallback import com.mogo.eagle.core.function.api.chat.biz.RefuseState +import com.mogo.eagle.core.function.call.hmi.CallerHmiFloatViewManager import com.mogo.eagle.core.function.chat.R import com.mogo.eagle.core.function.chat.facade.MoGoChatFacade import com.mogo.eagle.core.function.chat.facade.OnCallingInterrupt @@ -30,8 +31,8 @@ import com.mogo.eagle.core.function.chat.facade.bridge.BridgeApi import com.mogo.eagle.core.function.chat.facade.utils.log import com.mogo.eagle.core.function.chat.facade.voice.VoiceControlFacade.REQUEST_CLOUD_VOICE_CALL import com.mogo.eagle.core.utilcode.kotlin.* -import com.mogo.eagle.core.utilcode.mogo.glide.GlideRoundedCornersTransform -import com.mogo.eagle.core.utilcode.mogo.glide.GlideRoundedCornersTransform.CornerType.LEFT +import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform +import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform.CornerType.LEFT import kotlinx.coroutines.* import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.channels.Channel.Factory.RENDEZVOUS @@ -200,7 +201,7 @@ internal class CallChatWindowManager { log(TAG, "由于对方呼出又挂断,导致来电界面隐藏") d2.safeCancel() } - 2 -> { + 2 -> { log(TAG, "由于自己主动拒接,导致来电界面隐藏") d1.safeCancel() } @@ -252,8 +253,11 @@ internal class CallChatWindowManager { private fun getInComingLayoutParams(context: Context): FrameLayout.LayoutParams { return FrameLayout.LayoutParams( - context.resources.getDimension(R.dimen.module_call_chat_state_incoming_hawk_eye_width).toInt(), - context.resources.getDimension(R.dimen.module_call_chat_state_incoming_hawk_eye_height).toInt()) + context.resources.getDimension(R.dimen.module_call_chat_state_incoming_hawk_eye_width) + .toInt(), + context.resources.getDimension(R.dimen.module_call_chat_state_incoming_hawk_eye_height) + .toInt() + ) .also { it.gravity = Gravity.BOTTOM or Gravity.START it.marginStart = 40.PX @@ -264,7 +268,11 @@ internal class CallChatWindowManager { /** * 重新开始计时 */ - private fun CoroutineScope.resetInComingTimer(old: Job?, user: UserInfo, incomingView: View): Job { + private fun CoroutineScope.resetInComingTimer( + old: Job?, + user: UserInfo, + incomingView: View + ): Job { old?.safeCancel() return inComingTimer(user, incomingView) } @@ -284,13 +292,13 @@ internal class CallChatWindowManager { var callingView = LayoutInflater.from(context) .inflate(R.layout.module_car_chatting_launcher_calling_hawk_eye_view, null) callingView.isClickable = true - var calling= callingView.findViewById(R.id.module_carchatting_rl_call_view) + var calling = callingView.findViewById(R.id.module_carchatting_rl_call_view) var head = callingView.findViewById(R.id.module_carchatting_call_head) var hangUp = callingView.findViewById(R.id.module_carchatting_call_hangUp) var name = callingView.findViewById(R.id.module_carchatting_call_nickname) var timer = callingView.findViewById(R.id.module_carchatting_call_time) calling.visibility = View.VISIBLE - name.text = "云平台" + name.text = "云平台" timer.text = context.resources.getString(R.string.module_car_chat_matching_wait) GlideApp.with(context).load(user.icon) .apply( @@ -353,7 +361,7 @@ internal class CallChatWindowManager { } hide(callingView) facade.audioFocus().releaseAudioFocus() - }.also { job = it } + }.also { job = it } } if (itx == ON_DESTROY) { isCallingShow = false @@ -375,9 +383,9 @@ internal class CallChatWindowManager { private fun getCallingLayoutParams(context: Context): FrameLayout.LayoutParams { return FrameLayout.LayoutParams( - context.resources.getDimension(R.dimen.module_call_chat_state_hawk_eye_width).toInt(), - context.resources.getDimension(R.dimen.module_call_chat_state_hawk_eye_height).toInt() - ) + context.resources.getDimension(R.dimen.module_call_chat_state_hawk_eye_width).toInt(), + context.resources.getDimension(R.dimen.module_call_chat_state_hawk_eye_height).toInt() + ) .also { it.gravity = Gravity.BOTTOM or Gravity.START it.marginStart = 40.PX @@ -393,17 +401,17 @@ internal class CallChatWindowManager { } private fun show(view: View, params: FrameLayout.LayoutParams) { - BridgeApi.floatViewManager()?.addView(view, params, true) + CallerHmiFloatViewManager.addView(view, params, true) } private fun hide(view: View) { if (!ViewCompat.isAttachedToWindow(view)) { return } - BridgeApi.floatViewManager()?.removeView(view) + CallerHmiFloatViewManager.removeView(view) } - private fun playAudioCall(onPlay:(() -> Unit)? = null) { + private fun playAudioCall(onPlay: (() -> Unit)? = null) { facade.also { it.audioFocus().requireAudioFocus { it.media().play(context, R.raw.call, true, AudioManager.STREAM_RING) @@ -474,7 +482,13 @@ internal class CallChatWindowManager { * @param onExit: 当前用户退房通知(当前用户主动挂断或对方挂断) */ @OptIn(ExperimentalCoroutinesApi::class) - private fun answer(user: UserInfo, onEnter: () -> Unit, onNewEnter: () -> Unit, onExit: () -> Unit, onError: (code: Int, msg: String, extra: Map? ) -> Unit) { + private fun answer( + user: UserInfo, + onEnter: () -> Unit, + onNewEnter: () -> Unit, + onExit: () -> Unit, + onError: (code: Int, msg: String, extra: Map?) -> Unit + ) { facade.also { itx -> if (hasAnswered) { return @@ -482,7 +496,7 @@ internal class CallChatWindowManager { hasAnswered = true itx.answer(user.sn) .onEach { - when(it) { + when (it) { is EnterRoomSuccess -> { onEnter.invoke() } @@ -507,7 +521,12 @@ internal class CallChatWindowManager { } } - private fun doRefuse(user: UserInfo, notify: Boolean = true, inComingView: View, isAnswerFail: Boolean) { + private fun doRefuse( + user: UserInfo, + notify: Boolean = true, + inComingView: View, + isAnswerFail: Boolean + ) { refuse(user, onSuccess = { if (notify) { @@ -529,7 +548,11 @@ internal class CallChatWindowManager { } @OptIn(ExperimentalCoroutinesApi::class) - private fun refuse(user: UserInfo, onSuccess: () -> Unit, onError: (code: Int, msg: String, extra: Map?) -> Unit){ + private fun refuse( + user: UserInfo, + onSuccess: () -> Unit, + onError: (code: Int, msg: String, extra: Map?) -> Unit + ) { facade.also { if (hasRefused) { return @@ -537,7 +560,7 @@ internal class CallChatWindowManager { hasRefused = true it.refuse(user.sn) .onEach { itx -> - when(itx) { + when (itx) { is RefuseState.Success -> { onSuccess.invoke() } @@ -591,13 +614,17 @@ internal class CallChatWindowManager { var counter = 1 while (true) { delay(1000) - emit(1000L * (counter ++)) + emit(1000L * (counter++)) } } } @OptIn(ExperimentalCoroutinesApi::class) - private fun hangUp(user: UserInfo, onSuccess: () -> Unit, onError:(code: Int, msg: String, extra: Map?) -> Unit) { + private fun hangUp( + user: UserInfo, + onSuccess: () -> Unit, + onError: (code: Int, msg: String, extra: Map?) -> Unit + ) { facade.also { if (hasHangUpped) { return @@ -605,13 +632,16 @@ internal class CallChatWindowManager { hasHangUpped = true it.handUp(user.sn) .onEach { itx -> - when(itx) { + when (itx) { HangUpState.Success -> { onSuccess.invoke() } is HangUpState.Error -> { hasHangUpped = false - log(TAG, "-- 挂断失败 --: code:: ${itx.code}; msg:: ${itx.msg}; extra:: ${itx.extra}") + log( + TAG, + "-- 挂断失败 --: code:: ${itx.code}; msg:: ${itx.msg}; extra:: ${itx.extra}" + ) onError.invoke(itx.code, itx.msg, itx.extra) } else -> { diff --git a/core/function-impl/mogo-core-function-chat/src/main/java/com/mogo/eagle/core/function/chat/facade/voice/VoiceControlFacade.kt b/core/function-impl/mogo-core-function-chat/src/main/java/com/mogo/eagle/core/function/chat/facade/voice/VoiceControlFacade.kt index 957641ded4..7ba0700ca1 100644 --- a/core/function-impl/mogo-core-function-chat/src/main/java/com/mogo/eagle/core/function/chat/facade/voice/VoiceControlFacade.kt +++ b/core/function-impl/mogo-core-function-chat/src/main/java/com/mogo/eagle/core/function/chat/facade/voice/VoiceControlFacade.kt @@ -3,13 +3,14 @@ package com.mogo.eagle.core.function.chat.facade.voice import android.content.Context import android.content.Intent import com.mogo.commons.AbsMogoApplication +import com.mogo.commons.module.intent.IMogoIntentListener +import com.mogo.commons.module.intent.IntentManager import com.mogo.commons.voice.AIAssist import com.mogo.commons.voice.IMogoVoiceCmdCallBack import com.mogo.eagle.core.function.api.chat.biz.IMoGoVoiceControlFacade import com.mogo.eagle.core.function.api.chat.biz.IMoGoVoiceControlFacade.IMoGoVoiceCallback import com.mogo.eagle.core.function.chat.facade.bridge.BridgeApi import com.mogo.eagle.core.function.chat.facade.utils.log -import com.mogo.service.intent.IMogoIntentListener import java.lang.ref.WeakReference import java.util.concurrent.CopyOnWriteArrayList import java.util.concurrent.atomic.AtomicBoolean @@ -48,10 +49,6 @@ object VoiceControlFacade: IMoGoVoiceControlFacade, IMogoVoiceCmdCallBack, IMogo private var onSpeechFinish: WeakReference? = null - private val intentManager by lazy { - BridgeApi.intentManager() - } - override fun speak(context: Context, content: String, listener: IMoGoVoiceCallback) { listeners += WeakReference(listener) AIAssist.getInstance(context).speakTTSVoiceWithLevel(content,AIAssist.LEVEL3 ,this) @@ -123,10 +120,8 @@ object VoiceControlFacade: IMoGoVoiceControlFacade, IMogoVoiceCmdCallBack, IMogo } hasRegister.set(true) AIAssist.getInstance(BridgeApi.context()).registerUnWakeupCommand(VOICE_REGISTER_CANCEL_CALL, customCancelCallArray, this) - intentManager?.also { - it.registerIntentListener(VOICE_INTENT_CANCEL_CALL_COMMAND, this) - it.registerIntentListener(VOICE_INTENT_REFUSE_CALL, this) - } + IntentManager.getInstance().registerIntentListener(VOICE_INTENT_CANCEL_CALL_COMMAND, this) + IntentManager.getInstance().registerIntentListener(VOICE_INTENT_REFUSE_CALL, this) } override fun registerInviteJoinTeam(context: Context, listener: IMoGoVoiceCallback) { @@ -156,13 +151,13 @@ object VoiceControlFacade: IMoGoVoiceControlFacade, IMogoVoiceCmdCallBack, IMogo override fun registerIntentInComingCall(listener: IMoGoVoiceCallback) { listeners += WeakReference(listener) - intentManager?.registerIntentListener(VOICE_INTENT_ANSWER_CALL, this) - intentManager?.registerIntentListener(VOICE_INTENT_REFUSE_CALL, this) + IntentManager.getInstance().registerIntentListener(VOICE_INTENT_ANSWER_CALL, this) + IntentManager.getInstance().registerIntentListener(VOICE_INTENT_REFUSE_CALL, this) } override fun unRegisterIntentInComingCall(context: Context) { - intentManager?.unregisterIntentListener(VOICE_INTENT_ANSWER_CALL, this) - intentManager?.unregisterIntentListener(VOICE_INTENT_REFUSE_CALL, this) + IntentManager.getInstance().unregisterIntentListener(VOICE_INTENT_ANSWER_CALL, this) + IntentManager.getInstance().unregisterIntentListener(VOICE_INTENT_REFUSE_CALL, this) } override fun speakAndRegisterCall(onCmdAgree: (Boolean) -> Unit, onSpeakFinish: () -> Unit, listener: IMoGoVoiceCallback) { @@ -204,10 +199,8 @@ object VoiceControlFacade: IMoGoVoiceControlFacade, IMogoVoiceCmdCallBack, IMogo hasRegister.set(false) listeners.clear() AIAssist.getInstance(BridgeApi.context()).unregisterUnWakeupCommand(VOICE_REGISTER_CANCEL_CALL, this) - intentManager?.also { - it.unregisterIntentListener(VOICE_INTENT_CANCEL_CALL_COMMAND, this) - it.unregisterIntentListener(VOICE_INTENT_REFUSE_CALL, this) - } + IntentManager.getInstance().unregisterIntentListener(VOICE_INTENT_CANCEL_CALL_COMMAND, this) + IntentManager.getInstance().unregisterIntentListener(VOICE_INTENT_REFUSE_CALL, this) } override fun onIntentReceived(cmd: String?, intent: Intent?) { diff --git a/core/function-impl/mogo-core-function-check/build.gradle b/core/function-impl/mogo-core-function-check/build.gradle index ffa5e9b62b..555b00ce5b 100644 --- a/core/function-impl/mogo-core-function-check/build.gradle +++ b/core/function-impl/mogo-core-function-check/build.gradle @@ -70,8 +70,6 @@ dependencies { implementation project(':services:mogo-service-api') implementation project(':modules:mogo-module-common') - implementation project(':modules:mogo-module-service') - //implementation project(':modules:mogo-module-carchattingprovider') implementation project(':core:mogo-core-data') implementation project(':core:mogo-core-utils') diff --git a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/VehicleMonitoringManager.kt b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/VehicleMonitoringManager.kt index becb606e4c..f23712e897 100644 --- a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/VehicleMonitoringManager.kt +++ b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/VehicleMonitoringManager.kt @@ -3,6 +3,9 @@ package com.mogo.eagle.core.function.check import android.content.Context import android.content.Intent import com.alibaba.android.arouter.facade.annotation.Route +import com.mogo.commons.module.status.IMogoStatusChangedListener +import com.mogo.commons.module.status.MogoStatusManager +import com.mogo.commons.module.status.StatusDescriptor import com.mogo.eagle.core.data.constants.MogoServicePaths import com.mogo.eagle.core.function.api.check.ICheckProvider import com.mogo.eagle.core.function.api.check.IMogoCheckListener @@ -13,9 +16,6 @@ import com.mogo.eagle.core.function.check.view.CheckActivity import com.mogo.eagle.core.function.check.view.CheckDialog import com.mogo.eagle.core.function.report.IPCReportManager import com.mogo.eagle.core.utilcode.util.* -import com.mogo.module.common.MogoApisHandler -import com.mogo.service.statusmanager.IMogoStatusChangedListener -import com.mogo.service.statusmanager.StatusDescriptor import java.util.concurrent.ConcurrentHashMap /** @@ -38,11 +38,9 @@ class VehicleMonitoringManager : ICheckProvider, IMogoStatusChangedListener { override fun init(context: Context) { mContext = context - MogoApisHandler.getInstance().apis.statusManagerApi.registerStatusChangedListener( - TAG, - StatusDescriptor.MAIN_PAGE_RESUME, - this - ) + MogoStatusManager.getInstance().registerStatusChangedListener(TAG, + StatusDescriptor.MAIN_PAGE_RESUME, + this) //开启工控机监控节点上报服务 IPCReportManager.INSTANCE.initServer() } @@ -123,6 +121,9 @@ class VehicleMonitoringManager : ICheckProvider, IMogoStatusChangedListener { override fun onDestroy() { //停止工控机监控节点上报服务 + MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, + StatusDescriptor.MAIN_PAGE_RESUME, + this) IPCReportManager.INSTANCE.destroy() } diff --git a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/net/CheckApiServiceFactory.java b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/net/CheckApiServiceFactory.java index 9754de8061..f0093f5a1b 100644 --- a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/net/CheckApiServiceFactory.java +++ b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/net/CheckApiServiceFactory.java @@ -1,7 +1,7 @@ package com.mogo.eagle.core.function.check.net; import com.mogo.eagle.core.network.MoGoRetrofitFactory; -import com.mogo.module.common.constants.HostConst; +import com.mogo.eagle.core.data.constants.HostConst; /** * @author liujing diff --git a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckActivity.java b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckActivity.java index da6dfe3b32..18f3cbc7ea 100644 --- a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckActivity.java +++ b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckActivity.java @@ -20,8 +20,7 @@ import com.mogo.eagle.core.function.check.api.ICheckResultCallBack; import com.mogo.eagle.core.function.check.net.CheckNetWork; import com.mogo.eagle.core.function.check.net.CheckResultData; import com.mogo.eagle.core.utilcode.util.ThreadUtils; -import com.mogo.module.common.view.ImageViewClipBounds; -import com.mogo.module.common.view.SpacesItemDecoration; +import com.mogo.eagle.core.utilcode.mogo.view.SpacesItemDecoration; import java.math.BigDecimal; diff --git a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckDialog.java b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckDialog.java index aa31c60104..2638bf24e4 100644 --- a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckDialog.java +++ b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckDialog.java @@ -1,7 +1,10 @@ package com.mogo.eagle.core.function.check.view; +import android.app.Dialog; import android.content.Context; +import android.os.Build; import android.view.View; +import android.view.WindowManager; import android.widget.ImageView; import android.widget.TextView; @@ -9,7 +12,6 @@ import androidx.annotation.NonNull; import com.mogo.eagle.core.function.call.check.CallerCheckManager; import com.mogo.eagle.core.function.check.R; -import com.mogo.module.common.dialog.BaseFloatDialog; /** * @author liujing @@ -17,13 +19,21 @@ import com.mogo.module.common.dialog.BaseFloatDialog; * 第一版本为添加长时间未检测的提示框,因为逻辑冲突,二期需求与产品确认,UI公用 * @since: 7/30/21 */ -public class CheckDialog extends BaseFloatDialog { +public class CheckDialog extends Dialog { private boolean showWarning; private Context mContext; public CheckDialog(@NonNull Context context, boolean hasError) { - super(context); + super(context,R.style.CheckInfoDialogStyle); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY); + } else { + getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT); + } + getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN + | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION + | WindowManager.LayoutParams.FLAG_LOCAL_FOCUS_MODE); mContext = context; showWarning = hasError; initView(); diff --git a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckInfoListDialog.java b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckInfoListDialog.java index e61b7f2541..3fc27d82ac 100644 --- a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckInfoListDialog.java +++ b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/CheckInfoListDialog.java @@ -1,6 +1,9 @@ package com.mogo.eagle.core.function.check.view; +import android.app.Dialog; import android.content.Context; +import android.os.Build; +import android.view.WindowManager; import android.widget.TextView; import androidx.annotation.NonNull; @@ -9,7 +12,6 @@ import androidx.recyclerview.widget.GridLayoutManager; import com.mogo.eagle.core.function.check.R; import com.mogo.eagle.core.function.check.model.CheckItemInfo; import com.mogo.eagle.core.function.check.net.CheckResultData; -import com.mogo.module.common.dialog.BaseFloatDialog; import java.util.ArrayList; import java.util.List; @@ -19,7 +21,7 @@ import java.util.List; * @description 检测指标详情弹框 * @since: 9/22/21 */ -public class CheckInfoListDialog extends BaseFloatDialog { +public class CheckInfoListDialog extends Dialog { private static final String TAG = "CheckInfoListDialog"; private CheckInfoRecyclerView mRecyclerView; @@ -28,10 +30,18 @@ public class CheckInfoListDialog extends BaseFloatDialog { private int span; private String mStyle; private CheckResultData mCheckResultData; - private List result = new ArrayList<>(); + private final List result = new ArrayList<>(); public CheckInfoListDialog(@NonNull Context context, String style, CheckResultData checkResultData) { - super(context); + super(context,R.style.CheckInfoDialogStyle); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY); + } else { + getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT); + } + getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN + | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION + | WindowManager.LayoutParams.FLAG_LOCAL_FOCUS_MODE); mContext = context; mStyle = style; mCheckResultData = checkResultData; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/view/ImageViewClipBounds.java b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/ImageViewClipBounds.java similarity index 90% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/view/ImageViewClipBounds.java rename to core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/ImageViewClipBounds.java index 9d5ee41f38..1159b12ac6 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/view/ImageViewClipBounds.java +++ b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/view/ImageViewClipBounds.java @@ -1,4 +1,4 @@ -package com.mogo.module.common.view; +package com.mogo.eagle.core.function.check.view; import android.content.Context; import android.graphics.Canvas; @@ -7,6 +7,8 @@ import android.util.AttributeSet; import androidx.appcompat.widget.AppCompatImageView; +import java.util.Objects; + /** * @author donghongyu * @date 2019-08-22 @@ -37,7 +39,7 @@ public class ImageViewClipBounds extends AppCompatImageView { } public void setClip(Rect clipBounds) { - if (clipBounds == mClipBounds || (clipBounds != null && clipBounds.equals(mClipBounds))) { + if (Objects.equals(clipBounds, mClipBounds)) { return; } if (clipBounds != null) { diff --git a/core/function-impl/mogo-core-function-check/src/main/res/layout/activity_check.xml b/core/function-impl/mogo-core-function-check/src/main/res/layout/activity_check.xml index c9ba22b89e..104d96fab1 100644 --- a/core/function-impl/mogo-core-function-check/src/main/res/layout/activity_check.xml +++ b/core/function-impl/mogo-core-function-check/src/main/res/layout/activity_check.xml @@ -42,7 +42,7 @@ app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> - - + app:layout_constraintTop_toBottomOf="@id/error_title" + tools:ignore="MissingConstraints" /> + app:layout_constraintTop_toBottomOf="@id/error_image" + tools:ignore="MissingConstraints" /> @@ -97,8 +99,9 @@ android:layout_width="@dimen/dp_520" android:layout_height="wrap_content" android:text="您的自动驾驶系统已经很久没有进行体检了,建议立即体检。" - android:textColor="@color/module_commons_wm_dialog_text_textColor" - android:textSize="@dimen/dp_44" /> + android:textColor="@android:color/white" + android:textSize="@dimen/dp_44" + tools:ignore="MissingConstraints" /> + app:layout_constraintTop_toBottomOf="@id/check_text_view" + tools:ignore="MissingConstraints" /> diff --git a/core/function-impl/mogo-core-function-check/src/main/res/layout/check_hardware.xml b/core/function-impl/mogo-core-function-check/src/main/res/layout/check_hardware.xml index 0f2653d31d..be4393e839 100644 --- a/core/function-impl/mogo-core-function-check/src/main/res/layout/check_hardware.xml +++ b/core/function-impl/mogo-core-function-check/src/main/res/layout/check_hardware.xml @@ -18,7 +18,7 @@ android:layout_marginTop="@dimen/dp_50" android:gravity="left" android:text="硬件检测:" - android:textColor="@color/module_commons_wm_dialog_text_textColor" + android:textColor="@android:color/white" android:textSize="@dimen/dp_42" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintTop_toTopOf="parent" @@ -30,7 +30,7 @@ android:layout_height="wrap_content" android:layout_marginTop="@dimen/dp_50" android:text="(下面 1 项存在异常)" - android:textColor="@color/module_commons_wm_dialog_text_textColor" + android:textColor="@android:color/white" android:textSize="@dimen/dp_42" app:layout_constraintLeft_toRightOf="@+id/title" app:layout_constraintTop_toTopOf="parent" /> @@ -45,8 +45,8 @@ android:layout_marginTop="@dimen/dp_236" android:gravity="center" android:text="角激光" - android:textColor="@color/module_commons_wm_dialog_text_textColor" - android:textSize="@dimen/dp_32" + android:textColor="@android:color/white" + android:textSize="@dimen/dp_42" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -77,8 +77,8 @@ android:layout_centerVertical="true" android:gravity="center" android:text="Pad" - android:textColor="@color/module_commons_wm_dialog_text_textColor" - android:textSize="@dimen/dp_32" /> + android:textColor="@android:color/white" + android:textSize="@dimen/dp_42" /> + android:textColor="@android:color/white" + android:textSize="@dimen/dp_42" /> + android:textColor="@android:color/white" + android:textSize="@dimen/dp_42" /> + android:textColor="@android:color/white" + android:textSize="@dimen/dp_42" /> + android:textColor="@android:color/white" + android:textSize="@dimen/dp_42" /> + android:textColor="@android:color/white" + android:textSize="@dimen/dp_42" /> @@ -265,15 +265,15 @@ android:layout_marginTop="@dimen/dp_236" android:gravity="center" android:text="OBU" - android:textColor="@color/module_commons_wm_dialog_text_textColor" - android:textSize="@dimen/dp_32" + android:textColor="@android:color/white" + android:textSize="@dimen/dp_42" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintTop_toTopOf="parent" /> diff --git a/core/function-impl/mogo-core-function-check/src/main/res/layout/check_info_title_item.xml b/core/function-impl/mogo-core-function-check/src/main/res/layout/check_info_title_item.xml index 72a66d2c31..353f35599d 100644 --- a/core/function-impl/mogo-core-function-check/src/main/res/layout/check_info_title_item.xml +++ b/core/function-impl/mogo-core-function-check/src/main/res/layout/check_info_title_item.xml @@ -13,7 +13,7 @@ android:background="@drawable/check_top_item_no_line_shape" android:gravity="left" android:paddingLeft="@dimen/dp_40" - android:paddingTop="@dimen/dp_32" + android:paddingTop="@dimen/dp_42" android:text="模块名称" android:textColor="#FFF" android:textSize="@dimen/dp_38" @@ -30,7 +30,7 @@ android:layout_height="match_parent" android:background="@drawable/check_top_item_left_shape" android:paddingLeft="@dimen/dp_40" - android:paddingTop="@dimen/dp_32" + android:paddingTop="@dimen/dp_42" android:text="运行状态" android:textColor="#FFF" android:textSize="@dimen/dp_38" @@ -47,7 +47,7 @@ android:layout_height="match_parent" android:background="@drawable/check_top_item_left_shape" android:paddingLeft="@dimen/dp_40" - android:paddingTop="@dimen/dp_32" + android:paddingTop="@dimen/dp_42" android:text="模块名称" android:textColor="#FFF" android:textSize="@dimen/dp_38" @@ -64,7 +64,7 @@ android:layout_height="match_parent" android:background="@drawable/check_top_item_left_shape" android:paddingLeft="@dimen/dp_40" - android:paddingTop="@dimen/dp_32" + android:paddingTop="@dimen/dp_42" android:text="运行状态" android:textColor="#FFF" android:textSize="@dimen/dp_38" diff --git a/core/function-impl/mogo-core-function-check/src/main/res/layout/check_list.xml b/core/function-impl/mogo-core-function-check/src/main/res/layout/check_list.xml index b1f880ad9b..6e250e33d5 100644 --- a/core/function-impl/mogo-core-function-check/src/main/res/layout/check_list.xml +++ b/core/function-impl/mogo-core-function-check/src/main/res/layout/check_list.xml @@ -17,7 +17,7 @@ android:layout_marginLeft="@dimen/dp_50" android:layout_marginTop="@dimen/dp_50" android:text="硬件检测:" - android:textColor="@color/module_commons_wm_dialog_text_textColor" + android:textColor="@android:color/white" android:textSize="@dimen/dp_42" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -52,7 +52,7 @@ android:layout_marginTop="@dimen/dp_22" android:maxLines="2" android:text="自动驾驶" - android:textColor="@color/module_commons_wm_dialog_text_textColor" + android:textColor="@android:color/white" android:textSize="@dimen/dp_42" app:layout_constraintTop_toBottomOf="@id/icon_auto" /> @@ -97,7 +97,7 @@ android:layout_marginTop="@dimen/dp_22" android:text=" 鹰眼\n版本" android:textAlignment="center" - android:textColor="@color/module_commons_wm_dialog_text_textColor" + android:textColor="@android:color/white" android:textSize="@dimen/dp_42" app:layout_constraintTop_toBottomOf="@id/icon_auto" /> diff --git a/core/function-impl/mogo-core-function-check/src/main/res/layout/check_titel.xml b/core/function-impl/mogo-core-function-check/src/main/res/layout/check_titel.xml index c4b8bc1ebf..fbece2cb31 100644 --- a/core/function-impl/mogo-core-function-check/src/main/res/layout/check_titel.xml +++ b/core/function-impl/mogo-core-function-check/src/main/res/layout/check_titel.xml @@ -25,7 +25,7 @@ android:layout_marginLeft="@dimen/dp_65" android:layout_marginTop="@dimen/dp_20" android:text="暂无数据,请关闭重试" - android:textColor="@color/module_commons_wm_dialog_text_textColor" + android:textColor="@android:color/white" android:textSize="@dimen/dp_64" app:layout_constraintLeft_toRightOf="@+id/check_tip_image" app:layout_constraintTop_toTopOf="@+id/check_tip_image" /> diff --git a/core/function-impl/mogo-core-function-check/src/main/res/values/styles.xml b/core/function-impl/mogo-core-function-check/src/main/res/values/styles.xml index 182b13ef71..ded721c47e 100644 --- a/core/function-impl/mogo-core-function-check/src/main/res/values/styles.xml +++ b/core/function-impl/mogo-core-function-check/src/main/res/values/styles.xml @@ -8,4 +8,19 @@ @drawable/check_progress @drawable/check_item_left_shape + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/upgrade/network/UpgradeVersionNetWorkModel.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/upgrade/network/UpgradeVersionNetWorkModel.kt index 13c5f29ff4..6170901949 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/upgrade/network/UpgradeVersionNetWorkModel.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/upgrade/network/UpgradeVersionNetWorkModel.kt @@ -4,7 +4,7 @@ import com.mogo.eagle.core.data.Response import com.mogo.eagle.core.network.MoGoRetrofitFactory import com.mogo.eagle.core.network.apiResponseCall import com.mogo.eagle.core.network.request -import com.mogo.module.common.constants.HostConst +import com.mogo.eagle.core.data.constants.HostConst import com.zhjt.mogo_core_function_devatools.upgrade.network.HostConst.Companion.getBaseUrl class UpgradeVersionNetWorkModel { diff --git a/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/DispatchAutoPilotManager.java b/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/DispatchAutoPilotManager.java index e84c0fe66d..bd8b98e7ac 100644 --- a/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/DispatchAutoPilotManager.java +++ b/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/DispatchAutoPilotManager.java @@ -66,8 +66,6 @@ public class DispatchAutoPilotManager implements IMogoOnMessageListener= Build.VERSION_CODES.O) { + getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY); + } else { + getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT); + } + getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN + | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION + | WindowManager.LayoutParams.FLAG_LOCAL_FOCUS_MODE); } public abstract void addIDispatchRemindListener(IDispatchRemindClickListener listener); diff --git a/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/model/DispatchServiceModel.java b/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/model/DispatchServiceModel.java index db78ed49ab..e214e9a3ab 100644 --- a/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/model/DispatchServiceModel.java +++ b/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/model/DispatchServiceModel.java @@ -1,7 +1,7 @@ package com.zhjt.dispatch.model; import static com.mogo.commons.context.ContextHolderUtil.getContext; -import static com.mogo.module.common.constants.HostConst.DATA_SERVICE_HOST; +import static com.mogo.eagle.core.data.constants.HostConst.DATA_SERVICE_HOST; import com.mogo.cloud.passport.MoGoAiCloudClientConfig; import com.mogo.eagle.core.data.BaseData; @@ -13,7 +13,6 @@ import com.mogo.eagle.core.network.MoGoRetrofitFactory; import com.mogo.eagle.core.network.RequestOptions; import com.mogo.eagle.core.network.SubscribeImpl; import com.mogo.eagle.core.network.utils.GsonUtil; -import com.mogo.module.common.MogoApisHandler; import java.util.HashMap; import java.util.List; diff --git a/modules/mogo-module-common/src/main/res/values/styles.xml b/core/function-impl/mogo-core-function-dispatch/src/main/res/values/styles.xml similarity index 55% rename from modules/mogo-module-common/src/main/res/values/styles.xml rename to core/function-impl/mogo-core-function-dispatch/src/main/res/values/styles.xml index c694e342bb..c4912ff1e0 100644 --- a/modules/mogo-module-common/src/main/res/values/styles.xml +++ b/core/function-impl/mogo-core-function-dispatch/src/main/res/values/styles.xml @@ -1,6 +1,5 @@ - - - - - - - \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/build.gradle b/core/function-impl/mogo-core-function-hmi/build.gradle index ccccc40f85..a20e15fcd9 100644 --- a/core/function-impl/mogo-core-function-hmi/build.gradle +++ b/core/function-impl/mogo-core-function-hmi/build.gradle @@ -114,7 +114,6 @@ dependencies { api project(':services:mogo-service-api') api project(':services:mogo-service') - api project(':modules:mogo-module-service') api project(':libraries:mogo-map') api project(':test:crashreport-upgrade') // api project(':test:crashreport-bugly') diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/dialog/BaseFloatDialog.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/dialog/BaseFloatDialog.java similarity index 96% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/dialog/BaseFloatDialog.java rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/dialog/BaseFloatDialog.java index 036cfcb2ab..2622eb1baf 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/dialog/BaseFloatDialog.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/dialog/BaseFloatDialog.java @@ -1,4 +1,4 @@ -package com.mogo.module.common.dialog; +package com.mogo.eagle.core.function.hmi.dialog; import android.app.Dialog; import android.content.Context; @@ -11,8 +11,8 @@ import android.widget.FrameLayout; import androidx.annotation.NonNull; import com.mogo.commons.debug.DebugConfig; +import com.mogo.eagle.core.function.hmi.R; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; -import com.mogo.module.common.R; /** * 浮在各种wm上面的dialog基类,调用了window.setType diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/DialogImpl.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/dialog/DialogImpl.java similarity index 92% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/DialogImpl.java rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/dialog/DialogImpl.java index 57522c11e2..a07614e3aa 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/DialogImpl.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/dialog/DialogImpl.java @@ -1,12 +1,10 @@ -package com.mogo.module.common.wm; +package com.mogo.eagle.core.function.hmi.dialog; import android.app.Dialog; import android.view.View; import android.view.ViewGroup; -import com.mogo.module.common.dialog.BaseFloatDialog; - /** * 采用Dialog实现接口 */ diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/IWindowManagerView.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/dialog/IWindowManagerView.java similarity index 94% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/IWindowManagerView.java rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/dialog/IWindowManagerView.java index f0e78fc0ea..f65fc8b60b 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/IWindowManagerView.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/dialog/IWindowManagerView.java @@ -1,4 +1,4 @@ -package com.mogo.module.common.wm; +package com.mogo.eagle.core.function.hmi.dialog; import android.view.View; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/dialog/WMDialog.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/dialog/WMDialog.java similarity index 97% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/dialog/WMDialog.java rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/dialog/WMDialog.java index 8fc96f49c0..1ed2e3c748 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/dialog/WMDialog.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/dialog/WMDialog.java @@ -1,4 +1,4 @@ -package com.mogo.module.common.dialog; +package com.mogo.eagle.core.function.hmi.dialog; import android.app.Activity; import android.content.Context; @@ -7,8 +7,8 @@ import android.widget.TextView; import androidx.annotation.StringRes; -import com.mogo.module.common.R; -import com.mogo.module.common.wm.WindowManagerView; +import com.mogo.eagle.core.function.hmi.R; + /** * @author congtaowang diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerImpl.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/dialog/WindowManagerImpl.java similarity index 98% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerImpl.java rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/dialog/WindowManagerImpl.java index 89f614f7bb..12ccd0f03d 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerImpl.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/dialog/WindowManagerImpl.java @@ -1,4 +1,4 @@ -package com.mogo.module.common.wm; +package com.mogo.eagle.core.function.hmi.dialog; import android.content.Context; import android.graphics.PixelFormat; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerView.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/dialog/WindowManagerView.java similarity index 98% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerView.java rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/dialog/WindowManagerView.java index e5c0a562af..e633a08e82 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerView.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/dialog/WindowManagerView.java @@ -1,4 +1,4 @@ -package com.mogo.module.common.wm; +package com.mogo.eagle.core.function.hmi.dialog; import android.content.Context; import android.view.LayoutInflater; diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XWarningBroadcastReceiver.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XWarningBroadcastReceiver.kt index 2ca0a948ed..7486583818 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XWarningBroadcastReceiver.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XWarningBroadcastReceiver.kt @@ -7,7 +7,7 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiManager import com.mogo.eagle.core.function.hmi.WaringConst import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI -import com.mogo.module.common.enums.EventTypeEnum +import com.mogo.eagle.core.data.enums.EventTypeEnum /** * V2X 预警广播接收。用于跨应用,跨进程,内部也可以通过这种方式弹出预警提示框 diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt index d9ef4f15a7..1a1ec07dbd 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt @@ -23,6 +23,7 @@ import com.alibaba.android.arouter.launcher.ARouter import com.mogo.cloud.passport.MoGoAiCloudClient import com.mogo.commons.AbsMogoApplication import com.mogo.commons.debug.DebugConfig +import com.mogo.eagle.core.data.enums.EventTypeEnum import com.mogo.commons.mvp.BaseFragment import com.mogo.commons.mvp.MvpFragment import com.mogo.commons.voice.* @@ -83,6 +84,7 @@ import com.mogo.eagle.core.function.hmi.ui.tools.MaskView import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView import com.mogo.eagle.core.function.hmi.ui.widget.V2XNotificationView +import com.mogo.eagle.core.function.main.utils.DisplayEffectsHelper import com.mogo.eagle.core.utilcode.kotlin.* import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import com.mogo.eagle.core.utilcode.mogo.logger.* @@ -96,7 +98,6 @@ import com.mogo.eagle.core.utilcode.reminder.api.impl.* import com.mogo.eagle.core.utilcode.util.* import com.mogo.eagle.core.utilcode.util.TimeUtils.millis2String import com.mogo.map.MogoMap -import com.mogo.module.common.enums.* import com.zhidao.support.adas.high.common.MogoReport.Code.Error.EMAP.* import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig import com.zhjt.service_biz.BizConfig @@ -133,7 +134,6 @@ class MoGoHmiFragment : MvpFragment(), private var mSOPSettingView: SOPSettingView? = null //StatusView - private var statusBarViewFloat: WarningFloat.Builder? = null private var statusBarView: StatusBarView? = null private var mNoticeFloat: WarningFloat.Builder? = null @@ -195,10 +195,10 @@ class MoGoHmiFragment : MvpFragment(), } override fun initViews() { - //toggleStatusBarView() - initViewShowWithConfig() + val decorView = requireActivity().window.decorView as FrameLayout + statusBarView = decorView.findViewWithTag("status_bar") as StatusBarView? //设置StatusBar初始状态 if (FunctionBuildConfig.isDemoMode) { statusBarView?.updateRightView(true, "demoMode", DemoModeView(requireContext())) @@ -592,6 +592,10 @@ class MoGoHmiFragment : MvpFragment(), return HmiPresenter(this) } + override fun displayEffects() { + DisplayEffectsHelper.getInstance().display() + } + override fun setSpeedChartViewVisibility(visibility: Int) { viewSpeedChart?.visibility = visibility } @@ -746,52 +750,6 @@ class MoGoHmiFragment : MvpFragment(), } } - private fun toggleStatusBarView() { - activity?.let{ - if(statusBarViewFloat!= null){ - WarningFloat.dismiss(statusBarViewFloat!!.config.floatTag, false) - statusBarViewFloat = null - statusBarView = null - }else{ - if (statusBarView == null){ - statusBarView = StatusBarView(it) - } - val side = TOP - val gravity = Gravity.TOP - statusBarViewFloat = WarningFloat.with(it) - .setTag("statusBarView") - .setLayout(statusBarView!!) - .setSidePattern(side) - .setWindowWidth(ScreenUtils.getScreenWidth()) - .setWindowHeight(BarUtils.getStatusBarHeight()) - .setGravity(gravity, 0) - .setImmersionStatusBar(true) - .setAnimator(object : DefaultAnimator() { - override fun enterAnim( - view: View, - params: LayoutParams, - windowManager: WindowManager, - sidePattern: SidePattern - ): Animator? = - super.enterAnim(view, params, windowManager, sidePattern) - ?.apply { - interpolator = LinearInterpolator() - } - - override fun exitAnim( - view: View, - params: LayoutParams, - windowManager: WindowManager, - sidePattern: SidePattern - ): Animator? = - super.exitAnim(view, params, windowManager, sidePattern) - ?.setDuration(200) - }) - .show() - } - } - } - /** * 展示VR下V2X预警 * diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/ModifyBindingCarDialog.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/ModifyBindingCarDialog.kt index ffe5846434..8220934278 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/ModifyBindingCarDialog.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/ModifyBindingCarDialog.kt @@ -1,49 +1,54 @@ package com.mogo.eagle.core.function.hmi.ui.bindingcar import android.content.Context -import android.util.Log import android.widget.TextView import androidx.lifecycle.LifecycleObserver +import com.mogo.commons.module.status.IMogoStatusChangedListener +import com.mogo.commons.module.status.MogoStatusManager +import com.mogo.commons.module.status.StatusDescriptor import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.utilcode.mogo.toast.TipToast -import com.mogo.module.common.dialog.BaseFloatDialog -import com.mogo.service.IMogoServiceApis -import com.mogo.service.statusmanager.IMogoStatusChangedListener -import com.mogo.service.statusmanager.StatusDescriptor +import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog /** * @brief 修改车辆对话框 * @author lixiaopeng */ -class ModifyBindingCarDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver{ +class ModifyBindingCarDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver { private val TAG = "BindingCarDialog" private var confirmTv: TextView? = null - private var cancleTv: TextView? = null + private var cancelTv: TextView? = null - private var mServiceApis: IMogoServiceApis? = null - private val statusChangedListenerForCheckNotice = IMogoStatusChangedListener { descriptor, isTrue -> - if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND) { - dismiss() + private val statusChangedListenerForCheckNotice = + IMogoStatusChangedListener { descriptor, isTrue -> + if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND) { + dismiss() + } } - } init { setContentView(R.layout.dialog_modify_bindingcar) setCanceledOnTouchOutside(true) confirmTv = findViewById(R.id.tv_bindingcar_confirm) - cancleTv = findViewById(R.id.tv_bindingcar_cancel) + cancelTv = findViewById(R.id.tv_bindingcar_cancel) confirmTv?.setOnClickListener { modifyBindingcar() } - cancleTv?.setOnClickListener { + cancelTv?.setOnClickListener { dismiss() } + + MogoStatusManager.getInstance().registerStatusChangedListener( + TAG, + StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, + statusChangedListenerForCheckNotice + ) } /** @@ -62,6 +67,11 @@ class ModifyBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifec override fun dismiss() { super.dismiss() + MogoStatusManager.getInstance().unregisterStatusChangedListener( + TAG, + StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, + statusChangedListenerForCheckNotice + ) } fun showModifyBindingcarDialog() { diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/ToBindingCarDialog.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/ToBindingCarDialog.kt index 6d38ac8373..e737eff6f8 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/ToBindingCarDialog.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/ToBindingCarDialog.kt @@ -3,13 +3,13 @@ package com.mogo.eagle.core.function.hmi.ui.bindingcar import android.content.Context import android.widget.TextView import androidx.lifecycle.LifecycleObserver +import com.mogo.commons.module.status.IMogoStatusChangedListener +import com.mogo.commons.module.status.MogoStatusManager +import com.mogo.commons.module.status.StatusDescriptor import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.utilcode.mogo.toast.TipToast -import com.mogo.module.common.dialog.BaseFloatDialog -import com.mogo.service.IMogoServiceApis -import com.mogo.service.statusmanager.IMogoStatusChangedListener -import com.mogo.service.statusmanager.StatusDescriptor +import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog /** @@ -20,9 +20,8 @@ class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifecycle private val TAG = "ToBindingCarDialog" private var confirmTv: TextView? = null - private var cancleTv: TextView? = null + private var cancelTv: TextView? = null - private var mServiceApis: IMogoServiceApis? = null private val statusChangedListenerForCheckNotice = IMogoStatusChangedListener { descriptor, isTrue -> if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND) { dismiss() @@ -34,15 +33,21 @@ class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifecycle setCanceledOnTouchOutside(true) confirmTv = findViewById(R.id.tv_to_bindingcar_confirm) - cancleTv = findViewById(R.id.tv_to_bindingcar_cancel) + cancelTv = findViewById(R.id.tv_to_bindingcar_cancel) confirmTv?.setOnClickListener { toBindingcar() } - cancleTv?.setOnClickListener { + cancelTv?.setOnClickListener { dismiss() } + + MogoStatusManager.getInstance().registerStatusChangedListener( + TAG, + StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, + statusChangedListenerForCheckNotice + ) } /** @@ -61,6 +66,11 @@ class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifecycle override fun dismiss() { super.dismiss() + MogoStatusManager.getInstance().unregisterStatusChangedListener( + TAG, + StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, + statusChangedListenerForCheckNotice + ) } fun showToBindingcarDialog() { diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/UpgradeAppDialog.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/UpgradeAppDialog.kt index 3f2319fb5e..701fac27a8 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/UpgradeAppDialog.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/UpgradeAppDialog.kt @@ -1,24 +1,19 @@ package com.mogo.eagle.core.function.hmi.ui.bindingcar import android.content.Context -import android.opengl.Visibility -import android.util.Log import android.view.View import android.widget.TextView import androidx.lifecycle.LifecycleObserver import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.utilcode.util.ToastUtils -import com.mogo.module.common.dialog.BaseFloatDialog -import com.mogo.service.IMogoServiceApis -import com.mogo.service.statusmanager.IMogoStatusChangedListener -import com.mogo.service.statusmanager.StatusDescriptor +import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog /** * @brief APP升级提示弹框 * @author lixiaopeng */ -class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver{ +class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver { private val TAG = "UpgradeAppDialog" private var confirmTv: TextView? = null @@ -70,7 +65,13 @@ class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleOb } // 升级类型 1:提示升级 2:静默升级 3:强制升级 - fun showUpgradeAppDialog(name: String, url: String, title: String, content: String, installType: String) { + fun showUpgradeAppDialog( + name: String, + url: String, + title: String, + content: String, + installType: String + ) { if (isShowing) { return } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/camera/RoadVideoDialog.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/camera/RoadVideoDialog.kt index a13bd5b52f..b3956d1659 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/camera/RoadVideoDialog.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/camera/RoadVideoDialog.kt @@ -13,7 +13,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant import com.mogo.eagle.core.utilcode.util.ToastUtils import com.mogo.eagle.core.widget.media.video.SimpleVideoPlayer -import com.mogo.module.common.dialog.BaseFloatDialog +import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog import com.shuyu.gsyvideoplayer.GSYVideoManager import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder import com.shuyu.gsyvideoplayer.model.VideoOptionModel diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/NoticeBannerView.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/NoticeBannerView.java index 80bd913233..7b0271d048 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/NoticeBannerView.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/NoticeBannerView.java @@ -18,7 +18,7 @@ import com.mogo.eagle.core.function.hmi.R; import com.mogo.eagle.core.function.hmi.WaringConst; import com.mogo.eagle.core.function.hmi.notification.WarningFloat; import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp; -import com.mogo.eagle.core.utilcode.mogo.glide.GlideRoundedCornersTransform; +import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform; import com.mogo.eagle.core.utilcode.util.BitmapHelper; import com.mogo.eagle.core.utilcode.util.ThreadUtils; diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/NoticeCheckDialog.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/NoticeCheckDialog.kt index 6960ca946b..ae92070f39 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/NoticeCheckDialog.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/NoticeCheckDialog.kt @@ -7,19 +7,19 @@ import android.view.View import android.widget.ImageView import android.widget.TextView import androidx.lifecycle.LifecycleObserver +import com.mogo.commons.module.status.IMogoStatusChangedListener +import com.mogo.commons.module.status.MogoStatusManager +import com.mogo.commons.module.status.StatusDescriptor import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI import com.mogo.eagle.core.data.notice.NoticeNormalData import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp -import com.mogo.eagle.core.utilcode.mogo.glide.GlideRoundedCornersTransform +import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform import com.mogo.eagle.core.utilcode.util.BitmapHelper import com.mogo.eagle.core.widget.media.video.NoticeSimpleVideoPlayer -import com.mogo.module.common.MogoApisHandler -import com.mogo.module.common.dialog.BaseFloatDialog +import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog import com.mogo.service.IMogoServiceApis -import com.mogo.service.statusmanager.IMogoStatusChangedListener -import com.mogo.service.statusmanager.StatusDescriptor import com.shuyu.gsyvideoplayer.GSYVideoManager import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack @@ -94,13 +94,13 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO playVideo(mVideoUrl) } - mServiceApis = MogoApisHandler.getInstance().apis - mServiceApis?.statusManagerApi?.registerStatusChangedListener(TAG, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, statusChangedListenerForCheckNotice) + MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, statusChangedListenerForCheckNotice) } override fun dismiss() { super.dismiss() + MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, statusChangedListenerForCheckNotice) stopLive() } @@ -125,7 +125,9 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO pushImageView?.let { GlideApp.with(context).load(noticeNormal.imageUrl).optionalTransform( GlideRoundedCornersTransform( - 20f, GlideRoundedCornersTransform.CornerType.ALL) + 20f, + GlideRoundedCornersTransform.CornerType.ALL + ) ).into(it) } @@ -191,8 +193,12 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO playImageView!!.visibility = View.VISIBLE playImageView!!.setImageResource(R.drawable.notice_video_play) thumbnailImageView!!.visibility = View.VISIBLE - GlideApp.with(context).load(firstbitmap).optionalTransform(GlideRoundedCornersTransform( - 20f, GlideRoundedCornersTransform.CornerType.ALL)).into(thumbnailImageView!!) + GlideApp.with(context).load(firstbitmap).optionalTransform( + GlideRoundedCornersTransform( + 20f, + GlideRoundedCornersTransform.CornerType.ALL + ) + ).into(thumbnailImageView!!) } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/NoticeNormalBannerView.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/NoticeNormalBannerView.java index 7f67613a45..a6d3af65ed 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/NoticeNormalBannerView.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/NoticeNormalBannerView.java @@ -16,7 +16,7 @@ import com.mogo.eagle.core.function.hmi.R; import com.mogo.eagle.core.function.hmi.WaringConst; import com.mogo.eagle.core.function.hmi.notification.WarningFloat; import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp; -import com.mogo.eagle.core.utilcode.mogo.glide.GlideRoundedCornersTransform; +import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform; /** diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/NoticeTrafficDialog.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/NoticeTrafficDialog.java index fb1058fcbc..1d52222fca 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/NoticeTrafficDialog.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/NoticeTrafficDialog.java @@ -15,27 +15,25 @@ import androidx.recyclerview.widget.StaggeredGridLayoutManager; import com.mogo.cloud.commons.utils.CoordinateUtils; import com.mogo.cloud.passport.MoGoAiCloudClientConfig; +import com.mogo.commons.module.status.IMogoStatusChangedListener; +import com.mogo.commons.module.status.MogoStatusManager; +import com.mogo.commons.module.status.StatusDescriptor; import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters; import com.mogo.eagle.core.data.notice.NoticeTrafficStyleInfo; import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData; import com.mogo.eagle.core.data.notice.NoticeValue; -import com.mogo.eagle.core.function.api.notice.NoticeNetCallBack; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; -import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.function.call.notice.CallerNoticeManager; import com.mogo.eagle.core.function.hmi.R; import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp; -import com.mogo.eagle.core.utilcode.mogo.glide.GlideRoundedCornersTransform; +import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform; +import com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView; +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.util.BitmapHelper; import com.mogo.eagle.core.utilcode.util.DateTimeUtils; import com.mogo.eagle.core.widget.media.video.NoticeSimpleSmallVideoPlayer; -import com.mogo.module.common.MogoApisHandler; -import com.mogo.module.common.dialog.BaseFloatDialog; -import com.mogo.service.IMogoServiceApis; -import com.mogo.service.imageloader.MogoImageView; -import com.mogo.service.statusmanager.IMogoStatusChangedListener; -import com.mogo.service.statusmanager.StatusDescriptor; +import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog; import com.shuyu.gsyvideoplayer.GSYVideoManager; import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder; import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack; @@ -64,9 +62,8 @@ public class NoticeTrafficDialog extends BaseFloatDialog implements LifecycleObs private TextView refuse;//拒绝 private TextView connect;//连接 private NoticeTrafficAdapter adapter; - private final ArrayList dataArrayList = new ArrayList(); + private final ArrayList dataArrayList = new ArrayList<>(); private NoticeTrafficStyleInfo.NoticeTrafficAccountInfo mTrafficStyleInfo; - private IMogoServiceApis mServiceApis; public NoticeTrafficDialog(@NonNull Context context, NoticeTrafficStylePushData pushData) { super(context); @@ -84,8 +81,7 @@ public class NoticeTrafficDialog extends BaseFloatDialog implements LifecycleObs setCanceledOnTouchOutside(true); playerShow();//视频播放器及接操作按钮 recyclerVie();//详情信息列表 - mServiceApis = MogoApisHandler.getInstance().getApis(); - mServiceApis.getStatusManagerApi().registerStatusChangedListener(M_HMI + TAG, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, statusChangedListenerForNotice); + MogoStatusManager.getInstance().registerStatusChangedListener(M_HMI + TAG, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, statusChangedListenerForNotice); } /** @@ -169,7 +165,7 @@ public class NoticeTrafficDialog extends BaseFloatDialog implements LifecycleObs * 开启自动驾驶 */ private void startAutoPilot() { - if (mTrafficStyleInfo != null){ + if (mTrafficStyleInfo != null) { AutopilotControlParameters parameters = new AutopilotControlParameters(); parameters.isSpeakVoice = false; parameters.vehicleType = 10; @@ -356,13 +352,10 @@ public class NoticeTrafficDialog extends BaseFloatDialog implements LifecycleObs */ private void requestTrafficInfo() { CallerLogger.INSTANCE.d(M_HMI + TAG, "requestTrafficInfo"); - CallerNoticeManager.getNoticeProvider().requestAccidentInfo(mPushData.getInfoId(), MoGoAiCloudClientConfig.getInstance().getSn(), new NoticeNetCallBack() { - @Override - public void callBackWithResult(NoticeTrafficStyleInfo trafficInfo) { - CallerLogger.INSTANCE.d(M_HMI + TAG, "交通事故详情::" + trafficInfo); - mTrafficStyleInfo = trafficInfo.getResult().getAccidentInfo(); - infoRefresh(mTrafficStyleInfo); - } + CallerNoticeManager.getNoticeProvider().requestAccidentInfo(mPushData.getInfoId(), MoGoAiCloudClientConfig.getInstance().getSn(), trafficInfo -> { + CallerLogger.INSTANCE.d(M_HMI + TAG, "交通事故详情::" + trafficInfo); + mTrafficStyleInfo = trafficInfo.getResult().getAccidentInfo(); + infoRefresh(mTrafficStyleInfo); }); } @@ -445,6 +438,7 @@ public class NoticeTrafficDialog extends BaseFloatDialog implements LifecycleObs public void dismiss() { super.dismiss(); CallerLogger.INSTANCE.d(M_HMI + TAG, "trafficDialog dismiss"); + MogoStatusManager.getInstance().unregisterStatusChangedListener(M_HMI + TAG, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, statusChangedListenerForNotice); releasePlayer(); } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index d9b49576bf..6ddd5521fc 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -76,7 +76,7 @@ import com.mogo.map.MogoMap import com.mogo.map.MogoMapUIController import com.mogo.map.uicontroller.VisualAngleMode import com.mogo.map.uicontroller.VisualAngleMode.* -import com.mogo.module.service.routeoverlay.* +import com.mogo.eagle.core.function.business.routeoverlay.* import com.zhidao.easysocket.utils.L import com.zhidao.support.adas.high.other.permission.BackgrounderPermission import com.zhjt.mogo_core_function_devatools.env.* diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt index 15bb354561..44ea7d3f56 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt @@ -17,8 +17,7 @@ import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.utilcode.kotlin.currentPadding import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import com.mogo.eagle.core.utilcode.util.ToastUtils -import com.mogo.module.service.routeoverlay.RouteStrategy -import kotlinx.android.synthetic.main.view_debug_setting.view.* +import com.mogo.eagle.core.function.business.routeoverlay.RouteStrategy import kotlinx.android.synthetic.main.view_sop_setting.view.* import kotlinx.android.synthetic.main.view_sop_setting.view.tbRouteDynamicEffect diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AdUpgradeDialog.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AdUpgradeDialog.kt index d4abbc8aac..de7c4e75b8 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AdUpgradeDialog.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AdUpgradeDialog.kt @@ -4,7 +4,7 @@ import android.content.Context import android.widget.TextView import androidx.lifecycle.LifecycleObserver import com.mogo.eagle.core.function.hmi.R -import com.mogo.module.common.dialog.BaseFloatDialog +import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog /** * @author XuXinChao diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/DockerRebootDialog.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/DockerRebootDialog.kt index 831b2716fe..e4ed66d642 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/DockerRebootDialog.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/DockerRebootDialog.kt @@ -4,7 +4,7 @@ import android.content.Context import android.widget.TextView import androidx.lifecycle.LifecycleObserver import com.mogo.eagle.core.function.hmi.R -import com.mogo.module.common.dialog.BaseFloatDialog +import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog /** * @author XuXinChao diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/AutoPilotStatusView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/AutoPilotStatusView.kt index c689d665ad..472d250d3e 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/AutoPilotStatusView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/AutoPilotStatusView.kt @@ -18,7 +18,6 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI import com.mogo.eagle.core.utilcode.util.ToastUtils import com.mogo.eagle.core.utilcode.util.UiThreadHandler -import com.mogo.module.common.MogoApisHandler import kotlinx.android.synthetic.main.view_autopilot_status.view.* /** diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/PerspectiveSwitchView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/PerspectiveSwitchView.kt index 4caa7e4038..df4e2a1d15 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/PerspectiveSwitchView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/PerspectiveSwitchView.kt @@ -1,15 +1,13 @@ package com.mogo.eagle.core.function.hmi.ui.widget -import android.content.* -import android.util.* -import android.view.* -import android.widget.* -import com.mogo.commons.* +import android.content.Context +import android.util.AttributeSet +import android.view.LayoutInflater +import android.view.View +import android.widget.FrameLayout import com.mogo.eagle.core.function.hmi.R -import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.* -import com.mogo.map.* -import com.mogo.map.uicontroller.* -import com.mogo.module.common.constants.* +import com.mogo.map.MogoMapUIController +import com.mogo.map.uicontroller.VisualAngleMode import kotlinx.android.synthetic.main.view_perspective_switch.view.* /** @@ -34,17 +32,20 @@ class PerspectiveSwitchView @JvmOverloads constructor( if (MogoMapUIController.getInstance().currentMapVisualAngle.isLongSight) { // MogoMarkerManager.getInstance(AbsMogoApplication.getApp()) // .visibleAllMarkers() - MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null) + MogoMapUIController.getInstance() + .changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null) textSwitch.setText(R.string.module_map_model_normal) } else if (MogoMapUIController.getInstance().currentMapVisualAngle.isMediumSight) { // MogoMarkerManager.getInstance(AbsMogoApplication.getApp()) // .inVisibleWithoutMarkers(DataTypes.TYPE_MARKER_ADAS) - MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null) + MogoMapUIController.getInstance() + .changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null) textSwitch.setText(R.string.module_map_model_faster) } else { // MogoMarkerManager.getInstance(AbsMogoApplication.getApp()) // .visibleAllMarkers() - MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null) + MogoMapUIController.getInstance() + .changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null) textSwitch.setText(R.string.module_map_model_normal) } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainActivity.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainActivity.java index bded69ba63..a7748622dc 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainActivity.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainActivity.java @@ -28,8 +28,10 @@ import com.kwai.koom.base.MonitorManager; import com.kwai.koom.nativeoom.leakmonitor.LeakMonitor; import com.kwai.koom.nativeoom.leakmonitor.LeakMonitorConfig; import com.kwai.koom.nativeoom.leakmonitor.LeakRecord; +import com.mogo.commons.analytics.AnalyticsUtils; import com.mogo.commons.context.ContextHolderUtil; import com.mogo.commons.debug.DebugConfig; +import com.mogo.commons.module.status.MogoStatusManager; import com.mogo.commons.mvp.BaseFragment; import com.mogo.commons.mvp.MvpActivity; import com.mogo.commons.mvp.MvpFragment; @@ -58,10 +60,6 @@ import com.mogo.map.listener.MogoMapListenerHandler; import com.mogo.map.location.IMogoLocationListener; import com.mogo.map.uicontroller.EnumMapUI; import com.mogo.map.uicontroller.IMogoMapUIController; -import com.mogo.module.common.MogoApisHandler; -import com.mogo.service.IMogoServiceApis; -import com.mogo.service.fragmentmanager.FragmentStackTransactionListener; -import com.mogo.service.statusmanager.IMogoStatusManager; import com.rousetime.android_startup.StartupManager; import com.rousetime.android_startup.model.LoggerLevel; import com.rousetime.android_startup.model.StartupConfig; @@ -85,15 +83,11 @@ import system_master.SystemStatusInfo; */ public class MainActivity extends MvpActivity implements MainView, IMogoLocationListener, - FragmentStackTransactionListener, IMoGoAutopilotStatusListener { protected static final String TAG = "MainActivity"; private static final int REQUEST_CODE_DIALOG = 100; - protected IMogoServiceApis mServiceApis; - protected IMogoStatusManager mMogoStatusManager; - protected FrameLayout mFloatingLayout; protected View mCoverUpLayout; @@ -103,7 +97,7 @@ public class MainActivity extends MvpActivity implement private RecyclerView mConnectInfoRV; private ConnInfoAdapter mConnAdapter; - private List dataList = new ArrayList<>(); + private final List dataList = new ArrayList<>(); private int mLastStatus = 0x00; private boolean isFloatingLayerHidden = false; @@ -218,16 +212,12 @@ public class MainActivity extends MvpActivity implement properties.put("app_launch_hotStartTime", hotStartTime); } } - MogoApisHandler.getInstance().getApis().getAnalyticsApi().track("app_launch_time", properties); + AnalyticsUtils.track("app_launch_time", properties); } } private void init() { - if (mServiceApis == null) { - mServiceApis = MogoApisHandler.getInstance().getApis(); - } - mMogoStatusManager = mServiceApis.getStatusManagerApi(); - mMogoStatusManager.setMainPageLaunchedStatus(TAG, true); + MogoStatusManager.getInstance().setMainPageLaunchedStatus(TAG, true); } private void initConnectInfoRV() { @@ -275,7 +265,7 @@ public class MainActivity extends MvpActivity implement loadFunctionFragment(); // TODO 这里临时兼容进入VR模式,标记状态机。有些业务(OCH)会根据状态判断加载 - MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode(TAG, true); + MogoStatusManager.getInstance().setVrMode(TAG, true); // 设置地图样式 MogoMapListenerHandler.getInstance().onMapModeChanged(EnumMapUI.MAP_STYLE_DAY_VR); }); @@ -286,21 +276,11 @@ public class MainActivity extends MvpActivity implement loadFunctionMapView(); } - @Override - public void onTransaction(int size) { - if (size == 0) { - showLayout(); - } else if (size == 1) { - hideLayout(); - } - } - /** * 加载其它模块 */ protected void loadOthersModules() { // 加载地图,触发地图加载完毕回调,在初始化其他卡片模块,保证卡片模块可以正确获取地图相关服务。 - MogoModulesManager.getInstance().loadModules(); MogoModulesManager.getInstance().loadFunctionModules(); mPresenter.delayOperations(); MogoModulesManager.getInstance().loadFunctionModulesServer(); @@ -317,8 +297,8 @@ public class MainActivity extends MvpActivity implement * 启动后台服务 */ private void startBaseService() { - Intent intentMainServicee = new Intent(this, MogoMainService.class); - startService(intentMainServicee); + Intent intentMainService = new Intent(this, MogoMainService.class); + startService(intentMainService); // USB 摄像头行车记录仪进程 // Intent intentCarcorderService = new Intent(this, CarcorderService.class); @@ -404,23 +384,20 @@ public class MainActivity extends MvpActivity implement @Override protected void onResume() { super.onResume(); - mMogoStatusManager.setMainPageResumeStatus(TAG, true); - mMogoStatusManager.setMainPageIsBackgroundStatus(TAG, false); + MogoStatusManager.getInstance().setMainPageResumeStatus(TAG, true); + MogoStatusManager.getInstance().setMainPageIsBackgroundStatus(TAG, true); } @Override protected void onPause() { super.onPause(); - mMogoStatusManager.setMainPageResumeStatus(TAG, false); + MogoStatusManager.getInstance().setMainPageResumeStatus(TAG, false); } - @Override protected void onStop() { super.onStop(); - if (mMogoStatusManager != null) { - mMogoStatusManager.setMainPageIsBackgroundStatus(TAG, true); - } + MogoStatusManager.getInstance().setMainPageIsBackgroundStatus(TAG, true); } @Override @@ -431,15 +408,6 @@ public class MainActivity extends MvpActivity implement @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); - mPresenter.handleSchemeIntent(intent, true); - } - - @Override - public IMogoServiceApis getApis() { - if (mServiceApis == null) { - mServiceApis = MogoApisHandler.getInstance().getApis(); - } - return mServiceApis; } @Override @@ -492,17 +460,16 @@ public class MainActivity extends MvpActivity implement listenerRegister.unregisterMarkerClickListener(); listenerRegister.unregisterHostMapListener(); } - mMogoStatusManager.setMainPageLaunchedStatus(TAG, false); - mMogoStatusManager.setMainPageIsBackgroundStatus(TAG, false); - IMogoMapUIController mapUIController = CallerMapUIServiceManager.INSTANCE.getMapUIController(); if (mapUIController != null) { mapUIController.destroy(); } + MogoStatusManager.getInstance().setMainPageLaunchedStatus(TAG, false); + MogoStatusManager.getInstance().setMainPageIsBackgroundStatus(TAG, false); + CallerLogger.INSTANCE.d(M_HMI + TAG, "destroy."); ContextHolderUtil.releaseContext(); MogoModulesManager.getInstance().onDestroy(); - SchemeIntent.getInstance().clear(); FloatingViewHandler.clear(); ProcessUtils.killAllBackgroundProcesses(); } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java index d4ddf1993a..17fb55406f 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java @@ -13,7 +13,6 @@ import android.os.Bundle; import android.os.Handler; import android.os.Process; import android.text.TextUtils; -import android.util.Log; import android.view.KeyEvent; import android.view.MotionEvent; import android.widget.FrameLayout; @@ -22,12 +21,13 @@ import androidx.annotation.Nullable; import com.alibaba.android.arouter.launcher.ARouter; import com.mogo.commons.debug.DebugConfig; +import com.mogo.commons.module.intent.IMogoIntentListener; +import com.mogo.commons.module.intent.IntentManager; import com.mogo.eagle.core.data.config.FunctionBuildConfig; import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider; import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; -import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager; import com.mogo.eagle.core.function.hmi.R; import com.mogo.eagle.core.function.main.moujie.BluetoothMonitorReceiver; @@ -36,8 +36,6 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr; import com.mogo.eagle.core.utilcode.util.ToastUtils; -import com.mogo.eagle.core.utilcode.util.UiThreadHandler; -import com.mogo.service.intent.IMogoIntentListener; import com.rousetime.android_startup.model.CostTimesModel; import com.zhjt.service.chain.ChainLog; import com.zhjt.service.chain.TracingConstants; @@ -48,7 +46,6 @@ import org.greenrobot.eventbus.ThreadMode; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.util.ArrayList; import java.util.List; import java.util.Set; import java.util.Timer; @@ -73,7 +70,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis private BluetoothMonitorReceiver mBluetoothReceiver = null; private BluetoothAdapter mBluetoothAdapter; -// private List mAreadlyConnectedList = new ArrayList<>();//已连接设备集合 + // private List mAreadlyConnectedList = new ArrayList<>();//已连接设备集合 private int numberA = 0; private boolean isLongPressA = false; private int numberB = 0; @@ -123,7 +120,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis @Override protected void onStart() { super.onStart(); - getApis().getIntentManagerApi().registerIntentListener(Intent.ACTION_CLOSE_SYSTEM_DIALOGS, this); + IntentManager.getInstance().registerIntentListener(Intent.ACTION_CLOSE_SYSTEM_DIALOGS, this); // 添加换肤监听 CallerSkinModeListenerManager.INSTANCE.addListener(TAG, this); //ActivityLifecycleManager.getInstance().setAppActive(true); @@ -138,7 +135,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis @Override protected void onStop() { super.onStop(); - getApis().getIntentManagerApi().unregisterIntentListener(Intent.ACTION_CLOSE_SYSTEM_DIALOGS, this); + IntentManager.getInstance().unregisterIntentListener(Intent.ACTION_CLOSE_SYSTEM_DIALOGS, this); //ActivityLifecycleManager.getInstance().setAppActive(false); } @@ -381,7 +378,6 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis /** * 查找蓝牙连接过的蓝牙设备 - * */ private void showBondedDevice(BluetoothAdapter bluetoothAdapter) { // mAreadlyConnectedList.clear(); diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java index 2c01c33429..3fc2839ae2 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java @@ -10,6 +10,8 @@ import com.elegant.utils.UiThreadHandler; import com.mogo.cloud.socket.SocketBuildConfig; import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.debug.DebugConfig; +import com.mogo.commons.module.MogoModule; +import com.mogo.commons.module.MogoModulePaths; import com.mogo.commons.voice.AIAssist; import com.mogo.eagle.core.data.config.FunctionBuildConfig; import com.mogo.eagle.core.data.constants.MoGoConfig; @@ -17,7 +19,6 @@ import com.mogo.eagle.core.data.constants.MogoServicePaths; import com.mogo.eagle.core.function.api.chat.biz.ChatConsts; import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager; import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager; -import com.mogo.eagle.core.function.notice.PushUIConstants; import com.mogo.eagle.core.function.overview.OverviewDb; import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils; import com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils; @@ -25,9 +26,6 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr; import com.mogo.eagle.core.utilcode.util.ProcessUtils; import com.mogo.map.MapApiPath; -import com.mogo.module.common.MogoModule; -import com.mogo.module.common.MogoModulePaths; -import com.mogo.module.service.ServiceConst; import com.zhidao.support.obu.ami.AmiClientManager; import com.zhjt.mogo_core_function_devatools.monitor.db.CpuInfo; import com.zhjt.mogo_core_function_devatools.monitor.db.MemInfo; @@ -138,7 +136,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication { MogoModulePaths.addModuleFunction(new MogoModule("/och/api", "IMoGoFunctionProvider")); MogoModulePaths.addBaseModule(new MogoModule(MapApiPath.PATH, "CustomMapApiBuilder")); - MogoModulePaths.addBaseModule(new MogoModule(ServiceConst.PATH_REFRESH_STRATEGY, ServiceConst.PATH_REFRESH_STRATEGY)); // MogoModulePaths.addBaseModule(new MogoModule(V2XConst.PATH_V2X_UI, V2XConst.MODULE_NAME)); // OBU 模块 @@ -155,8 +152,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication { MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_V2X_MODULE, "V2XProvider")); // 自动驾驶系统检测模块 MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_CHECK, "CheckProvider")); - // 推送模块 - MogoModulePaths.addModule(new MogoModule(PushUIConstants.PATH, "PUSH_UI")); // 绑定车辆 MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_BINDING_CAR, "IMoGoBindingcarProvider")); diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainPresenter.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainPresenter.java index 4880a355a2..c679dcc4e2 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainPresenter.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainPresenter.java @@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.main; import android.Manifest; import android.app.Activity; -import android.content.Intent; import android.content.pm.PackageManager; import android.os.Handler; import android.os.Looper; @@ -43,7 +42,6 @@ public class MainPresenter extends Presenter { public MainPresenter(MainView view) { super(view); - SchemeIntent.getInstance().init(getContext(), mView.getApis()); } @Override @@ -109,7 +107,4 @@ public class MainPresenter extends Presenter { mMsgHandler.sendMessage(msg); } - public void handleSchemeIntent(Intent intent, boolean isOnNewIntent) { - SchemeIntent.getInstance().handle(intent, isOnNewIntent); - } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainView.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainView.java index 94b4cdc981..a566efdfda 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainView.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainView.java @@ -26,11 +26,4 @@ public interface MainView extends IView { */ void loadModules(); - /** - * 接口水龙头 - * - * @return - */ - IMogoServiceApis getApis(); - } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/SchemeIntent.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/SchemeIntent.java deleted file mode 100644 index cddf2eae4d..0000000000 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/SchemeIntent.java +++ /dev/null @@ -1,204 +0,0 @@ -package com.mogo.eagle.core.function.main; - -import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI; - -import android.content.Context; -import android.content.Intent; -import android.net.Uri; -import android.text.TextUtils; - -import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; -import com.mogo.eagle.core.utilcode.util.CommonUtils; -import com.mogo.eagle.core.utilcode.util.UiThreadHandler; -import com.mogo.service.IMogoServiceApis; -import com.mogo.service.statusmanager.IMogoStatusChangedListener; -import com.mogo.service.statusmanager.StatusDescriptor; - -import java.util.HashMap; -import java.util.Map; - -/** - * @author congtaowang - * @since 2020-04-20 - *

- * scheme 意图处理 - *

- * 导航:adb shell am start -d "mogo://launcher/main/switch2?type=navi'&'lon=116.327007'&'lat=39.977639" - */ -public class SchemeIntent implements IMogoStatusChangedListener { - - private static final String TAG = "SchemeIntent"; - - public static final String TYPE_NAVI = "navi"; - - public static final String TYPE_SEARCH_ROAD_CONDITION = "search-road-condition"; - - public static final String TYPE_LAUNCH = "launch"; - - public static final String TYPE_SHOW_ONLINE_CAR_PANEL = "showOnlineCarPanel"; - - public static final String TYPE_SHOW_SHARE_PANEL = "showSharePanel"; - public static final String TYPE_SHOW_HISTORY_PANEL = "showHistoryPanel"; - public static final String TYPE_SHOW_SURROUNDING_PANEL = "showSurroundingPanel"; - - private IMogoServiceApis mApis; - private Context mContext; - - private IntentWrapper mNextIntent; - - private static class IntentWrapper { - public Intent mIntent; - public long mDelay; - - public IntentWrapper(Intent intent, long delay) { - this.mIntent = intent; - this.mDelay = delay; - } - } - - private static volatile SchemeIntent sInstance; - - private SchemeIntent() { - } - - public static SchemeIntent getInstance() { - if (sInstance == null) { - synchronized (SchemeIntent.class) { - if (sInstance == null) { - sInstance = new SchemeIntent(); - } - } - } - return sInstance; - } - - public synchronized void release() { - sInstance = null; - } - - public void init(Context context, IMogoServiceApis apis) { - mContext = context; - mApis = apis; - mApis.getStatusManagerApi().registerStatusChangedListener(TAG, StatusDescriptor.MAIN_PAGE_RESUME, this); - } - - public void clear() { - mApis.getStatusManagerApi().unregisterStatusChangedListener(TAG, StatusDescriptor.MAIN_PAGE_RESUME, this); - mContext = null; - mApis = null; - - } - - /** - * 处理scheme - * - * @param intent 跳转的intent - * @param isOnNewIntent 根据这个参数判断是从onCreate过来还是从onNewIntent过来,从而可以在{@link #isDelay(Intent, boolean)}里面确定延时逻辑,如果是从onNewIntent过来是不需要延时的 - */ - public void handle(Intent intent, boolean isOnNewIntent) { - if (intent == null || intent.getData() == null) { - return; - } - Uri target = intent.getData(); - String path = target.getPath(); - if (path == null || path.isEmpty()) { - return; - } - - if (!mApis.getStatusManagerApi().isMainPageOnResume()) { - long delay = 0L; - if (isDelay(intent, isOnNewIntent)) { - delay = 5_000L; - } - mNextIntent = new IntentWrapper(intent, delay); - return; - } - - switch (path) { - case "/main/switch2": - handleSwitch2Action(target); - break; - case "/main/share": - CallerLogger.INSTANCE.d(M_HMI + TAG, "收到打开分享框的scheme,准备打开分享框"); -// Map properties = new HashMap<>(); -// properties.put("from", "1"); -// mApis.getAnalyticsApi().track("v2x_share_click", properties); -// mApis.getShareManager().showShareDialog(); - break; - default: - break; - } - - - mNextIntent = null; - } - - private boolean isDelay(Intent intent, boolean isOnNewIntent) { - if (isOnNewIntent || intent == null || intent.getData() == null) { - return false; - } - Uri target = intent.getData(); - String type = target.getQueryParameter("type"); - return TextUtils.equals(TYPE_NAVI, type) || TextUtils.equals(TYPE_SHOW_SHARE_PANEL, type); - } - - private void handleSwitch2Action(Uri target) { - String type = target.getQueryParameter("type"); - if (TextUtils.isEmpty(type)) { - return; - } - CallerLogger.INSTANCE.d(M_HMI + TAG, "语音打开事件面板" + type); - switch (type) { - case TYPE_LAUNCH: - handleLaunchIntent(target); - break; - case TYPE_SHOW_HISTORY_PANEL: - handleShowEventPanel(0); - break; - case TYPE_SHOW_SURROUNDING_PANEL: - handleShowEventPanel(1); - break; - case TYPE_SHOW_SHARE_PANEL: - handleShowEventPanel(2); - break; - default: - break; - - } - } - - private void handleLaunchIntent(Uri uri) { - String type = uri.getQueryParameter("channelType"); - Map properties = new HashMap<>(); - properties.put("appname", CommonUtils.getAppName(mContext)); - properties.put("appversion", CommonUtils.getVersionName(mContext)); - properties.put("from", type); - mApis.getAnalyticsApi().track("appenterfront", properties); - } - - /** - * 语音打开事件面板 - */ - private void handleShowEventPanel(int item) { - CallerLogger.INSTANCE.d(M_HMI + TAG, "语音打开事件面板" + item); - //mApis.getEventPanelManager().showPanelWithSelectedItem(item); - } - - @Override - public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) { - if (descriptor == StatusDescriptor.MAIN_PAGE_RESUME) { - if (mNextIntent == null) { - return; - } - if (isTrue) { - // 保证回到桌面后在开始该规划路线。 - UiThreadHandler.postDelayed(() -> { - if (mNextIntent == null) { - return; - } - handle(mNextIntent.mIntent, false); - }, mNextIntent.mDelay); - } - } - } -} diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/cards/MogoModulesHandler.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/cards/MogoModulesHandler.java index 9de2412f78..a29dc98c19 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/cards/MogoModulesHandler.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/cards/MogoModulesHandler.java @@ -8,11 +8,6 @@ package com.mogo.eagle.core.function.main.cards; */ public interface MogoModulesHandler { - /** - * 加载模块 - */ - void loadModules(); - /** * 架构升级v1.1加载功能模块 */ @@ -27,7 +22,6 @@ public interface MogoModulesHandler { * 加载基本服务模块,需要不启动页面就能运行 *

* 1. v2x - * 2. mogo-module-service */ void loadBaseModule(); diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/cards/MogoModulesManager.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/cards/MogoModulesManager.java index 11ac8711e2..c62981d154 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/cards/MogoModulesManager.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/cards/MogoModulesManager.java @@ -5,18 +5,14 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI import android.app.Application; import android.content.Context; -import androidx.fragment.app.Fragment; - import com.alibaba.android.arouter.facade.template.IProvider; import com.alibaba.android.arouter.launcher.ARouter; +import com.mogo.commons.module.MogoModule; +import com.mogo.commons.module.MogoModulePaths; import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider; import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider; -import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.function.main.MainActivity; -import com.mogo.eagle.core.utilcode.mogo.toast.ResourcesHelper; -import com.mogo.module.common.MogoModule; -import com.mogo.module.common.MogoModulePaths; -import com.mogo.service.module.IMogoModuleProvider; +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import java.util.Collection; import java.util.HashMap; @@ -35,18 +31,15 @@ public class MogoModulesManager implements MogoModulesHandler { private MainActivity mActivity; private Application mApp; - - private Map mModuleProviders = new HashMap<>(); - // 空间换效率 - private Map mModuleNameProviders = new HashMap<>(); + private static final byte[] obj = new byte[0]; // 架构升级后的加载功能模块的方式 - private Map mModuleFunctionProviders = new HashMap<>(); - private Map mModuleNameFunctionProviders = new HashMap<>(); + private final Map mModuleFunctionProviders = new HashMap<>(); + private final Map mModuleNameFunctionProviders = new HashMap<>(); // 架构升级后的加载功能模块的方式 - private Map mModuleFunctionServerProviders = new HashMap<>(); - private Map mModuleNameFunctionServerProviders = new HashMap<>(); + private final Map mModuleFunctionServerProviders = new HashMap<>(); + private final Map mModuleNameFunctionServerProviders = new HashMap<>(); private static volatile MogoModulesManager sInstance; @@ -55,7 +48,7 @@ public class MogoModulesManager implements MogoModulesHandler { public static MogoModulesManager getInstance() { if (sInstance == null) { - synchronized (MogoModulesManager.class) { + synchronized (obj) { if (sInstance == null) { sInstance = new MogoModulesManager(); } @@ -84,21 +77,6 @@ public class MogoModulesManager implements MogoModulesHandler { return mApp; } - @Override - public void loadModules() { - final List modules = MogoModulePaths.getModules(); - if (modules != null && !modules.isEmpty()) { - for (MogoModule module : modules) { - CallerLogger.INSTANCE.d(M_HMI + TAG, "module.getPath():" + module.getPath() + " name: " + module.getName()); - IMogoModuleProvider provider = load(module.getPath()); - if (provider != null) { - mModuleProviders.put(module, provider); - mModuleNameProviders.put(module.getName(), provider); - } - } - } - } - @Override public void loadFunctionModules() { final List modules = MogoModulePaths.getModuleFunctions(); @@ -151,15 +129,6 @@ public class MogoModulesManager implements MogoModulesHandler { } } - private IMogoModuleProvider load(String path) { - try { - return (IMogoModuleProvider) ARouter.getInstance().build(path).navigation(getContext()); - } catch (Exception e) { - e.printStackTrace(); - return null; - } - } - private IMoGoFunctionProvider loadFunction(String path) { try { return (IMoGoFunctionProvider) ARouter.getInstance().build(path).navigation(getContext()); @@ -178,45 +147,8 @@ public class MogoModulesManager implements MogoModulesHandler { } } - private void addFragment(IMogoModuleProvider provider, int containerId) { - if (provider == null) { - CallerLogger.INSTANCE.e(M_HMI + TAG, "add fragment fail cause provider == null, container is " + ResourcesHelper.getResNameById(getApplicationContext(), containerId)); - return; - } - Fragment fragment = null; - fragment = mActivity.getSupportFragmentManager().findFragmentByTag(provider.getModuleName()); - if (fragment == null) { - fragment = provider.createFragment(getContext(), null); - } - if (fragment == null) { - CallerLogger.INSTANCE.e(M_HMI + TAG, "add fragment fail cause fragment == null, container is " + ResourcesHelper.getResNameById(getApplicationContext(), containerId)); - return; - } - mActivity.getSupportFragmentManager().beginTransaction() - .replace(containerId, fragment, provider.getModuleName()) - .commitAllowingStateLoss(); - } - - @Override public void onDestroy() { - if (mModuleNameProviders != null) { - Collection modules = mModuleNameProviders.values(); - if (modules != null) { - for (IMogoModuleProvider module : modules) { - try { - CallerLogger.INSTANCE.d(M_HMI + TAG, "destroy module: " + module.getModuleName()); - module.onDestroy(); - } catch (Exception e) { - CallerLogger.INSTANCE.e(M_HMI + TAG, e + " onDestroy"); - } - } - } - mModuleNameProviders.clear(); - } - if (mModuleProviders != null) { - mModuleProviders.clear(); - } if (mModuleFunctionProviders != null) { Collection modules = mModuleFunctionProviders.values(); if (modules != null) { diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/service/MogoMainService.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/service/MogoMainService.java index c8c2bd0bad..10b2268c27 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/service/MogoMainService.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/service/MogoMainService.java @@ -21,8 +21,6 @@ import com.mogo.eagle.core.utilcode.util.UiThreadHandler; import com.mogo.map.location.IMogoLocationClient; import com.mogo.map.location.IMogoLocationListener; import com.mogo.map.navi.MogoCarLocationChangedListenerRegister; -import com.mogo.module.common.MogoApisHandler; -import com.mogo.service.IMogoServiceApis; public /** @@ -35,7 +33,6 @@ public class MogoMainService extends Service implements IMogoLocationListener { private static final String TAG = "MogoMainService"; - private IMogoServiceApis mServiceApis; /** * 主模块管控定位,可以向各个模块发送统一定位信息 @@ -45,7 +42,6 @@ class MogoMainService extends Service implements IMogoLocationListener { @Override public void onCreate() { CallerLogger.INSTANCE.d(M_HMI + TAG, "基本服务启动"); - mServiceApis = MogoApisHandler.getInstance().getApis(); initAndStartLocation(); UiThreadHandler.postDelayed(() -> { CallerLogger.INSTANCE.d(M_HMI + TAG, "5秒已过,启动基础服务……"); @@ -106,6 +102,5 @@ class MogoMainService extends Service implements IMogoLocationListener { mLocationClient.destroy(); mLocationClient = null; } - mServiceApis = null; } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/utils/DisplayEffectsManager.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/utils/DisplayEffectsManager.java deleted file mode 100644 index d69b60df8c..0000000000 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/utils/DisplayEffectsManager.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.mogo.eagle.core.function.main.utils; - -import android.content.Context; - -import com.alibaba.android.arouter.facade.annotation.Route; -import com.mogo.eagle.core.data.constants.MogoServicePaths; -import com.mogo.service.v2x.DisplayEffectsInterface; - -/** - * created by wujifei on 2021/3/30 15:45 - * describe: - */ -@Route(path = MogoServicePaths.PATH_MAIN_DISPLAY_EFFECTS_MANAGER) -public class DisplayEffectsManager implements DisplayEffectsInterface { - private Context context; - - @Override - public void init(Context context) { - this.context = context; - } - - @Override - public void displayEffects(String type) { - DisplayEffectsHelper.getInstance().display(); - } - -} diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/windowview/MogoWindowManager.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/windowview/FloatViewManager.java similarity index 89% rename from core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/windowview/MogoWindowManager.java rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/windowview/FloatViewManager.java index c9dbe7acf4..10bf3eaf54 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/windowview/MogoWindowManager.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/windowview/FloatViewManager.java @@ -6,7 +6,7 @@ import android.widget.FrameLayout; import com.alibaba.android.arouter.facade.annotation.Route; import com.mogo.eagle.core.data.constants.MogoServicePaths; -import com.mogo.service.windowview.IMogoWindowManager; +import com.mogo.eagle.core.function.api.hmi.view.IViewLayoutSet; /** * @author congtaowang @@ -14,8 +14,8 @@ import com.mogo.service.windowview.IMogoWindowManager; *

* 根据优先级控制显示 window view. */ -@Route( path = MogoServicePaths.PATH_WINDOW_MANAGER ) -public class MogoWindowManager implements IMogoWindowManager { +@Route( path = MogoServicePaths.PATH_FLOAT_VIEW_MANAGER ) +public class FloatViewManager implements IViewLayoutSet { @Override public void addView( View view, int x, int y, boolean movable ) { diff --git a/modules/mogo-module-common/src/main/res/drawable/module_commons_shape_dlg_round_bkg.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/module_commons_shape_dlg_round_bkg.xml similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable/module_commons_shape_dlg_round_bkg.xml rename to core/function-impl/mogo-core-function-hmi/src/main/res/drawable/module_commons_shape_dlg_round_bkg.xml diff --git a/modules/mogo-module-common/src/main/res/drawable/module_commons_shape_left_btn_bkg.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/module_commons_shape_left_btn_bkg.xml similarity index 68% rename from modules/mogo-module-common/src/main/res/drawable/module_commons_shape_left_btn_bkg.xml rename to core/function-impl/mogo-core-function-hmi/src/main/res/drawable/module_commons_shape_left_btn_bkg.xml index a1038a702d..94bbe93c7b 100644 --- a/modules/mogo-module-common/src/main/res/drawable/module_commons_shape_left_btn_bkg.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/module_commons_shape_left_btn_bkg.xml @@ -1,14 +1,11 @@ - - + - + diff --git a/modules/mogo-module-common/src/main/res/drawable/module_commons_shape_right_btn_bkg.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/module_commons_shape_right_btn_bkg.xml similarity index 72% rename from modules/mogo-module-common/src/main/res/drawable/module_commons_shape_right_btn_bkg.xml rename to core/function-impl/mogo-core-function-hmi/src/main/res/drawable/module_commons_shape_right_btn_bkg.xml index d570e1ef36..171d2f183a 100644 --- a/modules/mogo-module-common/src/main/res/drawable/module_commons_shape_right_btn_bkg.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/module_commons_shape_right_btn_bkg.xml @@ -1,11 +1,12 @@ - + - + diff --git a/modules/mogo-module-common/src/main/res/layout/module_commons_layout_wm_dialog.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/module_commons_layout_wm_dialog.xml similarity index 88% rename from modules/mogo-module-common/src/main/res/layout/module_commons_layout_wm_dialog.xml rename to core/function-impl/mogo-core-function-hmi/src/main/res/layout/module_commons_layout_wm_dialog.xml index 0e321bd1c8..9f2aab6b7e 100644 --- a/modules/mogo-module-common/src/main/res/layout/module_commons_layout_wm_dialog.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/module_commons_layout_wm_dialog.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@color/module_commons_dlg_bkg" + android:background="@color/color_99000000" android:layout_gravity="center"> - - + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml index 630730aace..673fe26115 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml @@ -40,6 +40,7 @@ #FF2966EC #FFA7B6F0 #B3FFFFFF + #99000000 #6D7BAF diff --git a/core/function-impl/mogo-core-function-map/build.gradle b/core/function-impl/mogo-core-function-map/build.gradle index b57b7098e4..87a85a74c5 100644 --- a/core/function-impl/mogo-core-function-map/build.gradle +++ b/core/function-impl/mogo-core-function-map/build.gradle @@ -94,7 +94,6 @@ dependencies { implementation project(":libraries:mogo-map") implementation project(":libraries:mogo-map-api") implementation project(':libraries:mogo-adas') - implementation project(':modules:mogo-module-service') } } diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapPointCloudSubscriber.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/MapPointCloudSubscriber.kt similarity index 98% rename from core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapPointCloudSubscriber.kt rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/MapPointCloudSubscriber.kt index f49b4d1804..55abf0e583 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapPointCloudSubscriber.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/MapPointCloudSubscriber.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.map +package com.mogo.eagle.core.function.business import com.mogo.eagle.core.data.app.AppConfigInfo import com.mogo.eagle.core.data.config.FunctionBuildConfig diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/collect/MoGoMapDataCollectProvider.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/collect/MoGoMapDataCollectProvider.kt similarity index 99% rename from core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/collect/MoGoMapDataCollectProvider.kt rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/collect/MoGoMapDataCollectProvider.kt index 5a502c897f..5b9ea36461 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/collect/MoGoMapDataCollectProvider.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/collect/MoGoMapDataCollectProvider.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.impl.collect +package com.mogo.eagle.core.function.business.collect import android.content.Context import android.text.TextUtils diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/CircleQueue.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/CircleQueue.java similarity index 95% rename from core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/CircleQueue.java rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/CircleQueue.java index 5673c2ed2d..5f7b50180e 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/CircleQueue.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/CircleQueue.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.map.identify; +package com.mogo.eagle.core.function.business.identify; import java.util.List; import java.util.Vector; diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/Identify.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/Identify.kt similarity index 88% rename from core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/Identify.kt rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/Identify.kt index 53f3dfac50..e3ba3c913b 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/Identify.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/Identify.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.map.identify +package com.mogo.eagle.core.function.business.identify import com.mogo.eagle.core.data.traffic.TrafficData import mogo.telematics.pad.MessagePad diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/IdentifyBeautifyDataDrawer.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyBeautifyDataDrawer.kt similarity index 91% rename from core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/IdentifyBeautifyDataDrawer.kt rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyBeautifyDataDrawer.kt index 3af4a12431..aa8a35caf9 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/IdentifyBeautifyDataDrawer.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyBeautifyDataDrawer.kt @@ -1,11 +1,11 @@ -package com.mogo.eagle.core.function.map.identify +package com.mogo.eagle.core.function.business.identify import android.annotation.SuppressLint import com.mogo.commons.AbsMogoApplication +import com.mogo.commons.module.status.MogoStatusManager import com.mogo.eagle.core.data.traffic.TrafficData import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.w import com.mogo.map.MogoMarkerManager -import com.mogo.module.common.MogoApisHandler import mogo.telematics.pad.MessagePad import mogo.telematics.pad.MessagePad.TrackedObject @@ -38,7 +38,7 @@ class IdentifyBeautifyDataDrawer : Identify { w(TAG, "感知数据为空无需渲染……") return } - if (!MogoApisHandler.getInstance().apis.statusManagerApi.isVrMode) { + if (!MogoStatusManager.getInstance().isVrMode) { TrackManager.getInstance().clearAll() w(TAG, "渲染 adas 识别的数据 当前不是VR模式") return diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/IdentifyFactory.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyFactory.kt similarity index 98% rename from core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/IdentifyFactory.kt rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyFactory.kt index b68a400241..78e56df4f0 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/IdentifyFactory.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyFactory.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.map.identify +package com.mogo.eagle.core.function.business.identify import android.os.Handler import android.os.Message diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/IdentifyOriginDataDrawer.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyOriginDataDrawer.kt similarity index 91% rename from core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/IdentifyOriginDataDrawer.kt rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyOriginDataDrawer.kt index d4c3e3d62b..72052c3a59 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/IdentifyOriginDataDrawer.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyOriginDataDrawer.kt @@ -1,12 +1,12 @@ -package com.mogo.eagle.core.function.map.identify +package com.mogo.eagle.core.function.business.identify import android.annotation.SuppressLint import androidx.collection.ArraySet import com.mogo.commons.AbsMogoApplication +import com.mogo.commons.module.status.MogoStatusManager import com.mogo.eagle.core.data.traffic.TrafficData import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.w import com.mogo.map.MogoMarkerManager -import com.mogo.module.common.MogoApisHandler import mogo.telematics.pad.MessagePad.PlanningObject import mogo.telematics.pad.MessagePad.TrackedObject import java.util.concurrent.ConcurrentHashMap @@ -60,7 +60,7 @@ class IdentifyOriginDataDrawer : Identify { w(TAG, "感知数据为空无需渲染……") return } - if (!MogoApisHandler.getInstance().apis.statusManagerApi.isVrMode) { + if (!MogoStatusManager.getInstance().isVrMode) { clearOldMarker() w(TAG, "渲染 adas 识别的数据 当前不是VR模式") return @@ -69,7 +69,7 @@ class IdentifyOriginDataDrawer : Identify { //清除缓存 for (data in resultList) { if (trafficDataUuidList.size > 0 && trafficDataUuidList.contains("" + data.uuid)) { - if (TrackerSourceHelper.filterData(data)) { + if (TrackerSourceColorHelper.filterData(data)) { continue } trafficDataUuidList.remove("" + data.uuid) @@ -105,7 +105,7 @@ class IdentifyOriginDataDrawer : Identify { trafficDataUuidList.clear() for (data in trafficData) { // 过滤掉未知感知数据 - if (TrackerSourceHelper.filterData(data)) { + if (TrackerSourceColorHelper.filterData(data)) { continue } var temp: TrackedObject = data @@ -113,7 +113,7 @@ class IdentifyOriginDataDrawer : Identify { //首次过来的数据不添加,首次未添加的感知物在调用完绘制方法后再塞入cache map val cacheData = mMarkersCaches[uuid] if (cacheData != null) { - val color = TrackerSourceHelper.getDefaultColor(data) + val color = TrackerSourceColorHelper.getDefaultColor(data) temp = data.toBuilder().setColor(color).build() mFilterTrafficData[uuid] = temp } diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/KalmanFilter.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/KalmanFilter.java similarity index 96% rename from core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/KalmanFilter.java rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/KalmanFilter.java index 5c55acd4ee..eae66e846c 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/KalmanFilter.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/KalmanFilter.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.map.identify; +package com.mogo.eagle.core.function.business.identify; public class KalmanFilter { private final double q = 1.0E-6D; diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapIdentifySubscriber.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/MapIdentifySubscriber.kt similarity index 95% rename from core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapIdentifySubscriber.kt rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/MapIdentifySubscriber.kt index ef9648297a..d9a344ec2e 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapIdentifySubscriber.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/MapIdentifySubscriber.kt @@ -1,10 +1,9 @@ -package com.mogo.eagle.core.function.map +package com.mogo.eagle.core.function.business.identify import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener import com.mogo.eagle.core.function.api.base.IMoGoSubscriber import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager -import com.mogo.eagle.core.function.map.identify.IdentifyFactory import com.mogo.eagle.core.utilcode.util.ThreadUtils import mogo.telematics.pad.MessagePad import mogo.telematics.pad.MessagePad.TrackedObject diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/ObjQueue.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/ObjQueue.java similarity index 95% rename from core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/ObjQueue.java rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/ObjQueue.java index 0835a5ea5a..5a22cac04a 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/ObjQueue.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/ObjQueue.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.map.identify; +package com.mogo.eagle.core.function.business.identify; public class ObjQueue { diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/PlanningTrack.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/PlanningTrack.kt similarity index 54% rename from core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/PlanningTrack.kt rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/PlanningTrack.kt index c6b4c2ce6c..2b6fbe95fb 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/PlanningTrack.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/PlanningTrack.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.map.identify +package com.mogo.eagle.core.function.business.identify data class PlanningTrack(var color: String, var time: Double) { } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/TrackManager.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackManager.java similarity index 95% rename from core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/TrackManager.java rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackManager.java index 9f78e3575f..907f04ce8d 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/TrackManager.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackManager.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.map.identify; +package com.mogo.eagle.core.function.business.identify; import android.annotation.SuppressLint; import android.os.Build; @@ -76,13 +76,13 @@ public class TrackManager { mFilterTrafficData.clear(); //进入过滤机制的感知物体,首先从缓存队列中进行查找 uuid for (MessagePad.TrackedObject data : trafficData) { - if (TrackerSourceHelper.INSTANCE.filterData(data)) { + if (TrackerSourceColorHelper.INSTANCE.filterData(data)) { continue; } String uuid = "" + data.getUuid(); TrackObj trackObj = mMarkersCaches.get(uuid); - String color = TrackerSourceHelper.INSTANCE.getDefaultColor(data); + String color = TrackerSourceColorHelper.INSTANCE.getDefaultColor(data); data = data.toBuilder().setColor(color).build(); if (trackObj != null) { @@ -131,7 +131,7 @@ public class TrackManager { //过滤现有元素 for (MessagePad.TrackedObject data : resultList) { String uuid = "" + data.getUuid(); - if (TrackerSourceHelper.INSTANCE.filterData(data)) { + if (TrackerSourceColorHelper.INSTANCE.filterData(data)) { continue; } if (trafficDataUuid.size() > 0) { diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/TrackObj.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackObj.java similarity index 98% rename from core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/TrackObj.java rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackObj.java index d903e835b4..2048c4f06a 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/TrackObj.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackObj.java @@ -1,9 +1,8 @@ -package com.mogo.eagle.core.function.map.identify; +package com.mogo.eagle.core.function.business.identify; -import static com.mogo.eagle.core.function.map.identify.TrackManager.LIMIT_SPEED; +import static com.mogo.eagle.core.function.business.identify.TrackManager.LIMIT_SPEED; import android.annotation.SuppressLint; -import android.util.Log; import com.mogo.cloud.commons.utils.CoordinateUtils; import com.mogo.eagle.core.data.enums.TrafficTypeEnum; diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/TrackerSourceHelper.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackerSourceColorHelper.kt similarity index 97% rename from core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/TrackerSourceHelper.kt rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackerSourceColorHelper.kt index 0b80a57e4a..49a52b6033 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/TrackerSourceHelper.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackerSourceColorHelper.kt @@ -1,11 +1,11 @@ -package com.mogo.eagle.core.function.map.identify +package com.mogo.eagle.core.function.business.identify import android.annotation.SuppressLint import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.enums.TrafficTypeEnum import mogo.telematics.pad.MessagePad.* -object TrackerSourceHelper { +object TrackerSourceColorHelper { @SuppressLint("NewApi") fun filterData(data: TrackedObject): Boolean { diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/WarningHelper.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/WarningHelper.kt similarity index 97% rename from core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/WarningHelper.kt rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/WarningHelper.kt index b678996dd2..2d7a5c69a4 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/identify/WarningHelper.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/WarningHelper.kt @@ -1,13 +1,11 @@ -package com.mogo.eagle.core.function.map.identify +package com.mogo.eagle.core.function.business.identify import android.annotation.SuppressLint import com.mogo.eagle.core.data.config.FunctionBuildConfig -import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.FOUNDATION import com.mogo.eagle.core.data.traffic.TrafficData import com.mogo.eagle.core.data.traffic.threatLevelColor import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84SatelliteTime -import com.zhjt.service_biz.BizConfig import mogo.telematics.pad.MessagePad import mogo.telematics.pad.MessagePad.PlanningObject import java.util.concurrent.ConcurrentHashMap diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/routeoverlay/MogoRouteOverlayManager.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/MogoRouteOverlayManager.java similarity index 98% rename from modules/mogo-module-service/src/main/java/com/mogo/module/service/routeoverlay/MogoRouteOverlayManager.java rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/MogoRouteOverlayManager.java index acb043ad72..74ebc44c12 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/routeoverlay/MogoRouteOverlayManager.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/MogoRouteOverlayManager.java @@ -1,4 +1,4 @@ -package com.mogo.module.service.routeoverlay; +package com.mogo.eagle.core.function.business.routeoverlay; import androidx.annotation.NonNull; diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/routeoverlay/RouteOverlayDrawer.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/RouteOverlayDrawer.java similarity index 96% rename from modules/mogo-module-service/src/main/java/com/mogo/module/service/routeoverlay/RouteOverlayDrawer.java rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/RouteOverlayDrawer.java index 01076f6084..b0b0ea6137 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/routeoverlay/RouteOverlayDrawer.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/RouteOverlayDrawer.java @@ -1,22 +1,18 @@ -package com.mogo.module.service.routeoverlay; +package com.mogo.eagle.core.function.business.routeoverlay; -import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_OLD_ROUTE; import android.annotation.SuppressLint; import android.graphics.Color; import android.os.Handler; import android.os.HandlerThread; -import android.os.SystemClock; import android.util.Log; import androidx.core.util.Pools; import com.mogo.eagle.core.data.map.MogoLatLng; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; -import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; -import com.mogo.eagle.core.utilcode.mogo.logger.Logger; import com.mogo.map.MogoOverlayManager; import com.mogo.map.overlay.IMogoOverlayManager; import com.mogo.map.overlay.IMogoPolyline; import com.mogo.map.overlay.MogoPolylineOptions; -import com.mogo.module.common.utils.DrivingDirectionUtils; +import com.mogo.commons.utils.DrivingDirectionUtils; import java.util.LinkedList; import java.util.List; import mogo.telematics.pad.MessagePad; diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/routeoverlay/RouteStrategy.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/RouteStrategy.kt similarity index 91% rename from modules/mogo-module-service/src/main/java/com/mogo/module/service/routeoverlay/RouteStrategy.kt rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/RouteStrategy.kt index 6044dd58d7..9da60d4c24 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/routeoverlay/RouteStrategy.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/RouteStrategy.kt @@ -1,14 +1,14 @@ -package com.mogo.module.service.routeoverlay +package com.mogo.eagle.core.function.business.routeoverlay import android.animation.* import android.graphics.* import android.view.animation.* import com.mogo.eagle.core.data.config.* import com.mogo.eagle.core.utilcode.mogo.* -import com.mogo.module.service.routeoverlay.Colors.Companion.COLOR_BLUE -import com.mogo.module.service.routeoverlay.Colors.Companion.COLOR_BLUE_DARK -import com.mogo.module.service.routeoverlay.Colors.Companion.COLOR_RED_DARK -import com.mogo.module.service.routeoverlay.Colors.Companion.COLOR_TRANSPARENT +import com.mogo.eagle.core.function.business.routeoverlay.Colors.Companion.COLOR_BLUE +import com.mogo.eagle.core.function.business.routeoverlay.Colors.Companion.COLOR_BLUE_DARK +import com.mogo.eagle.core.function.business.routeoverlay.Colors.Companion.COLOR_RED_DARK +import com.mogo.eagle.core.function.business.routeoverlay.Colors.Companion.COLOR_TRANSPARENT import java.util.* import kotlin.collections.ArrayList diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/MogoMapService.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/MogoMapService.java index 2a7ff08e03..8bd5018572 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/MogoMapService.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/MogoMapService.java @@ -4,6 +4,7 @@ import android.content.Context; import com.alibaba.android.arouter.facade.annotation.Route; import com.mogo.eagle.core.data.constants.MogoServicePaths; import com.mogo.eagle.core.function.api.map.IMogoMapService; +import com.mogo.eagle.core.function.api.map.marker.IMogoMarkerService; import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager; import com.mogo.map.MogoGeoSearch; import com.mogo.map.MogoLocationClient; @@ -53,6 +54,11 @@ public class MogoMapService implements IMogoMapService { return MogoMarkerManager.getInstance(context); } + @Override + public IMogoMarkerService getMarkerService() { + return MogoMarkerServiceImpl.getInstance(); + } + @Override public IMogoMapUIController getMapUIController() { return MogoMapUIController.getInstance(); diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/MogoMarkerServiceImpl.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/MogoMarkerServiceImpl.java new file mode 100644 index 0000000000..8980c0f1ea --- /dev/null +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/MogoMarkerServiceImpl.java @@ -0,0 +1,79 @@ +package com.mogo.eagle.core.function.impl; + +import androidx.annotation.Nullable; + +import com.mogo.eagle.core.data.map.MogoLatLng; +import com.mogo.eagle.core.data.map.entity.MarkerShowEntity; +import com.mogo.eagle.core.data.traffic.TrafficData; +import com.mogo.eagle.core.function.api.map.marker.IMogoMarkerService; +import com.mogo.eagle.core.function.impl.marker.drawer.MarkerDrawer; +import com.mogo.eagle.core.function.impl.marker.drawer.TrafficMarkerDrawer; +import com.mogo.eagle.core.function.impl.marker.drawer.V2XWarnDataDrawer; +import com.mogo.map.marker.IMogoMarker; + + +public class MogoMarkerServiceImpl implements IMogoMarkerService { + + private static volatile MogoMarkerServiceImpl sInstance; + private static final byte[] obj = new byte[0]; + + private MogoMarkerServiceImpl() { + + } + + public static MogoMarkerServiceImpl getInstance() { + if (sInstance == null) { + synchronized (obj) { + if (sInstance == null) { + sInstance = new MogoMarkerServiceImpl(); + } + } + } + return sInstance; + } + + @Nullable + @Override + public IMogoMarker drawMarker(Object object) { + if (object instanceof MarkerShowEntity) { + return MarkerDrawer.getInstance().drawMapMarkerImpl(((MarkerShowEntity) object), MarkerDrawer.MARKER_Z_INDEX_HIGH, null); + } + return null; + } + + @Override + public void renderWarningMoveMarker(double lon, double lat, int type, double collisionlat, double collisionLon, double angle, long showTime) { + V2XWarnDataDrawer.getInstance().renderWarnData(lon, lat, type, collisionlat, collisionLon, angle, showTime); + } + + @Override + public void renderStopLineMarker(double lon, double lat) { + V2XWarnDataDrawer.getInstance().renderStopLineData(lon, lat); + } + + @Override + public void drawerArrowsMarkerWithLocation(MogoLatLng location, String markerType, int type, int rotate) { + V2XWarnDataDrawer.getInstance().drawerArrowsMarkerWithLocation(location, markerType, type, rotate); + } + + @Override + public void updateITrafficInfo(TrafficData trafficData) { + TrafficMarkerDrawer.INSTANCE.updateITrafficInfo(trafficData); + } + + @Override + public void updateITrafficLocationInfo(TrafficData trafficData) { + TrafficMarkerDrawer.INSTANCE.updateITrafficLocationInfo(trafficData); + } + + @Override + public void updateITrafficThreatLevelInfo(TrafficData trafficData) { + TrafficMarkerDrawer.INSTANCE.updateITrafficThreatLevelInfo(trafficData); + } + + @Override + public void removeCvxRvInfoIndInfo(String uuid) { + TrafficMarkerDrawer.INSTANCE.removeCvxRvInfoIndInfo(uuid); + } + +} diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/AdasRecognizedType.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/AdasRecognizedType.java similarity index 96% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/AdasRecognizedType.java rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/AdasRecognizedType.java index f12eac0af7..17da52fab1 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/AdasRecognizedType.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/AdasRecognizedType.java @@ -1,4 +1,4 @@ -package com.mogo.module.common.constants; +package com.mogo.eagle.core.function.impl.marker; public enum AdasRecognizedType { //背景 diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/MogoMarkerServiceImpl.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/MogoMarkerServiceImpl.java deleted file mode 100644 index baccec9c2c..0000000000 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/MogoMarkerServiceImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.mogo.eagle.core.function.impl.marker; - -import android.content.Context; - -import androidx.annotation.Nullable; - -import com.alibaba.android.arouter.facade.annotation.Route; -import com.mogo.eagle.core.data.constants.MogoServicePaths; -import com.mogo.eagle.core.function.api.map.marker.IMogoMarkerService; -import com.mogo.map.MogoMapUIController; -import com.mogo.map.marker.IMogoMarker; -import com.mogo.map.uicontroller.IMogoMapUIController; -import com.mogo.module.common.drawer.MarkerDrawer; -import com.mogo.module.common.entity.MarkerShowEntity; -import com.mogo.module.service.marker.MapMarkerManager; - -/** - * @author congtaowang - * @since 2020-05-27 - *

- * 调用 #mogo-module-service# 模块的样式打点 - */ -@Route( path = MogoServicePaths.PATH_MARKER_SERVICE ) -public class MogoMarkerServiceImpl implements IMogoMarkerService { - - private static final String TAG = "MogoMarkerServiceImpl"; - - @Nullable - @Override - public IMogoMarker drawMarker( Object object ) { - if ( object instanceof MarkerShowEntity ) { - return MapMarkerManager.getInstance().drawMapMarker( ( ( MarkerShowEntity ) object ), MarkerDrawer.MARKER_Z_INDEX_HIGH ); - } - return null; - } - - @Override - public void init( Context context ) { - - } - - @Override - public IMogoMapUIController getMapUIController() { - return MogoMapUIController.getInstance(); - } -} diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/drawer/BaseDrawer.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/drawer/BaseDrawer.java new file mode 100644 index 0000000000..b91a16170e --- /dev/null +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/drawer/BaseDrawer.java @@ -0,0 +1,54 @@ +package com.mogo.eagle.core.function.impl.marker.drawer; + + +import android.content.Context; + +import com.mogo.commons.AbsMogoApplication; +import com.mogo.eagle.core.function.impl.marker.AdasRecognizedType; +import com.mogo.eagle.core.function.map.R; + +/** + * @author congtaowang + * @since 2020/10/30 + *

+ * 描述 + */ +public class BaseDrawer { + + protected final Context mContext; + + public BaseDrawer() { + mContext = AbsMogoApplication.getApp(); + } + + /** + * 获取3D锚点模型资源 + * + * @param type {@link AdasRecognizedType} + * @return modelRes + */ + public int getModelRes(int type) { + AdasRecognizedType recognizedType = AdasRecognizedType.valueFrom(type); + if (recognizedType == AdasRecognizedType.classIdCar) { + return R.raw.traffic_tachexiaoche; + } else if (recognizedType == AdasRecognizedType.classIdTrafficBus) { + return R.raw.traffic_daba; + } else if (recognizedType == AdasRecognizedType.classIdMoto) { + return R.raw.traffic_motuoche; + } else if (recognizedType == AdasRecognizedType.classIdStopLine) { + return R.raw.stopline; + } else if (recognizedType == AdasRecognizedType.classIdWarningArrows) { + return R.raw.jiantou; + } else if (recognizedType == AdasRecognizedType.classIdUnKnow) { + return R.raw.special_vehicle; + } else if (recognizedType == AdasRecognizedType.classIdBicycle) { + return R.raw.traffic_zixingche; + } else if (recognizedType == AdasRecognizedType.classIdTrafficTruck) { + return R.raw.traffic_daba; + } else if (recognizedType == AdasRecognizedType.classIdPerson) { + return R.raw.traffic_people; + } + return R.raw.special_vehicle; + } + +} diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/MarkerDrawer.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/drawer/MarkerDrawer.java similarity index 76% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/MarkerDrawer.java rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/drawer/MarkerDrawer.java index 85ce84649b..63bba6385f 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/MarkerDrawer.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/drawer/MarkerDrawer.java @@ -1,25 +1,25 @@ -package com.mogo.module.common.drawer; +package com.mogo.eagle.core.function.impl.marker.drawer; import android.text.TextUtils; import com.mogo.cloud.commons.utils.CoordinateUtils; import com.mogo.commons.AbsMogoApplication; +import com.mogo.commons.module.status.MogoStatusManager; import com.mogo.eagle.core.data.map.MogoLatLng; +import com.mogo.eagle.core.data.map.entity.MarkerExploreWay; +import com.mogo.eagle.core.data.map.entity.MarkerNoveltyInfo; +import com.mogo.eagle.core.data.map.entity.MarkerOnlineCar; +import com.mogo.eagle.core.data.map.entity.MarkerShareMusic; +import com.mogo.eagle.core.data.map.entity.MarkerShowEntity; +import com.mogo.eagle.core.function.impl.marker.view.EmptyMarkerView; +import com.mogo.eagle.core.function.impl.marker.view.IMarkerView; +import com.mogo.eagle.core.function.impl.marker.view.MapMarkerAdapter; +import com.mogo.eagle.core.function.impl.marker.view.OnlineCarMarkerView; import com.mogo.map.MogoMarkerManager; import com.mogo.map.marker.IMogoMarker; import com.mogo.map.marker.IMogoMarkerClickListener; import com.mogo.map.marker.MogoMarkerOptions; -import com.mogo.module.common.MogoApisHandler; -import com.mogo.module.common.drawer.marker.EmptyMarkerView; -import com.mogo.module.common.drawer.marker.IMarkerView; -import com.mogo.module.common.drawer.marker.MapMarkerAdapter; -import com.mogo.module.common.drawer.marker.OnlineCarMarkerView; -import com.mogo.module.common.entity.MarkerExploreWay; -import com.mogo.module.common.entity.MarkerNoveltyInfo; -import com.mogo.module.common.entity.MarkerOnlineCar; -import com.mogo.module.common.entity.MarkerShareMusic; -import com.mogo.module.common.entity.MarkerShowEntity; -import com.mogo.module.common.enums.EventTypeEnum; +import com.mogo.eagle.core.data.enums.EventTypeEnum; /** * @author congtaowang @@ -75,9 +75,9 @@ public class MarkerDrawer { if (markerShowEntity == null || markerShowEntity.getMarkerLocation() == null) { return null; } - MogoMarkerOptions options = new MogoMarkerOptions().icon3DRes(icon3DRes).set3DMode(MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()).matchOnRoadSide(matchRoadSide).owner(markerShowEntity.getMarkerType()).zIndex(zIndex).data(markerShowEntity).latitude(markerShowEntity.getMarkerLocation().getLat()).longitude(markerShowEntity.getMarkerLocation().getLon()); + MogoMarkerOptions options = new MogoMarkerOptions().icon3DRes(icon3DRes).set3DMode(MogoStatusManager.getInstance().isVrMode()).matchOnRoadSide(matchRoadSide).owner(markerShowEntity.getMarkerType()).zIndex(zIndex).data(markerShowEntity).latitude(markerShowEntity.getMarkerLocation().getLat()).longitude(markerShowEntity.getMarkerLocation().getLon()); - if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) { + if (MogoStatusManager.getInstance().isVrMode()) { Object bindObj = markerShowEntity.getBindObj(); if (bindObj instanceof MarkerExploreWay && ((MarkerExploreWay) bindObj).getPoiType() != null) { String poiType = ((MarkerExploreWay) bindObj).getPoiType(); @@ -107,26 +107,10 @@ public class MarkerDrawer { marker.setOwner(markerShowEntity.getMarkerType()); markerView.setMarker(marker); marker.setOnMarkerClickListener(listener); - markerShowEntity.setMarker(marker); } return marker; } - private boolean isNewVehicleType(Object object, IMogoMarker marker) { - if (object instanceof MarkerOnlineCar - && marker != null - && marker.getObject() instanceof MarkerShowEntity - && ((MarkerShowEntity) marker.getObject()).getBindObj() instanceof MarkerOnlineCar) { - try { - return ((MarkerOnlineCar) object).getCarInfo().getVehicleType() - != ((MarkerOnlineCar) ((MarkerShowEntity) marker.getObject()).getBindObj()).getCarInfo().getVehicleType(); - } catch (Exception e) { - - } - } - return false; - } - public String getPrimaryKeyFromEntity(Object entity) { if (entity instanceof MarkerExploreWay) { String id = ((MarkerExploreWay) entity).getInfoId(); diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/TrafficMarkerDrawer.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/drawer/TrafficMarkerDrawer.kt similarity index 98% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/TrafficMarkerDrawer.kt rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/drawer/TrafficMarkerDrawer.kt index fa71559d3d..e4de659129 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/TrafficMarkerDrawer.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/drawer/TrafficMarkerDrawer.kt @@ -1,4 +1,4 @@ -package com.mogo.module.common.drawer +package com.mogo.eagle.core.function.impl.marker.drawer import android.annotation.SuppressLint import android.content.Context @@ -7,6 +7,7 @@ import android.os.Message import android.text.TextUtils import com.mogo.commons.AbsMogoApplication import com.mogo.eagle.core.data.config.FunctionBuildConfig +import com.mogo.eagle.core.data.constants.DataTypes import com.mogo.eagle.core.data.enums.TrafficTypeEnum import com.mogo.eagle.core.data.traffic.TrafficData import com.mogo.eagle.core.data.traffic.threatLevelColor @@ -15,7 +16,6 @@ import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler import com.mogo.map.MogoMarkerManager import com.mogo.map.marker.IMogoMarker import com.mogo.map.marker.MogoMarkerOptions -import com.mogo.module.common.constants.DataTypes import java.util.concurrent.ConcurrentHashMap /** diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/V2XWarnDataDrawer.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/drawer/V2XWarnDataDrawer.java similarity index 74% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/V2XWarnDataDrawer.java rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/drawer/V2XWarnDataDrawer.java index 4dcb9fcc65..63b3c9f30b 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/V2XWarnDataDrawer.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/drawer/V2XWarnDataDrawer.java @@ -1,42 +1,34 @@ -package com.mogo.module.common.drawer; +package com.mogo.eagle.core.function.impl.marker.drawer; -import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_STOP_LINE_DATA; -import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_WARN_DATA; +import static com.mogo.eagle.core.data.constants.DataTypes.TYPE_MARKER_CLOUD_STOP_LINE_DATA; +import static com.mogo.eagle.core.data.constants.DataTypes.TYPE_MARKER_CLOUD_WARN_DATA; import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; +import com.mogo.eagle.core.data.map.entity.MarkerLocation; +import com.mogo.eagle.core.data.map.entity.MarkerShowEntity; +import com.mogo.eagle.core.function.impl.marker.view.IMarkerView; +import com.mogo.eagle.core.function.impl.marker.view.MapMarkerAdapter; import com.mogo.eagle.core.utilcode.util.UiThreadHandler; -import com.mogo.eagle.core.utilcode.util.ViewUtils; import com.mogo.map.MogoMarkerManager; import com.mogo.map.marker.IMogoMarker; import com.mogo.map.marker.MogoMarkerOptions; -import com.mogo.module.common.MogoApisHandler; -import com.mogo.module.common.drawer.marker.IMarkerView; -import com.mogo.module.common.drawer.marker.MapMarkerAdapter; -import com.mogo.module.common.entity.MarkerLocation; -import com.mogo.module.common.entity.MarkerShowEntity; -import com.mogo.service.statusmanager.IMogoStatusChangedListener; -import com.mogo.service.statusmanager.StatusDescriptor; /** * 云端 预警数据绘制 */ -public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedListener { +public class V2XWarnDataDrawer extends BaseDrawer { - private static final String TAG = "V2XWarnDataDrawer"; private static volatile V2XWarnDataDrawer sInstance; + private static final byte[] obj = new byte[0]; private V2XWarnDataDrawer() { super(); - MogoApisHandler.getInstance().getApis() - .getStatusManagerApi() - .registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, this); } public static V2XWarnDataDrawer getInstance() { if (sInstance == null) { - synchronized (V2XWarnDataDrawer.class) { + synchronized (obj) { if (sInstance == null) { sInstance = new V2XWarnDataDrawer(); } @@ -49,21 +41,8 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL sInstance = null; } - private boolean mIsVrMode = false; - - @Override - public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) { - CallerLogger.INSTANCE.d(TAG, descriptor + " , "+ isTrue); - } - - public boolean isVrMode() { - return mIsVrMode; - } - - /** * 识别物移动 - * */ public void renderWarnData(double lon, double lat, int type, double collisionlat, double collisionLon, double angle, long showTime) { MarkerLocation location = new MarkerLocation(); @@ -75,9 +54,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL markerShowEntity.setMarkerType(TYPE_MARKER_CLOUD_WARN_DATA); IMogoMarker marker = drawMarker(markerShowEntity, modeResType(type)); // marker.addDynamicAnchorPosition(new MogoLatLng(collisionlat, collisionLon), (float) heading, showTime * 1000); - UiThreadHandler.postDelayed(() -> { - marker.remove(); - }, showTime * 1000); + UiThreadHandler.postDelayed(marker::remove, showTime * 1000); } @@ -95,7 +72,6 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL return 1; } - public IMogoMarker drawMarker(MarkerShowEntity markerShowEntity, int modeResType) { MogoMarkerOptions options = new MogoMarkerOptions() .data(markerShowEntity) @@ -105,7 +81,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL .rotate((float) markerShowEntity.getMarkerLocation().getAngle()) .setGps(true); IMarkerView iMarkerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity, options); - options.icon3DRes(getModelRes(modeResType)); //TODO + options.icon3DRes(getModelRes(modeResType)); options.anchorColor("#FB3C3CFF"); IMogoMarker marker = MogoMarkerManager.getInstance(mContext).addMarker(markerShowEntity.getMarkerType(), options); iMarkerView.setMarker(marker); @@ -128,10 +104,8 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL marker.setRotateAngle(rotate); } - /** * 绘制停止线 marker - * */ public void renderStopLineData(double lon, double lat) { MarkerLocation location = new MarkerLocation(); @@ -162,5 +136,4 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL return marker; } - } diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/EmptyMarkerView.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/view/EmptyMarkerView.java similarity index 94% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/EmptyMarkerView.java rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/view/EmptyMarkerView.java index be4771ae5a..5dbe40c392 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/EmptyMarkerView.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/view/EmptyMarkerView.java @@ -1,4 +1,4 @@ -package com.mogo.module.common.drawer.marker; +package com.mogo.eagle.core.function.impl.marker.view; import android.content.Context; import android.util.AttributeSet; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/IMarkerView.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/view/IMarkerView.java similarity index 85% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/IMarkerView.java rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/view/IMarkerView.java index e4b0892d4e..dd5eba9d65 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/IMarkerView.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/view/IMarkerView.java @@ -1,4 +1,4 @@ -package com.mogo.module.common.drawer.marker; +package com.mogo.eagle.core.function.impl.marker.view; import android.graphics.Bitmap; import android.view.View; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapCameraInfoView.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/view/MapCameraInfoView.java similarity index 88% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapCameraInfoView.java rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/view/MapCameraInfoView.java index c0fb27dec9..1a74ba53a8 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapCameraInfoView.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/view/MapCameraInfoView.java @@ -1,4 +1,4 @@ -package com.mogo.module.common.drawer.marker; +package com.mogo.eagle.core.function.impl.marker.view; import android.content.Context; import android.util.AttributeSet; @@ -8,9 +8,9 @@ import android.widget.ImageView; import androidx.annotation.Nullable; +import com.mogo.eagle.core.data.map.entity.MarkerShowEntity; +import com.mogo.eagle.core.function.map.R; import com.mogo.map.marker.MogoMarkerOptions; -import com.mogo.module.common.R; -import com.mogo.module.common.entity.MarkerShowEntity; /** * author : 李小鹏 diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/view/MapMarkerAdapter.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/view/MapMarkerAdapter.java new file mode 100644 index 0000000000..9102b50ca8 --- /dev/null +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/view/MapMarkerAdapter.java @@ -0,0 +1,42 @@ +package com.mogo.eagle.core.function.impl.marker.view; + +import static com.mogo.commons.module.ServiceConst.CARD_TYPE_USER_DATA; + +import android.content.Context; +import android.text.TextUtils; + +import com.mogo.commons.module.status.MogoStatusManager; +import com.mogo.eagle.core.data.map.entity.MarkerShowEntity; +import com.mogo.map.marker.MogoMarkerOptions; + +/** + * author : donghongyu + * e-mail : 1358506549@qq.com + * date : 2020-01-1015:55 + * desc : 地图Marker的适配器 + * version: 1.0 + */ +public class MapMarkerAdapter { + + /** + * 获取 MarkerShowEntity 填充好的 MarkerView + * + * @param context 上下文 + * @param markerShowEntity 要填充的数据 + * @return MarkerView + */ + public static IMarkerView getMarkerView(Context context, MarkerShowEntity markerShowEntity, MogoMarkerOptions options) { + + if (TextUtils.equals(markerShowEntity.getMarkerType(), CARD_TYPE_USER_DATA)) { + return OnlineCarMarkerView.getInstance(); + } else { + if (MogoStatusManager.getInstance().isVrMode()) { + return new EmptyMarkerView(context); + } else { + return new MapMarkerView(context, markerShowEntity, options); + } + } + + } + +} diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerBaseView.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/view/MapMarkerBaseView.java similarity index 90% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerBaseView.java rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/view/MapMarkerBaseView.java index 9c86e8b67d..527d352ed4 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerBaseView.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/view/MapMarkerBaseView.java @@ -1,4 +1,4 @@ -package com.mogo.module.common.drawer.marker; +package com.mogo.eagle.core.function.impl.marker.view; import android.content.Context; import android.graphics.Bitmap; @@ -11,16 +11,16 @@ import android.widget.LinearLayout; import androidx.annotation.Nullable; +import com.mogo.eagle.core.data.map.entity.MarkerShowEntity; +import com.mogo.eagle.core.function.map.R; +import com.mogo.eagle.core.utilcode.mogo.glide.GlideImageLoader; import com.mogo.eagle.core.utilcode.util.UiThreadHandler; import com.mogo.eagle.core.utilcode.util.ViewUtils; import com.mogo.eagle.core.utilcode.util.WindowUtils; +import com.mogo.eagle.core.utilcode.mogo.imageloader.IMogoImageLoaderListener; +import com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView; import com.mogo.map.marker.IMogoMarker; import com.mogo.map.marker.MogoMarkerOptions; -import com.mogo.module.common.MogoApisHandler; -import com.mogo.module.common.R; -import com.mogo.module.common.entity.MarkerShowEntity; -import com.mogo.service.imageloader.IMogoImageLoaderListener; -import com.mogo.service.imageloader.MogoImageView; /** * author : donghongyu @@ -93,7 +93,7 @@ public abstract class MapMarkerBaseView extends LinearLayout implements IMarkerV if (!url.isEmpty()) { ivIcon.setPlaceHolder(res); ivIcon.setFailureHolder(res); - MogoApisHandler.getInstance().getApis().getImageLoaderApi().displayImage(url, + GlideImageLoader.getInstance().displayImage(url, ivIcon, WindowUtils.dip2px(mContext, 50), WindowUtils.dip2px(mContext, 50), new IMogoImageLoaderListener() { @Override @@ -118,7 +118,7 @@ public abstract class MapMarkerBaseView extends LinearLayout implements IMarkerV private void runOnUiThread(final MarkerShowEntity markerShowEntity) { if (!TextUtils.isEmpty(markerShowEntity.getIconUrl())) { - MogoApisHandler.getInstance().getApis().getImageLoaderApi().displayImage(markerShowEntity.getIconUrl(), + GlideImageLoader.getInstance().displayImage(markerShowEntity.getIconUrl(), ivUserHead, WindowUtils.dip2px(mContext, 50), WindowUtils.dip2px(mContext, 50), new IMogoImageLoaderListener() { diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerView.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/view/MapMarkerView.java similarity index 84% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerView.java rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/view/MapMarkerView.java index 059c89d3ee..47bd5de1cf 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerView.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/view/MapMarkerView.java @@ -1,4 +1,6 @@ -package com.mogo.module.common.drawer.marker; +package com.mogo.eagle.core.function.impl.marker.view; + +import static com.mogo.commons.module.ServiceConst.CARD_TYPE_ROAD_CONDITION; import android.content.Context; import android.util.AttributeSet; @@ -7,15 +9,14 @@ import android.widget.FrameLayout; import androidx.annotation.Nullable; +import com.mogo.commons.module.status.MogoStatusManager; +import com.mogo.eagle.core.data.map.PoiWrapper; +import com.mogo.eagle.core.data.map.entity.MarkerExploreWay; +import com.mogo.eagle.core.data.map.entity.MarkerShowEntity; +import com.mogo.eagle.core.function.map.R; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.map.marker.MogoMarkerOptions; -import com.mogo.module.common.ModuleNames; -import com.mogo.module.common.MogoApisHandler; -import com.mogo.module.common.R; -import com.mogo.module.common.entity.MarkerExploreWay; -import com.mogo.module.common.entity.MarkerShowEntity; -import com.mogo.module.common.marker.PoiWrapper; -import com.mogo.module.common.utils.CloudPoiManager; +import com.mogo.eagle.core.data.config.CloudPoiManager; /** * author : donghongyu @@ -55,7 +56,7 @@ public class MapMarkerView extends MapMarkerBaseView { @Override protected void initView( Context context ) { - if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) { + if ( MogoStatusManager.getInstance().isVrMode() ) { LayoutInflater.from( context ).inflate( R.layout.modudle_services_marker_vr_layout, this ); } else { LayoutInflater.from( context ).inflate( R.layout.modudle_services_marker_layout, this ); @@ -69,7 +70,7 @@ public class MapMarkerView extends MapMarkerBaseView { public void updateView( MarkerShowEntity markerShowEntity ) { Object bindObj = markerShowEntity.getBindObj(); switch ( markerShowEntity.getMarkerType() ) { - case ModuleNames.CARD_TYPE_ROAD_CONDITION: + case CARD_TYPE_ROAD_CONDITION: if ( mMarkerShowEntity != null && mMarkerShowEntity.isChecked() ) { clMarkerTopView.setBackgroundResource( R.drawable.module_services_marker_vr_bkg_checked ); } diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/OnlineCarMarkerView.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/view/OnlineCarMarkerView.java similarity index 70% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/OnlineCarMarkerView.java rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/view/OnlineCarMarkerView.java index 81459e5a74..e2faf4387b 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/OnlineCarMarkerView.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/view/OnlineCarMarkerView.java @@ -1,12 +1,12 @@ -package com.mogo.module.common.drawer.marker; +package com.mogo.eagle.core.function.impl.marker.view; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.view.View; import com.mogo.commons.AbsMogoApplication; +import com.mogo.eagle.core.function.map.R; import com.mogo.map.marker.IMogoMarker; -import com.mogo.module.common.R; import java.lang.ref.SoftReference; import java.util.HashMap; @@ -21,7 +21,6 @@ import java.util.Map; public class OnlineCarMarkerView implements IMarkerView { private static Map< Integer, SoftReference< Bitmap > > sRef = new HashMap<>(); - private static Map< Integer, SoftReference< Bitmap > > sTypedRef = new HashMap<>(); private OnlineCarMarkerView() { // private constructor @@ -35,11 +34,6 @@ public class OnlineCarMarkerView implements IMarkerView { return InstanceHolder.INSTANCE; } - private Object readResolve() { - // 阻止反序列化,必须实现 Serializable 接口 - return InstanceHolder.INSTANCE; - } - @Override public View getView() { return null; @@ -72,20 +66,6 @@ public class OnlineCarMarkerView implements IMarkerView { return sRef.get( vehicleType ).get(); } - public Bitmap getSelectedBitmap( int vehicleType ) { - if ( sTypedRef.get( vehicleType ) == null || sTypedRef.get( vehicleType ).get() == null - || sTypedRef.get( vehicleType ).get().isRecycled() ) { - switch ( vehicleType ) { - case 2: - sTypedRef.put( vehicleType, new SoftReference<>( BitmapFactory.decodeResource( AbsMogoApplication.getApp().getResources(), R.drawable.icon_map_marker_car_type2 ) ) ); - break; - default: - sTypedRef.put( vehicleType, new SoftReference<>( BitmapFactory.decodeResource( AbsMogoApplication.getApp().getResources(), R.drawable.icon_map_marker_car_gray_selected ) ) ); - } - } - return sTypedRef.get( vehicleType ).get(); - } - @Override public void setMarker( IMogoMarker marker ) { diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.java index 915f430be1..88d4d61e86 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.java @@ -15,6 +15,9 @@ import com.mogo.eagle.core.data.map.CenterLine; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener; import com.mogo.eagle.core.function.api.map.hd.IMoGoMapFragmentProvider; import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener; +import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber; +import com.mogo.eagle.core.function.business.MapPointCloudSubscriber; +import com.mogo.eagle.core.function.business.routeoverlay.MogoRouteOverlayManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager; import com.mogo.eagle.core.function.call.map.CallerHDMapManager; import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager; @@ -186,6 +189,7 @@ public class MapFragment extends MvpFragment // TODO 临时初始化地图监听工控机、OBU等数据监听器,用于感知元素绘制 MapIdentifySubscriber.Companion.getInstance(); + MogoRouteOverlayManager.getInstance().init(); MapPointCloudSubscriber.Companion.getInstance(); } diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapDirectionView.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapDirectionView.java index 6d1da969a3..07020f2266 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapDirectionView.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapDirectionView.java @@ -1,7 +1,5 @@ package com.mogo.eagle.core.function.smp; -import static com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.BIZ_SLW; -import static com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.V2I; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_MAP; import android.content.Context; @@ -9,7 +7,6 @@ import android.graphics.Color; import android.location.Location; import android.os.Bundle; import android.util.AttributeSet; -import android.util.Log; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; @@ -35,28 +32,20 @@ import com.amap.api.maps.model.PolylineOptions; import com.mogo.cloud.commons.utils.CoordinateUtils; import com.mogo.eagle.core.data.map.MogoLatLng; import com.mogo.eagle.core.data.map.MogoLocation; -import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener; -import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager; -import com.mogo.eagle.core.function.call.v2x.CallLimitingVelocityListenerManager; import com.mogo.eagle.core.function.map.R; import com.mogo.eagle.core.function.smp.view.ISmallMapDirectionView; import com.mogo.eagle.core.utilcode.mogo.MapAssetStyleUtils; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; -import com.mogo.eagle.core.utilcode.util.UiThreadHandler; import com.mogo.eagle.core.widget.RoundLayout; -import com.mogo.map.MogoMapUIController; -import com.mogo.module.common.utils.DrivingDirectionUtils; -import com.zhjt.service_biz.BizConfig; +import com.mogo.commons.utils.DrivingDirectionUtils; import java.util.ArrayList; import java.util.List; import java.util.Timer; import java.util.TimerTask; -import mogo.telematics.pad.MessagePad; - /** * 小地图的方向View * diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java index 4c18ef8844..2e8740625b 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java @@ -58,7 +58,6 @@ public class SmallMapFragment extends BaseFragment @Override protected void initViews() { - SmpServiceManager.init(getContext()); } @Override @@ -87,24 +86,14 @@ public class SmallMapFragment extends BaseFragment public void drawablePolyline(List coordinates) { if (mSmallMapDirectionView != null) { mSmallMapDirectionView.convert(coordinates); - UiThreadHandler.post(new Runnable() { - @Override - public void run() { - mSmallMapDirectionView.drawablePolyline(); - } - }); + UiThreadHandler.post(() -> mSmallMapDirectionView.drawablePolyline()); } } @Override public void clearPolyline() { if (mSmallMapDirectionView != null) { - UiThreadHandler.post(new Runnable() { - @Override - public void run() { - mSmallMapDirectionView.clearPolyline(); - } - }); + UiThreadHandler.post(() -> mSmallMapDirectionView.clearPolyline()); } } diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmpServiceManager.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmpServiceManager.java deleted file mode 100644 index bd36e3dec1..0000000000 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmpServiceManager.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.mogo.eagle.core.function.smp; - -import android.content.Context; - -import com.alibaba.android.arouter.launcher.ARouter; -import com.mogo.service.IMogoServiceApis; -import com.mogo.eagle.core.data.constants.MogoServicePaths; -import com.mogo.service.module.IMogoRegisterCenter; - -/** - * author : donghongyu - * e-mail : 1358506549@qq.com - * date : 2020-01-2114:01 - * desc : V2X 服务 - * version: 1.0 - */ -public class SmpServiceManager { - private static final String TAG = "V2XServiceManager"; - private static boolean isInit; - private static Context mContext; - private static IMogoServiceApis mMogoServiceApis; - private static IMogoRegisterCenter mMogoRegisterCenter; - - private SmpServiceManager() { - - } - - public static void init(final Context context) { - if (!isInit) { - isInit = true; - mContext = context; - mMogoServiceApis = (IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(context); - mMogoRegisterCenter = mMogoServiceApis.getRegisterCenterApi(); - } - } - - public static Context getContext() { - return mContext; - } - - public static IMogoRegisterCenter getMogoRegisterCenter() { - return mMogoRegisterCenter; - } - -} diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_default_user_head.png b/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/icon_default_user_head.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_default_user_head.png rename to core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/icon_default_user_head.png diff --git a/modules/mogo-module-common/src/main/res/drawable/bg_map_marker_yellow_info.xml b/core/function-impl/mogo-core-function-map/src/main/res/drawable/bg_map_marker_yellow_info.xml similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable/bg_map_marker_yellow_info.xml rename to core/function-impl/mogo-core-function-map/src/main/res/drawable/bg_map_marker_yellow_info.xml diff --git a/modules/mogo-module-common/src/main/res/drawable/bg_shape_reverse_yellow.xml b/core/function-impl/mogo-core-function-map/src/main/res/drawable/bg_shape_reverse_yellow.xml similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable/bg_shape_reverse_yellow.xml rename to core/function-impl/mogo-core-function-map/src/main/res/drawable/bg_shape_reverse_yellow.xml diff --git a/modules/mogo-module-common/src/main/res/layout/modudle_camera_layout_info.xml b/core/function-impl/mogo-core-function-map/src/main/res/layout/modudle_camera_layout_info.xml similarity index 100% rename from modules/mogo-module-common/src/main/res/layout/modudle_camera_layout_info.xml rename to core/function-impl/mogo-core-function-map/src/main/res/layout/modudle_camera_layout_info.xml diff --git a/modules/mogo-module-common/src/main/res/layout/modudle_services_marker_layout.xml b/core/function-impl/mogo-core-function-map/src/main/res/layout/modudle_services_marker_layout.xml similarity index 64% rename from modules/mogo-module-common/src/main/res/layout/modudle_services_marker_layout.xml rename to core/function-impl/mogo-core-function-map/src/main/res/layout/modudle_services_marker_layout.xml index 98bc1b8e9e..3cc726b9d3 100644 --- a/modules/mogo-module-common/src/main/res/layout/modudle_services_marker_layout.xml +++ b/core/function-impl/mogo-core-function-map/src/main/res/layout/modudle_services_marker_layout.xml @@ -11,16 +11,16 @@ + android:layout_height="@dimen/dp_130"> - @@ -29,6 +29,6 @@ android:id="@+id/ivCar" android:layout_width="@dimen/dp_20" android:layout_height="@dimen/dp_20" - android:layout_marginTop="@dimen/module_service_marker_dot_marginTop" + android:layout_marginTop="@dimen/dp_4" android:src="@drawable/icon_map_marker_location_yellow" /> \ No newline at end of file diff --git a/modules/mogo-module-common/src/main/res/layout/modudle_services_marker_vr_layout.xml b/core/function-impl/mogo-core-function-map/src/main/res/layout/modudle_services_marker_vr_layout.xml similarity index 64% rename from modules/mogo-module-common/src/main/res/layout/modudle_services_marker_vr_layout.xml rename to core/function-impl/mogo-core-function-map/src/main/res/layout/modudle_services_marker_vr_layout.xml index 16e7129a17..b020eee479 100644 --- a/modules/mogo-module-common/src/main/res/layout/modudle_services_marker_vr_layout.xml +++ b/core/function-impl/mogo-core-function-map/src/main/res/layout/modudle_services_marker_vr_layout.xml @@ -11,16 +11,16 @@ + android:layout_height="@dimen/dp_69"> - @@ -29,6 +29,6 @@ android:id="@+id/ivCar" android:layout_width="@dimen/dp_20" android:layout_height="@dimen/dp_12" - android:layout_marginTop="@dimen/module_service_marker_dot_marginTop" + android:layout_marginTop="@dimen/dp_4" android:src="@drawable/icon_map_marker_location_yellow_vr" /> \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-monitoring/src/main/java/com/mogo/eagle/core/function/live/CameraLiveManager.java b/core/function-impl/mogo-core-function-monitoring/src/main/java/com/mogo/eagle/core/function/live/CameraLiveManager.java index 24663a573d..ddca1ae01b 100644 --- a/core/function-impl/mogo-core-function-monitoring/src/main/java/com/mogo/eagle/core/function/live/CameraLiveManager.java +++ b/core/function-impl/mogo-core-function-monitoring/src/main/java/com/mogo/eagle/core/function/live/CameraLiveManager.java @@ -6,12 +6,11 @@ import androidx.annotation.Nullable; import com.mogo.cloud.socket.entity.SocketDownData; import com.mogo.eagle.core.function.live.impl.AbsCameraScenario; -import com.mogo.service.windowview.IMogoTopViewStatusListener; /** * 路边摄像头直播控制 V2XPushLiveCarScenario */ -public class CameraLiveManager extends AbsCameraScenario implements IMogoTopViewStatusListener { +public class CameraLiveManager extends AbsCameraScenario { private static final String TAG = "CameraLiveManager"; private static CameraLiveManager mCameraLiveManager; private boolean isShowWindow; @@ -89,20 +88,4 @@ public class CameraLiveManager extends AbsCameraScenario>>>mCurrentUuid = " + mCurrentUuid + ">>>mCloudRoadData.getUuid() = " + mCloudRoadData.getUuid()); - if (TextUtils.equals(mCurrentUuid, mCloudRoadData.getUuid())) { - if (isVrMode == isVrModeMarker) { - // do nothing. - CallerLogger.INSTANCE.d(M_MONITOR + TAG, "-------------1------------"); - } else { - if (isVrMode) { - CallerLogger.INSTANCE.d(M_MONITOR + TAG, "-------------2------------"); - addVrCameraMarker(mCloudRoadData); - isVrModeMarker = true; - } else { - CallerLogger.INSTANCE.d(M_MONITOR + TAG, "-------------3------------"); - addNormalCameraMarker(mCloudRoadData); - isVrModeMarker = false; - } - } - } else { - mCurrentUuid = mCloudRoadData.getUuid(); - // 是否需要延迟 - if (isVrMode) { - CallerLogger.INSTANCE.d(M_MONITOR + TAG, "-------------4------------"); - addVrCameraMarker(mCloudRoadData); - isVrModeMarker = true; - } else { - CallerLogger.INSTANCE.d(M_MONITOR + TAG, "-------------5------------"); - addNormalCameraMarker(mCloudRoadData); - isVrModeMarker = false; - } - } - } else { - //删除marker - if (obj.getCamera() != null) { - CallerLogger.INSTANCE.e(M_MONITOR + TAG, "onMsgReceived RtmpUrl() = " + obj.getCamera().getRtmpUrl()); - } else { - CallerLogger.INSTANCE.e(M_MONITOR + TAG, "obj.getCamera() == null ----------- "); - } - removeCameraMarker(); - } - } else { - CallerLogger.INSTANCE.e(M_MONITOR + TAG, "onMsgReceived obj == null "); - } - } - - @Override - public void onMsgSend(long id) { - // CallerLogger.INSTANCEger.d(M_MONITOR + TAG, "onMsgSend id : " + id); - } - - @Override - public void onMsgReceived(SocketDownData.LauncherSnapshotProto mogoSnapshotSetData) { - renderMarker(mogoSnapshotSetData); - } - -} diff --git a/core/function-impl/mogo-core-function-monitoring/src/main/java/com/mogo/eagle/core/function/live/CameraWindow3DAdapter.java b/core/function-impl/mogo-core-function-monitoring/src/main/java/com/mogo/eagle/core/function/live/CameraWindow3DAdapter.java deleted file mode 100644 index 1e823d7499..0000000000 --- a/core/function-impl/mogo-core-function-monitoring/src/main/java/com/mogo/eagle/core/function/live/CameraWindow3DAdapter.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.mogo.eagle.core.function.live; - -import android.content.Context; -import android.view.View; - -import com.mogo.map.marker.IMogoInfoWindowAdapter; -import com.mogo.map.marker.IMogoMarker; -import com.mogo.map.marker.MogoMarkerOptions; -import com.mogo.module.common.drawer.marker.MapCameraInfoView; - -/** - * @author lixiaopeng - * @since 2020/12/16 - * 描述 - */ -public class CameraWindow3DAdapter implements IMogoInfoWindowAdapter { - private Context mContext; - private MogoMarkerOptions mOptions; - - public CameraWindow3DAdapter(Context context, MogoMarkerOptions options) { - this.mContext = context; - this.mOptions = options; - } - - @Override - public View getInfoWindow(IMogoMarker marker) { - return new MapCameraInfoView(mContext, mOptions); - } -} diff --git a/core/function-impl/mogo-core-function-monitoring/src/main/java/com/mogo/eagle/core/function/live/PushCameraLiveWindow.java b/core/function-impl/mogo-core-function-monitoring/src/main/java/com/mogo/eagle/core/function/live/PushCameraLiveWindow.java index 85ac2756bd..1c49303741 100644 --- a/core/function-impl/mogo-core-function-monitoring/src/main/java/com/mogo/eagle/core/function/live/PushCameraLiveWindow.java +++ b/core/function-impl/mogo-core-function-monitoring/src/main/java/com/mogo/eagle/core/function/live/PushCameraLiveWindow.java @@ -12,11 +12,11 @@ import android.widget.ImageView; import android.widget.RelativeLayout; import com.mogo.cloud.socket.entity.SocketDownData; +import com.mogo.eagle.core.utilcode.mogo.glide.GlideImageLoader; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.function.live.impl.ICameraWindow; import com.mogo.eagle.core.function.monitoring.R; -import com.mogo.module.common.MogoApisHandler; -import com.mogo.service.imageloader.MogoImageView; +import com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView; /** @@ -72,7 +72,7 @@ public class PushCameraLiveWindow extends RelativeLayout implements ICameraWindo if (!TextUtils.isEmpty(entity.getRtmpUrl())) { CallerLogger.INSTANCE.w(M_MONITOR + TAG, "entity.getRtmpUrl() = " + entity.getRtmpUrl()); mIvReportHead.setVisibility(INVISIBLE); - MogoApisHandler.getInstance().getApis().getImageLoaderApi().displayImage(entity.getRtmpUrl(), + GlideImageLoader.getInstance().displayImage(entity.getRtmpUrl(), mIvReportHead); mLiveGSYVideoView.startLive(entity.getRtmpUrl()); } diff --git a/core/function-impl/mogo-core-function-monitoring/src/main/java/com/mogo/eagle/core/function/monitoring/CronTaskManager.kt b/core/function-impl/mogo-core-function-monitoring/src/main/java/com/mogo/eagle/core/function/monitoring/CronTaskManager.kt index a250a266c1..6608dd9c18 100644 --- a/core/function-impl/mogo-core-function-monitoring/src/main/java/com/mogo/eagle/core/function/monitoring/CronTaskManager.kt +++ b/core/function-impl/mogo-core-function-monitoring/src/main/java/com/mogo/eagle/core/function/monitoring/CronTaskManager.kt @@ -12,7 +12,7 @@ import com.mogo.eagle.core.network.MoGoRetrofitFactory import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MONITOR import com.mogo.map.MogoLocationClient -import com.mogo.module.common.constants.HostConst +import com.mogo.eagle.core.data.constants.HostConst import io.reactivex.Observable import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.disposables.Disposable diff --git a/core/function-impl/mogo-core-function-monitoring/src/main/res/layout/camera_item_v2x_live_video.xml b/core/function-impl/mogo-core-function-monitoring/src/main/res/layout/camera_item_v2x_live_video.xml index 590f227fd4..288fd4b9ff 100644 --- a/core/function-impl/mogo-core-function-monitoring/src/main/res/layout/camera_item_v2x_live_video.xml +++ b/core/function-impl/mogo-core-function-monitoring/src/main/res/layout/camera_item_v2x_live_video.xml @@ -16,7 +16,7 @@ app:layout_constraintTop_toTopOf="parent" app:roundLayoutRadius="@dimen/dp_30" /> - PushRepository.Companion.init(context)); - } -} diff --git a/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/PushUIConstants.java b/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/PushUIConstants.java deleted file mode 100644 index 1668aae7d1..0000000000 --- a/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/PushUIConstants.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.mogo.eagle.core.function.notice; - -public class PushUIConstants { - public static final String NAME = "PUSH_UI"; - public static final String PATH = "/push/ui"; - public static final String Push_MESSAGE_ACTIVITY_PATH = "/push/ui/message"; //消息列表activity -} diff --git a/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/adapter/PushMessageAdapter.kt b/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/adapter/PushMessageAdapter.kt deleted file mode 100644 index a097fe9fb3..0000000000 --- a/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/adapter/PushMessageAdapter.kt +++ /dev/null @@ -1,125 +0,0 @@ -package com.mogo.eagle.core.function.notice.adapter - -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.TextView -import androidx.recyclerview.widget.RecyclerView -import com.mogo.eagle.core.function.notice.R -import com.mogo.eagle.core.function.notice.model.PushBean -import com.mogo.eagle.core.function.notice.utils.dealSchema -import com.mogo.eagle.core.function.notice.utils.stringConverterBitmap -import com.mogo.eagle.core.function.notice.view.getApis -import com.mogo.service.imageloader.MogoImageView -import kotlin.math.abs - -class PushMessageAdapter : RecyclerView.Adapter() { - interface PushAdapterListener { - fun deleteBean(bean: PushBean, action: Boolean) - - fun lastItemShow(show: Boolean) - } - - var onAttachStateChangeListener = object : View.OnAttachStateChangeListener { - override fun onViewDetachedFromWindow(p0: View?) { - deletePushBean.lastItemShow(false) - } - - override fun onViewAttachedToWindow(p0: View?) { - deletePushBean.lastItemShow(true) - } - - } - - lateinit var deletePushBean: PushAdapterListener - - var datas: MutableList? = null - set(value) { - field = value - notifyDataSetChanged() - } - - fun removeItem(bean: PushBean) { - datas?.let { - val position = it.indexOf(bean) - if (position >= 0) { - it.removeAt(position) - notifyDataSetChanged() - } - if (itemCount == 0) { - deletePushBean.lastItemShow(false) - } - } - } - - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MessageViewHolder { - return MessageViewHolder( - LayoutInflater.from(parent.context).inflate( - R.layout.module_push_message_item, - null - ) - ) - } - - override fun getItemCount(): Int { - return datas?.size ?: 0 - } - - override fun onBindViewHolder(holder: MessageViewHolder, position: Int) { - holder.setPushBean(datas!![position], position) - } - - - inner class MessageViewHolder(view: View) : RecyclerView.ViewHolder(view) { - private val pushAppIcon: MogoImageView = view.findViewById(R.id.module_push_item_app_icon) - private val pushTitle: TextView = view.findViewById(R.id.module_push_item_title) - private val pushContent: TextView = view.findViewById(R.id.module_push_item_content) - private val pushImage: MogoImageView = view.findViewById(R.id.module_push_item_image) - private val pushTimer: TextView = view.findViewById(R.id.module_push_item_time) - private val pushDelete: TextView = view.findViewById(R.id.module_push_item_delete) - private val pushClick: View = view.findViewById(R.id.module_push_item_click) - - fun setPushBean(bean: PushBean, position: Int) { - if (position == (datas?.size ?: 0) - 1) { - itemView.addOnAttachStateChangeListener(onAttachStateChangeListener) - } else { - itemView.removeOnAttachStateChangeListener(onAttachStateChangeListener) - } - pushDelete.setOnClickListener { - deletePushBean.deleteBean(bean, false) - } - if (bean.mainSchema.isNotEmpty()) { - pushClick.setOnClickListener { - dealSchema(bean.mainSchema, itemView.context) - deletePushBean.deleteBean(bean, true) - } - } else { - pushClick.setOnClickListener(null) - } -// getApis(itemView.context).imageLoaderApi.displayImage(bean.appIcon, pushAppIcon) - pushTitle.text = bean.title - pushContent.text = bean.content - pushContent.visibility = if (bean.content.isEmpty()) View.GONE else View.VISIBLE - if (bean.QRCode.isEmpty() && bean.imageUrl.isNotEmpty()) { - getApis(itemView.context).imageLoaderApi.displayImage(bean.imageUrl, pushImage) - } - if (bean.QRCode.isNotEmpty()) { - pushImage.setImageBitmap( - stringConverterBitmap( - bean.QRCode, - pushImage.context.resources.getDimensionPixelSize(R.dimen.module_push_message_item_image_size), - pushImage.context.resources.getDimensionPixelSize(R.dimen.module_push_message_item_image_size) - ) - ) - } - val diff = abs((System.currentTimeMillis() - bean.timestamp) / 1000).toInt() - pushTimer.text = when { - diff == 0 -> "现在" - diff < 60 -> "${diff}秒前" - diff < 60 * 60 -> "${diff / 60}分钟前" - diff < 60 * 60 * 24 -> "${diff / 60 / 60}小时前" - else -> "${diff / 60 / 60 / 24}天前" - } - } - } -} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/fragment/MessageHistoryFragment.java b/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/fragment/MessageHistoryFragment.java deleted file mode 100644 index 2055f76e42..0000000000 --- a/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/fragment/MessageHistoryFragment.java +++ /dev/null @@ -1,181 +0,0 @@ -package com.mogo.eagle.core.function.notice.fragment; - -import android.view.View; -import android.widget.TextView; - -import androidx.annotation.NonNull; -import androidx.recyclerview.widget.LinearLayoutManager; -import androidx.recyclerview.widget.RecyclerView; - -import com.mogo.commons.AbsMogoApplication; -import com.mogo.commons.mvp.MvpFragment; -import com.mogo.eagle.core.function.notice.R; -import com.mogo.eagle.core.function.notice.adapter.PushMessageAdapter; -import com.mogo.eagle.core.function.notice.model.PushBean; -import com.mogo.eagle.core.function.notice.repository.PushRepository; -import com.mogo.eagle.core.function.notice.utils.AnimatorUtilsKt; -import com.mogo.eagle.core.function.notice.utils.HandlerUtils; -import com.mogo.eagle.core.function.notice.view.PushItemAnimator; -import com.mogo.eagle.core.function.notice.view.SwipeItemLayout; -import com.mogo.eagle.core.function.notice.viewmodel.MessageViewModel; -import com.mogo.eagle.core.utilcode.util.UiThreadHandler; -import com.mogo.module.common.view.OnPreventFastClickListener; - -import org.jetbrains.annotations.NotNull; - -/** - * @author congtaowang - * @since 2020/9/1 - * - * 描述 - */ -public class MessageHistoryFragment extends MvpFragment< MessageHistoryView, MessageHistoryPresenter > implements MessageHistoryView { - - private static final String TAG = "MessageHistoryFragment"; - - private View mClear; - private RecyclerView mHistoryList; - private TextView mTitle; - private View mEmptyPlaceHolder; - private View mClose; - - private boolean mClearing = false; - private PushMessageAdapter mAdapter = new PushMessageAdapter(); - private MessageViewModel mViewModel; - - @Override - protected int getLayoutId() { - return R.layout.module_push_message_hisotry_fragment; - } - - @Override - public String getTagName() { - return TAG; - } - - @Override - protected void initViews() { - mClear = findViewById( R.id.module_push_id_clear ); - mHistoryList = findViewById( R.id.module_push_id_recycler_view ); - mTitle = findViewById( R.id.module_push_id_title ); - mEmptyPlaceHolder = findViewById( R.id.module_push_id_not_data ); - mClose = findViewById( R.id.module_push_id_close ); - - mClose.setOnClickListener( new OnPreventFastClickListener() { - @Override - public void onClickImpl( View v ) { - exitSelf(); - } - } ); - mClear.setOnClickListener( new OnPreventFastClickListener() { - @Override - public void onClickImpl( View v ) { - if ( !mClearing ) { - mClearing = true; - AnimatorUtilsKt.startClearAnimator( - mHistoryList, - () -> { - mViewModel.deleteAll(); - mClearing = false; - } - ); - } - } - } ); - mAdapter.deletePushBean = new PushMessageAdapter.PushAdapterListener() { - @Override - public void deleteBean( @NotNull PushBean bean, boolean action ) { - if ( mClearing ) { - return; - } - mViewModel.delete( bean ); - if ( action ) { - exitSelf(); - } else { - mAdapter.removeItem( bean ); - if ( mAdapter.getItemCount() == 0 ) { - mEmptyPlaceHolder.setVisibility( View.VISIBLE ); - } - updateHistoryMessageCount(); - } - } - - @Override - public void lastItemShow( boolean show ) { - if ( !show && !mClearing ) { - if ( mViewModel.getList() != null ) { - int size = mViewModel.getList().size(); - if ( size > 0 && size < mHistoryList.getChildCount() ) { - return; - } - } - } - mClear.setVisibility( show ? View.VISIBLE : View.GONE ); - } - }; - mViewModel = new MessageViewModel( list -> { - UiThreadHandler.post( () -> { - int size = list == null ? 0 : list.size(); - mAdapter.setDatas( list ); - mEmptyPlaceHolder.setVisibility( size > 0 ? View.GONE : View.VISIBLE ); - updateHistoryMessageCount(); - } ); - } ); - - mHistoryList.setLayoutManager( new LinearLayoutManager( AbsMogoApplication.getApp() ) ); - mHistoryList.setAdapter( mAdapter ); - mHistoryList.setItemAnimator( new PushItemAnimator() ); - mHistoryList.addOnItemTouchListener( new SwipeItemLayout.OnSwipeItemTouchListener( getContext() ) ); - - mRootView.setOnClickListener( view -> { - } ); - } - - private void exitSelf() { - try { - getActivity().getSupportFragmentManager().beginTransaction() - .remove( this ) - .commitNowAllowingStateLoss(); - } catch ( Exception e ) { - e.printStackTrace(); - } - } - - private void updateHistoryMessageCount() { - HandlerUtils.INSTANCE.getMBgHandler().post( () -> { - int count = 0; - try { - count = PushRepository.Companion.getPushRepository().getPushBeanDao().getAllCount(); - } catch ( Exception e ) { - count = 0; - } - renderHistoryMessageCount( count ); - } ); - } - - private void renderHistoryMessageCount( int count ) { - UiThreadHandler.post( () -> { - try { - mTitle.setText( count > 0 ? "历史消息(" + count + ")" : "历史消息" ); - } catch ( Exception e ) { - e.printStackTrace(); - } - } ); - } - - @Override - public void onResume() { - super.onResume(); - } - - @NonNull - @Override - protected MessageHistoryPresenter createPresenter() { - return new MessageHistoryPresenter( this ); - } - - @Override - public void onDestroyView() { - super.onDestroyView(); - } -} diff --git a/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/fragment/MessageHistoryPresenter.java b/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/fragment/MessageHistoryPresenter.java deleted file mode 100644 index a957d2eb12..0000000000 --- a/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/fragment/MessageHistoryPresenter.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.mogo.eagle.core.function.notice.fragment; - - -import com.mogo.commons.mvp.Presenter; - -public -/** - * @author congtaowang - * @since 2020/9/1 - * - * 描述 - */ -class MessageHistoryPresenter extends Presenter< MessageHistoryView > { - - public MessageHistoryPresenter( MessageHistoryView view ) { - super( view ); - } -} diff --git a/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/fragment/MessageHistoryView.java b/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/fragment/MessageHistoryView.java deleted file mode 100644 index a4f66d8d23..0000000000 --- a/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/fragment/MessageHistoryView.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.mogo.eagle.core.function.notice.fragment; - -import com.mogo.commons.mvp.IView; - -public -/** - * @author congtaowang - * @since 2020/9/1 - * - * 描述 - */ -interface MessageHistoryView extends IView { -} diff --git a/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/repository/PushRepository.kt b/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/repository/PushRepository.kt deleted file mode 100644 index 7100ee5146..0000000000 --- a/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/repository/PushRepository.kt +++ /dev/null @@ -1,190 +0,0 @@ -package com.mogo.eagle.core.function.notice.repository - -import android.content.Context -import android.os.Handler -import android.os.Looper -import androidx.room.Room -import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_NOTICE -import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger -import com.mogo.eagle.core.function.notice.PushUIConstants -import com.mogo.eagle.core.function.notice.dao.PushBeanDatabase -import com.mogo.eagle.core.function.notice.model.PushBean -import com.mogo.eagle.core.function.notice.utils.HandlerUtils -import com.mogo.eagle.core.function.notice.view.getApis -import com.mogo.eagle.core.function.notice.viewmodel.PushViewModel -import com.mogo.map.MogoLocationClient -import com.mogo.service.statusmanager.IMogoStatusChangedListener -import com.mogo.service.statusmanager.StatusDescriptor -import java.util.* -import kotlin.collections.HashSet - -class PushRepository(mContext: Context) { - - companion object { - private const val TAG: String = "PushRepository" - private lateinit var appContext: Context - - fun init(context: Context) { - appContext = context.applicationContext - pushRepository - } - - val globalContext: Context by lazy { - appContext - } - - val pushRepository: PushRepository by lazy { - PushRepository(appContext) - } - } - - // 被中断的push消息仅再次展示一次 - private val singleRePushSet = HashSet() - - private val pushViewModel: PushViewModel = PushViewModel(mContext, this) - private val pushBeanQueue: Queue = LinkedList() - private val statusManager = getApis(mContext).statusManagerApi - val pushBeanDao by lazy { - Room.databaseBuilder(appContext, PushBeanDatabase::class.java, "database_push").build() - .pushBeanDao() - } - private val locationClient = - MogoLocationClient.getInstance(appContext) - - private val mHandler = Handler(Looper.getMainLooper()) - - private val statusChangedListener: IMogoStatusChangedListener = - IMogoStatusChangedListener { sd, open -> - CallerLogger.d("$M_NOTICE$TAG", "sd = $sd , open = $open") - } - - init { - HandlerUtils.mBgHandler.postDelayed({ - updateMsgNum() - }, 5000) - } - - private fun updateMsgNum() { - val num = pushBeanDao.getAllCount() - if (num > 100) { //历史消息最多保留100条 - pushBeanDao.deleteMin() - updateMsgNum() - return - } - - } - - private fun startIterate() { - CallerLogger.d("$M_NOTICE$TAG", "startIterate : ${pushViewModel.pushBean}") - if (!pushViewModel.isAddWindow()) { - val bean = pushBeanQueue.peek() - if (bean != null) { - if (needDelay(bean)) { - mHandler.removeCallbacks(delayRunnable) - mHandler.postDelayed(delayRunnable, 15000) - return - } - } else { - return - } - mHandler.post { - iterateNext() - } - } - } - - /** - * 缓存被中断的push消息 - */ - fun push(pushBean: PushBean) { - if (singleRePushSet.contains(pushBean)) { - return - } - CallerLogger.d("$M_NOTICE$TAG", "保存待下一次开启") - singleRePushSet.add(pushBean) - pushBeanQueue.offer(pushBean) - } - - private var delayRunnable = { - startIterate() - } - - private fun needDelay(bean: PushBean): Boolean { - if (locationClient.lastKnowLocation != null) { - if (bean.speedLimit > 0 && bean.speedLimit <= locationClient.lastKnowLocation.speed * 18 / 5) { - CallerLogger.d( - "$M_NOTICE$TAG", - "speedLimit : " + locationClient.lastKnowLocation.speed - ) - return true - } - } - if (statusManager.isV2XShow) { - return true - } - if (statusManager.isVoiceShow) { - return true - } - return false - } - - fun iterateNext(needSave: Boolean = false) { - try { - val nextBean = pushBeanQueue.peek() - if (nextBean == null) { - pushViewModel.pushBean = nextBean - return - } - if (needDelay(nextBean)) { - mHandler.removeCallbacksAndMessages(null) - mHandler.postDelayed({ - iterateNext(needSave) - }, 15000) - return - } - pushViewModel.pushBean = pushBeanQueue.poll() - } catch (e: Exception) { - CallerLogger.e("$M_NOTICE$TAG", "$e") - } - if (pushViewModel.pushBean != null) { - statusManager.registerStatusChangedListener( - PushUIConstants.PATH, - StatusDescriptor.V2X_UI, - statusChangedListener - ) - statusManager.registerStatusChangedListener( - PushUIConstants.PATH, - StatusDescriptor.VOICE_UI, - statusChangedListener - ) - } else { - statusManager.unregisterStatusChangedListener( - PushUIConstants.PATH, - StatusDescriptor.VOICE_UI, - statusChangedListener - ) - statusManager.unregisterStatusChangedListener( - PushUIConstants.PATH, - StatusDescriptor.V2X_UI, - statusChangedListener - ) - } - } - - fun delete(bean: PushBean) { - HandlerUtils.mBgHandler.post { - pushBeanDao.delete(bean) - updateMsgNum() - } - } - - fun deleteAll() { - HandlerUtils.mBgHandler.post { - pushBeanDao.deleteAll() - } - } - - fun getAll(): MutableList { - return pushBeanDao.getAll() - } -} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/utils/AnalyticsUtils.kt b/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/utils/AnalyticsUtils.kt deleted file mode 100644 index 5c3025829a..0000000000 --- a/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/utils/AnalyticsUtils.kt +++ /dev/null @@ -1,24 +0,0 @@ -@file:Suppress("DEPRECATION") - -package com.mogo.eagle.core.function.notice.utils - -import android.util.ArrayMap -import com.alibaba.android.arouter.launcher.ARouter -import com.mogo.eagle.core.function.notice.repository.PushRepository -import com.mogo.eagle.core.data.constants.MogoServicePaths -import com.mogo.service.analytics.IMogoAnalytics - -object AnalyticsUtils { - private val Analytics = - ARouter.getInstance().build(MogoServicePaths.PATH_UTILS_ANALYTICS).navigation(PushRepository.globalContext) as IMogoAnalytics - - fun track(event: String, vararg keyValue: String) { - val map = ArrayMap() - if (keyValue.isNotEmpty()) { - for (i in 0..keyValue.size - 2 step 2) { - map[keyValue[i]] = keyValue[i + 1] - } - } - Analytics.track(event, map) - } -} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/utils/HandlerUtils.kt b/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/utils/HandlerUtils.kt deleted file mode 100644 index 6ccb309b27..0000000000 --- a/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/utils/HandlerUtils.kt +++ /dev/null @@ -1,14 +0,0 @@ -package com.mogo.eagle.core.function.notice.utils - -import android.os.Handler -import android.os.HandlerThread - -object HandlerUtils { - private val handlerThread = HandlerThread("push_ui_thread") - val mBgHandler: Handler - - init { - handlerThread.start() - mBgHandler = Handler(handlerThread.looper) - } -} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/view/FloatView.kt b/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/view/FloatView.kt deleted file mode 100644 index 25fe5aa092..0000000000 --- a/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/view/FloatView.kt +++ /dev/null @@ -1,494 +0,0 @@ -package com.mogo.eagle.core.function.notice.view - -import android.content.Context -import android.os.Handler -import android.os.Looper -import android.view.LayoutInflater -import android.view.View -import android.widget.FrameLayout -import android.widget.Scroller -import android.widget.TextView -import androidx.annotation.LayoutRes -import com.mogo.commons.context.ContextHolderUtil -import com.mogo.eagle.core.function.notice.Config -import com.mogo.eagle.core.function.notice.R -import com.mogo.eagle.core.function.notice.model.PushBean -import com.mogo.eagle.core.function.notice.utils.AnalyticsUtils -import com.mogo.eagle.core.function.notice.utils.stringConverterBitmap -import com.mogo.eagle.core.function.notice.view.roundimage.RoundedImageView -import com.mogo.eagle.core.function.notice.viewmodel.PushViewModel -import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp -import com.mogo.eagle.core.utilcode.util.ThreadPoolService -import com.mogo.eagle.core.utilcode.util.UiThreadHandler -import com.mogo.service.windowview.IMogoTopViewManager -import com.mogo.service.windowview.IMogoTopViewStatusListener - -class FloatView constructor( - private val pushViewModel: PushViewModel, - private val context: Context -) { - - companion object { - const val TYPE_TOP_VIEW = 1 - const val TYPE_WINDOW_MANAGER = 2 - const val TAG: String = "FloatView.kt" - } - - interface PushViewController { - fun show(bean: PushBean?) - fun hide() - fun inflateView(@LayoutRes layoutId: Int) - } - - abstract inner class PushView(context: Context) : FrameLayout(context), - PushViewController { - private lateinit var titleIconContainer: View - private lateinit var pushTitle: TextView - private lateinit var pushImage: RoundedImageView - private lateinit var pushContent: TextView - private lateinit var pushCheck: TextView - - private var pushData: PushBean? = null - - override fun inflateView(layoutId: Int) { - LayoutInflater.from(context).inflate(layoutId, this, true) - pushTitle = findViewById(R.id.module_push_title) - pushCheck = findViewById(R.id.module_push_check) - pushImage = findViewById(R.id.module_push_image) - pushContent = findViewById(R.id.module_push_content) - titleIconContainer = findViewById(R.id.module_push_app_icon_title) - setOnClickListener { - pushViewModel.dealCmd(PushViewModel.VOICE_ACTION_PUSH_MAIN, "1") - turnNextMessage() - } - pushCheck.setOnClickListener { - pushData?.let { - if (pushCheckDialog == null) { - pushCheckDialog = PushCheckDialog(ContextHolderUtil.getContext()) - } - pushCheckDialog!!.showCheckDialog(it.title, it.content) - } - } - } - - private fun turnNextMessage() { - pushViewModel.pushBean?.apply { - showTimeout = 0 - updateTimer() - } - } - - open fun setBean(bean: PushBean) { - pushData = bean - // title - pushTitle.text = bean.title - - // image - if (bean.imageUrl.isEmpty() && bean.QRCode.isEmpty()) { - pushImage.gone() - } else if (bean.imageUrl.isNotEmpty()) { - val params = pushImage.layoutParams - params.width = getImgWidth() - params.height = getImgHeight() - pushImage.layoutParams = params - pushImage.visible() - GlideApp.with(this).load(bean.imageUrl).into(pushImage) - } else if (bean.QRCode.isNotEmpty()) { - val params = pushImage.layoutParams - params.width = getQrImgWidth() - params.height = getQrImgHeight() - pushImage.layoutParams = params - ThreadPoolService.execute { - val bmp = stringConverterBitmap( - bean.QRCode, - getQrImgWidth(), - getQrImgHeight() - ) - UiThreadHandler.post { - pushImage.setImageBitmap(bmp) - pushImage.visible() - } - } - } - - // content - if (bean.content.isEmpty()) { - pushContent.gone() - } else { - pushContent.text = bean.content - pushContent.visible() - } - - // 产品侧需要重新梳理,tts暂时不播报 -// if (bean.tts.isNotEmpty()) { -// AIAssist.getInstance(context).speakTTSVoice(bean.tts) -// } - } - - abstract fun getImgWidth(): Int - abstract fun getImgHeight(): Int - abstract fun getQrImgWidth(): Int - abstract fun getQrImgHeight(): Int - - override fun show(bean: PushBean?) { - isAddWindow = true - uiHandler.removeCallbacks(delayClosePush) - } - - override fun hide() { - isAddWindow = false - } - } - - open inner class PushViewInTopView(context: Context) : PushView(context) { - - private val mTopViewManager: IMogoTopViewManager = getApis(context).topViewManager - - init { - inflateView(R.layout.module_push_item) - } - - private var topViewStatusListener = object : IMogoTopViewStatusListener { - override fun onViewRemoved(view: View?) { - isAddWindow = false - if (pushViewModel.pushBean?.showTimeout ?: 0 > 0) { - if (getApis(context).statusManagerApi.isV2XShow) { - // 被中断的消息,需要再次被显示一次 - uiHandler.removeCallbacks(delayClosePush) - pushViewModel.push() - pushViewModel.pushMessageFinish() - return - } - } - pushViewModel.pushBean?.showTimeout = 0 - updateTimer() - } - - override fun onViewAdded(view: View?) { - if (pushViewModel.pushBean != null) { - startClosePush() - } - } - - override fun beforeViewRemoveAnim(view: View?) { - } - - override fun beforeViewAddAnim(view: View?) { - } - } - - override fun show(bean: PushBean?) { - super.show(bean) - mLastVisibleType = TYPE_TOP_VIEW - mTopViewManager.addView(this, topViewStatusListener) - setBean(bean!!) - } - - override fun hide() { - super.hide() - mTopViewManager.removeView(this) - } - - override fun getImgWidth(): Int = - context.resources.getDimensionPixelSize(R.dimen.module_push_ui_image_width) - - override fun getImgHeight(): Int = - context.resources.getDimensionPixelSize(R.dimen.module_push_ui_image_height) - - override fun getQrImgWidth(): Int = - context.resources.getDimensionPixelSize(R.dimen.module_push_ui_image_height) - - override fun getQrImgHeight(): Int = - context.resources.getDimensionPixelSize(R.dimen.module_push_ui_image_height) - } - -// inner class PushViewInWindowView(context: Context) : PushView(context), View.OnTouchListener { -// -// private val mContentContainer: View -// private val mWindowManager = -// context.getSystemService(Context.WINDOW_SERVICE) as WindowManager -// -// private val params = WindowManager.LayoutParams() -// -// init { -// -// @Suppress("DEPRECATION") -// params.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT -// params.flags = (WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN -// or WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION -// or WindowManager.LayoutParams.FLAG_LOCAL_FOCUS_MODE -// or WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH -// or WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE) -// params.width = WindowManager.LayoutParams.WRAP_CONTENT -// params.height = WindowManager.LayoutParams.WRAP_CONTENT -// params.gravity = Gravity.START or Gravity.BOTTOM -// params.format = PixelFormat.TRANSLUCENT -// params.x = context.resources.getDimensionPixelSize(R.dimen.module_push_window_x) -// params.y = context.resources.getDimensionPixelSize(R.dimen.module_push_window_x) -// if (Build.VERSION.SDK_INT > 25) { -// params.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY -// } -// -// inflateView(R.layout.module_push_item_vertical) -// mContentContainer = findViewById(R.id.module_push_content_container) -// setOnTouchListener(this) -// } -// -// override fun show(bean: PushBean?) { -// super.show(bean) -// mLastVisibleType = TYPE_WINDOW_MANAGER -// setBean(bean!!) -// -// try { -// mWindowManager.addView(this, params) -// } catch (e: Exception) { -// mWindowManager.updateViewLayout(this, params) -// } -// translationXAnimation( -// -ResourcesHelper.getDimension(context, R.dimen.module_push_ui_width_vertical), -// 0f -// ) { -// if (pushViewModel.pushBean != null) { -// startClosePush() -// } -// } -// } -// -// private fun translationXAnimation( -// from: Float, -// to: Float, -// doOnEnd: (animator: Animator) -> Unit -// ) { -// val transitionXAnimator: ObjectAnimator = -// ObjectAnimator.ofFloat( -// this, -// View.TRANSLATION_X, -// from, -// to -// ) -// transitionXAnimator.duration = 200 -// transitionXAnimator.doOnEnd(doOnEnd) -// transitionXAnimator.start() -// } -// -// override fun hide() { -// super.hide() -// translationXAnimation( -// this.x, -// -ResourcesHelper.getDimension(context, R.dimen.module_push_ui_width_vertical) -// ) { -// this.x = 0f -// mWindowManager.removeViewImmediate(this) -// } -// } -// -// override fun onTouch(v: View?, ev: MotionEvent?): Boolean { -// -// if (mLastVisibleType != TYPE_WINDOW_MANAGER) { -// return false -// } -// when (ev?.action) { -// MotionEvent.ACTION_DOWN -> { -// needInterceptClick = false -// startX = ev.x -// } -// MotionEvent.ACTION_MOVE -> { -// moveX = startX - ev.x -// scrollBy(moveX.toInt(), 0) -// startX = ev.x -// if (scrollX < 0) { -// scrollTo(0, 0) -// } -// if (!needInterceptClick && scrollX > 20) { -// needInterceptClick = true -// } -// invalidate() -// } -// MotionEvent.ACTION_UP -> { -// if (scrollX > 0) { -// mScroller.startScroll(scrollX, 0, width - scrollX, 0) -// invalidate() -// return true -// } -// if (needInterceptClick) { -// return true -// } -// } -// else -> { -// startX = 0f -// moveX = 0f -// } -// } -// return false -// } -// -// override fun computeScroll() { -// if (mScroller.computeScrollOffset()) { -// scrollTo(mScroller.currX, mScroller.currY) -// invalidate() -// } else { -// if (mScroller.currX == 0) { -// return -// } -// mScroller.finalX = 0 -// removeCallbacks(delayClosePush) -// if (isAddWindow) { -// if (currentBean != null) { -// AnalyticsUtils.track(Config.NEWS_CARD_SWIPE, "trigger_type", "1") -// } -// mWindowManager.removeView(this) -// isAddWindow = false -// } -// pushViewModel.pushBean?.showTimeout = 0 -// updateTimer() -// } -// } -// -// override fun getImgWidth(): Int = -// context.resources.getDimensionPixelSize(R.dimen.module_push_ui_image_width_vertical) -// -// override fun getImgHeight(): Int = -// context.resources.getDimensionPixelSize(R.dimen.module_push_ui_image_height_vertical) -// -// override fun getQrImgWidth(): Int = -// context.resources.getDimensionPixelSize(R.dimen.module_push_image_qr_size_vertical) -// -// override fun getQrImgHeight(): Int = -// context.resources.getDimensionPixelSize(R.dimen.module_push_image_qr_size_vertical) -// } - - private var pushCheckDialog: PushCheckDialog? = null - private val delayClosePush: Runnable - private var isAddWindow = false - private val uiHandler = Handler(Looper.getMainLooper()) - - private var startX = 0f - private var moveX = 0f - private val mScroller: Scroller = Scroller(context) - private var needInterceptClick = false - private var pause = false - - private var currentBean: PushBean? = null - - - private var mLastVisibleType = -1 - private var pushViewController: PushViewController? = null - - init { - delayClosePush = Runnable { - updateTimer() - } - } - - fun pushBeanChanged(bean: PushBean?) { - uiHandler.post { - uiHandler.removeCallbacks(delayClosePush) - if (bean == null) { - if (currentBean != null) { - AnalyticsUtils.track(Config.NEWS_CARD_DISAPPEAR, "title", currentBean!!.title) - } - hide() - } else { - show(bean) - AnalyticsUtils.track(Config.NEWS_CARD_SHOW, "title", bean.title) - } - currentBean = bean - } - } - - private fun updateTimer() { - uiHandler.removeCallbacks(delayClosePush) - val time = pushViewModel.pushBean?.showTimeout ?: 0 - if (time > 0) { - pushViewModel.pushBean!!.showTimeout-- - uiHandler.postDelayed(delayClosePush, 1000) - } else { - pushViewModel.pushMessageFinish(true) - } - } - - private fun show(bean: PushBean) { - if (isAddWindow) { - if (getApis(context).statusManagerApi.isMainPageOnResume) { - if (mLastVisibleType != TYPE_TOP_VIEW) { - hide() - (pushViewController as View).postDelayed({ - show(bean) - }, 750L) - } else { - showByTopView(bean) - } - } else { - if (mLastVisibleType != TYPE_WINDOW_MANAGER) { - hide() - (pushViewController as View).postDelayed({ - show(bean) - }, 750L) - } else { - showByWindowManager(bean) - } - } - startClosePush() - } else { - if (getApis(context).statusManagerApi.isMainPageOnResume) { - showByTopView(bean) - } else { - showByWindowManager(bean) - } - } - } - - private fun showByTopView(bean: PushBean) { - if (pushViewController !is PushViewInTopView) { - pushViewController = PushViewInTopView(context) - } - pushViewController?.show(bean) - } - - private fun showByWindowManager(bean: PushBean?) { -// if (pushViewController !is PushViewInWindowView) { -// pushViewController = PushViewInWindowView(context) -// } -// pushViewController?.show(bean) - } - - private fun startClosePush() { - uiHandler.removeCallbacks(delayClosePush) - uiHandler.postDelayed( - delayClosePush, - 1000L - ) - } - - - fun hide() { - if (!isAddWindow) { - return - } - try { - pushViewController?.hide() - } catch (e: Exception) { - e.printStackTrace() - } - } - - - fun pauseTimer(on: Boolean) { - if (on) { - uiHandler.removeCallbacks(delayClosePush) - } else { - updateTimer() - uiHandler.post { - if (on) { - pause = true - uiHandler.removeCallbacks(delayClosePush) - } else if (pause) { - pause = false - updateTimer() - } - } - } - } - - fun isAddWindow(): Boolean = isAddWindow -} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/view/PushCheckDialog.kt b/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/view/PushCheckDialog.kt deleted file mode 100644 index 4dad7cfbda..0000000000 --- a/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/view/PushCheckDialog.kt +++ /dev/null @@ -1,37 +0,0 @@ -package com.mogo.eagle.core.function.notice.view - -import android.content.Context -import android.widget.ImageView -import android.widget.TextView -import com.mogo.eagle.core.function.notice.R -import com.mogo.module.common.dialog.BaseFloatDialog - -class PushCheckDialog(context: Context) : BaseFloatDialog(context) { - - private var pushCheckClose: ImageView? = null - private var pushCheckTitle: TextView? = null - private var pushCheckContent: TextView? = null - - init { - setContentView(R.layout.module_push_dialog_check) - setCanceledOnTouchOutside(true) - pushCheckClose = findViewById(R.id.module_push_dialog_close) - pushCheckTitle = findViewById(R.id.module_push_dialog_title) - pushCheckContent = findViewById(R.id.module_push_dialog_content) - pushCheckClose?.setOnClickListener { - dismiss() - } - } - - fun showCheckDialog(title: String, content: String) { - if (isShowing) { - return - } - if (title.isBlank() || content.isBlank()) { - return - } - pushCheckTitle?.text = title - pushCheckContent?.text = content - show() - } -} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/viewmodel/MessageViewModel.kt b/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/viewmodel/MessageViewModel.kt deleted file mode 100644 index fee24db6bc..0000000000 --- a/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/viewmodel/MessageViewModel.kt +++ /dev/null @@ -1,33 +0,0 @@ -package com.mogo.eagle.core.function.notice.viewmodel - -import com.mogo.eagle.core.function.notice.model.PushBean -import com.mogo.eagle.core.function.notice.repository.PushRepository -import com.mogo.eagle.core.function.notice.utils.HandlerUtils - -class MessageViewModel(private val messageViewModel: MessageListChange) { - - var list: MutableList? = null - set(value) { - field = value - messageViewModel.messageListChange(value) - } - - init { - HandlerUtils.mBgHandler.post { - list = PushRepository.pushRepository.getAll() - } - } - - interface MessageListChange { - fun messageListChange(list: MutableList?) - } - - fun delete(bean: PushBean) { - PushRepository.pushRepository.delete(bean) - } - - fun deleteAll() { - list = null - PushRepository.pushRepository.deleteAll() - } -} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/viewmodel/PushViewModel.kt b/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/viewmodel/PushViewModel.kt deleted file mode 100644 index 8d880b21cf..0000000000 --- a/core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/viewmodel/PushViewModel.kt +++ /dev/null @@ -1,188 +0,0 @@ -package com.mogo.eagle.core.function.notice.viewmodel - -import android.content.Context -import android.text.TextUtils -import com.mogo.commons.voice.AIAssist -import com.mogo.commons.voice.IMogoVoiceCmdCallBack -import com.mogo.eagle.core.function.notice.Config -import com.mogo.eagle.core.function.notice.model.PushBean -import com.mogo.eagle.core.function.notice.repository.PushRepository -import com.mogo.eagle.core.function.notice.utils.AnalyticsUtils -import com.mogo.eagle.core.function.notice.utils.dealSchema -import com.mogo.eagle.core.function.notice.view.FloatView - -class PushViewModel( - private val mContext: Context, - private val pushRepository: PushRepository -) { - companion object { - const val VOICE_ACTION_PUSH_MAIN = "VOICE_ACTION_PUSH_MAIN" - const val VOICE_ACTION_PUSH_LEFT = "VOICE_ACTION_PUSH_LEFT" - const val VOICE_ACTION_PUSH_RIGHT = "VOICE_ACTION_PUSH_RIGHT" - const val VOICE_ACTION_PUSH_CANCEL = "VOICE_ACTION_PUSH_CANCEL" - } - - var floatView: FloatView? = null - - private var mVoiceClient: AIAssist = AIAssist.getInstance(mContext) - - private val voiceCmdCallback = object : IMogoVoiceCmdCallBack { - override fun onSpeakEnd(speakText: String?) { - } - - override fun onCmdSelected(cmd: String?) { - if (!cmd.isNullOrEmpty()) { - dealCmd(cmd) - } - } - - override fun onCmdAction(speakText: String?) { - } - - override fun onCmdCancel(speakText: String?) { - } - - override fun onSpeakSelectTimeOut(speakText: String?) { - } - } - - fun dealCmd(cmd: String, isClick: String = "2") { - if (TextUtils.isEmpty(cmd)) { - return - } - pushBean?.let { - when (cmd) { - VOICE_ACTION_PUSH_MAIN -> { - AnalyticsUtils.track(Config.NEWS_CARD_CLICK, "trigger_type", isClick) - if (isClick == "2") { - mVoiceClient.speakTTSVoiceWithLevel("好的",AIAssist.LEVEL1, voiceCmdCallback) - } - if (it.mainSchema.isNotEmpty()) { - dealSchema(it.mainSchema, mContext) - } - } - VOICE_ACTION_PUSH_LEFT -> { - if (it.buttons.isNullOrEmpty()) { - return - } - AnalyticsUtils.track( - Config.NEWS_CARD_CLICK_BTN, - "trigger_type", - isClick, "btn_text", it.buttons[0].text - ) - if (isClick == "2") { - mVoiceClient.speakTTSVoiceWithLevel("好的", AIAssist.LEVEL1,voiceCmdCallback) - } - if (it.buttons[0].action.isNotEmpty()) { - dealSchema(it.buttons[0].action, mContext) - } - } - VOICE_ACTION_PUSH_RIGHT -> { - if (it.buttons.isNullOrEmpty()) { - return - } - AnalyticsUtils.track( - Config.NEWS_CARD_CLICK_BTN, - "trigger_type", - isClick, "btn_text", it.buttons[1].text - ) - if (isClick == "2") { - mVoiceClient.speakTTSVoiceWithLevel("好的",AIAssist.LEVEL1 ,voiceCmdCallback) - } - if (it.buttons[1].action.isNotEmpty()) { - dealSchema(it.buttons[1].action, mContext) - } - } - VOICE_ACTION_PUSH_CANCEL -> { - AnalyticsUtils.track( - Config.NEWS_CARD_SWIPE, - "trigger_type", - isClick - ) - if (isClick == "2") { - mVoiceClient.speakTTSVoiceWithLevel("好的",AIAssist.LEVEL1, voiceCmdCallback) - } - } - } - } - } - - var pushBean: PushBean? = null - set(value) { - field = value - if (value == null) { - floatView?.hide() - floatView = null - return - } - field?.showTimeoutShadow = field?.showTimeout?:0 - if (value.imageUrl.isBlank()) { - value.imageUrl = "" - } - if (floatView == null) { - floatView = FloatView(this, mContext) - } - floatView?.pushBeanChanged(field) - registerVoiceCMD() - } - - fun pushMessageFinish(needSave: Boolean = false) { - pushRepository.iterateNext(needSave) - } - - private fun registerVoiceCMD() { - mVoiceClient.unregisterUnWakeupCommand(VOICE_ACTION_PUSH_CANCEL) - mVoiceClient.unregisterUnWakeupCommand(VOICE_ACTION_PUSH_MAIN) - mVoiceClient.unregisterUnWakeupCommand(VOICE_ACTION_PUSH_LEFT) - mVoiceClient.unregisterUnWakeupCommand(VOICE_ACTION_PUSH_RIGHT) - - if (pushBean != null && !pushBean!!.cancelVoiceCmd.isNullOrEmpty()) { - mVoiceClient.registerUnWakeupCommand( - VOICE_ACTION_PUSH_CANCEL, - pushBean!!.cancelVoiceCmd!!.toTypedArray(), - voiceCmdCallback - ) - } else { - mVoiceClient.registerUnWakeupCommand( - VOICE_ACTION_PUSH_CANCEL, - arrayOf("忽略", "取消", "算了", "不要", "不要了", "不看了", "关闭"), - voiceCmdCallback - ) - } - - if (pushBean != null && !pushBean!!.mainVoiceCmd.isNullOrEmpty()) { - mVoiceClient.registerUnWakeupCommand( - VOICE_ACTION_PUSH_MAIN, - pushBean!!.mainVoiceCmd!!.toTypedArray(), - voiceCmdCallback - ) - } - - pushBean?.buttons?.forEach { - it.voiceCmd?.apply { - mVoiceClient.registerUnWakeupCommand( - VOICE_ACTION_PUSH_RIGHT, - toTypedArray(), - voiceCmdCallback - ) - } - } - } - - fun speakDefault(voice: String) { - mVoiceClient.speakTTSVoiceWithLevel(voice,AIAssist.LEVEL3 ,voiceCmdCallback) - } - - fun pauseAnimator(on: Boolean) { - floatView?.pauseTimer(on) - } - - fun isAddWindow(): Boolean = floatView?.isAddWindow() ?: false - - fun push() { - pushBean?.apply { - showTimeout = showTimeoutShadow - pushRepository.push(this) - } - } -} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-notice/src/main/res/drawable/module_push_clear_bg.xml b/core/function-impl/mogo-core-function-notice/src/main/res/drawable/module_push_clear_bg.xml deleted file mode 100644 index cb38368310..0000000000 --- a/core/function-impl/mogo-core-function-notice/src/main/res/drawable/module_push_clear_bg.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - diff --git a/core/function-impl/mogo-core-function-notice/src/main/res/drawable/module_push_left_button.xml b/core/function-impl/mogo-core-function-notice/src/main/res/drawable/module_push_left_button.xml deleted file mode 100644 index c17bfd5f97..0000000000 --- a/core/function-impl/mogo-core-function-notice/src/main/res/drawable/module_push_left_button.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/core/function-impl/mogo-core-function-notice/src/main/res/drawable/module_push_recycler_item_background.xml b/core/function-impl/mogo-core-function-notice/src/main/res/drawable/module_push_recycler_item_background.xml deleted file mode 100644 index 2c16e3f684..0000000000 --- a/core/function-impl/mogo-core-function-notice/src/main/res/drawable/module_push_recycler_item_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/core/function-impl/mogo-core-function-notice/src/main/res/drawable/module_push_right_button.xml b/core/function-impl/mogo-core-function-notice/src/main/res/drawable/module_push_right_button.xml deleted file mode 100644 index 3f828dcc61..0000000000 --- a/core/function-impl/mogo-core-function-notice/src/main/res/drawable/module_push_right_button.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/core/function-impl/mogo-core-function-notice/src/main/res/layout/module_push_dialog_check.xml b/core/function-impl/mogo-core-function-notice/src/main/res/layout/module_push_dialog_check.xml deleted file mode 100644 index 8b13014fe8..0000000000 --- a/core/function-impl/mogo-core-function-notice/src/main/res/layout/module_push_dialog_check.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-notice/src/main/res/layout/module_push_item.xml b/core/function-impl/mogo-core-function-notice/src/main/res/layout/module_push_item.xml index 05c207a146..e69de29bb2 100644 --- a/core/function-impl/mogo-core-function-notice/src/main/res/layout/module_push_item.xml +++ b/core/function-impl/mogo-core-function-notice/src/main/res/layout/module_push_item.xml @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-notice/src/main/res/layout/module_push_item_origin.xml b/core/function-impl/mogo-core-function-notice/src/main/res/layout/module_push_item_origin.xml deleted file mode 100644 index 3b2d2dc278..0000000000 --- a/core/function-impl/mogo-core-function-notice/src/main/res/layout/module_push_item_origin.xml +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-notice/src/main/res/layout/module_push_message_hisotry_fragment.xml b/core/function-impl/mogo-core-function-notice/src/main/res/layout/module_push_message_hisotry_fragment.xml deleted file mode 100644 index 15f8e2974e..0000000000 --- a/core/function-impl/mogo-core-function-notice/src/main/res/layout/module_push_message_hisotry_fragment.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-notice/src/main/res/layout/module_push_message_item.xml b/core/function-impl/mogo-core-function-notice/src/main/res/layout/module_push_message_item.xml index 27c2335ceb..e69de29bb2 100644 --- a/core/function-impl/mogo-core-function-notice/src/main/res/layout/module_push_message_item.xml +++ b/core/function-impl/mogo-core-function-notice/src/main/res/layout/module_push_message_item.xml @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt index baa2036d14..12a1375c8e 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt +++ b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt @@ -19,9 +19,8 @@ import com.mogo.eagle.core.function.obu.mogo.utils.TrafficDataConvertUtils import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr -import com.mogo.module.common.drawer.TrafficMarkerDrawer -import com.mogo.module.common.enums.EventTypeEnum -import com.mogo.module.common.enums.EventTypeHelper +import com.mogo.eagle.core.data.enums.EventTypeEnum +import com.mogo.eagle.core.data.enums.EventTypeHelper import com.mogo.service.IMogoServiceApis import com.zhidao.support.obu.MogoObuManager import com.zhidao.support.obu.OnMogoObuListener @@ -77,16 +76,16 @@ class MogoPrivateObuManager private constructor() { } } - fun disConnectObu(){ + fun disConnectObu() { try { MogoObuManager.getInstance().disConnect() } catch (e: Exception) { e.printStackTrace() } - + } - fun isConnected(): Boolean{ + fun isConnected(): Boolean { return MogoObuManager.getInstance().isConnected } @@ -219,7 +218,7 @@ class MogoPrivateObuManager private constructor() { mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_RV", true) } // 更新数据 TrafficDataConvertUtils.cvxRvInfoIndInfo2TrafficData(info)?.let { - TrafficMarkerDrawer.updateITrafficLocationInfo(it) + CallerMapUIServiceManager.getMarkerService()?.updateITrafficLocationInfo(it) } } @@ -389,7 +388,8 @@ class MogoPrivateObuManager private constructor() { // 更新数据 TrafficDataConvertUtils.cvxRtiThreatIndInfo2TrafficData(info)?.let { CallerObuListenerManager.invokeTrackerWarningInfo(it) - TrafficMarkerDrawer.updateITrafficThreatLevelInfo(it) + CallerMapUIServiceManager.getMarkerService() + ?.updateITrafficThreatLevelInfo(it) } } // 删除 @@ -403,7 +403,8 @@ class MogoPrivateObuManager private constructor() { CallerObuListenerManager.removeTrackerWarningInfo(it) // 事件结束,还原车辆颜色 it.threatLevel = 0x01 - TrafficMarkerDrawer.updateITrafficThreatLevelInfo(it) + CallerMapUIServiceManager.getMarkerService() + ?.updateITrafficThreatLevelInfo(it) } } } @@ -507,7 +508,8 @@ class MogoPrivateObuManager private constructor() { // 更新数据 TrafficDataConvertUtils.cvxPtcThreatIndInfo2TrafficData(info)?.let { CallerObuListenerManager.invokeTrackerWarningInfo(it) - TrafficMarkerDrawer.updateITrafficThreatLevelInfo(it) + CallerMapUIServiceManager.getMarkerService() + ?.updateITrafficThreatLevelInfo(it) } } // 删除 @@ -519,7 +521,8 @@ class MogoPrivateObuManager private constructor() { CallerObuListenerManager.removeTrackerWarningInfo(it) // 事件结束,还原交通参与者颜色 it.threatLevel = 0x01 - TrafficMarkerDrawer.updateITrafficThreatLevelInfo(it) + CallerMapUIServiceManager.getMarkerService() + ?.updateITrafficThreatLevelInfo(it) } CallerHmiManager.disableWarningV2X(ObuConstants.USE_CASE_ID.VRUCW.toString()) } @@ -793,7 +796,6 @@ class MogoPrivateObuManager private constructor() { * * @param appId 使用WarningTypeEnum获取icon、提示内容、tts内容 * - * @see com.mogo.module.common.enums.EventTypeEnum */ private fun handleSdkObu( appId: Int, @@ -849,21 +851,21 @@ class MogoPrivateObuManager private constructor() { } //前车急刹预警 EventTypeEnum.TYPE_USECASE_ID_EBW.poiType -> { - EventTypeHelper.getEBW(appId){ alert ,tts -> + EventTypeHelper.getEBW(appId) { alert, tts -> alertContent = alert ttsContent = tts } } //前向碰撞预警 EventTypeEnum.TYPE_USECASE_ID_FCW.poiType -> { - EventTypeHelper.getFCW(appId){ alert ,tts -> + EventTypeHelper.getFCW(appId) { alert, tts -> alertContent = alert ttsContent = tts } } //逆向超车预警 EventTypeEnum.TYPE_USECASE_ID_DNPW.poiType -> { - EventTypeHelper.getDNPW(appId){ alert ,tts -> + EventTypeHelper.getDNPW(appId) { alert, tts -> alertContent = alert ttsContent = tts } @@ -917,7 +919,7 @@ class MogoPrivateObuManager private constructor() { //更新周边车辆进行预警颜色变换,车辆实时移动和变色 TrafficDataConvertUtils.cvxV2vThreatIndInfo2TrafficData(info)?.let { CallerObuListenerManager.invokeTrackerWarningInfo(it) - TrafficMarkerDrawer.updateITrafficThreatLevelInfo(it) + CallerMapUIServiceManager.getMarkerService()?.updateITrafficThreatLevelInfo(it) } } // 删除 @@ -930,7 +932,7 @@ class MogoPrivateObuManager private constructor() { TrafficDataConvertUtils.cvxV2vThreatIndInfo2TrafficData(info)?.let { CallerObuListenerManager.removeTrackerWarningInfo(it) it.threatLevel = 0x01 - TrafficMarkerDrawer.updateITrafficThreatLevelInfo(it) + CallerMapUIServiceManager.getMarkerService()?.updateITrafficThreatLevelInfo(it) } } } diff --git a/core/function-impl/mogo-core-function-v2x/build.gradle b/core/function-impl/mogo-core-function-v2x/build.gradle index 16bcc91360..0549db5dd0 100644 --- a/core/function-impl/mogo-core-function-v2x/build.gradle +++ b/core/function-impl/mogo-core-function-v2x/build.gradle @@ -53,6 +53,7 @@ dependencies { implementation rootProject.ext.dependencies.mogo_v2x implementation rootProject.ext.dependencies.mogoaicloudtrafficlive if (Boolean.valueOf(USE_MAVEN_PACKAGE)) { + implementation rootProject.ext.dependencies.mogocommons implementation rootProject.ext.dependencies.modulecommon implementation rootProject.ext.dependencies.moduleservice implementation rootProject.ext.dependencies.mogo_core_data @@ -62,13 +63,12 @@ dependencies { //implementation rootProject.ext.dependencies.callchatprovider implementation rootProject.ext.dependencies.mogo_core_res } else { + implementation project(":foudations:mogo-commons") implementation project(':modules:mogo-module-common') - implementation project(':modules:mogo-module-service') implementation project(':core:mogo-core-data') implementation project(':core:mogo-core-utils') implementation project(':core:mogo-core-function-api') implementation project(':core:mogo-core-function-call') - //implementation project(':modules:mogo-module-carchattingprovider') implementation project(':core:mogo-core-res') implementation project(':libraries:mogo-adas') diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt index ad0cabba5e..cbc9709814 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt @@ -8,12 +8,23 @@ import androidx.core.util.Pair import androidx.localbroadcastmanager.content.* import com.mogo.cloud.commons.utils.* import com.mogo.cloud.passport.* +import com.mogo.commons.AbsMogoApplication +import com.mogo.commons.module.ServiceConst.CARD_TYPE_ROAD_CONDITION +import com.mogo.commons.module.status.IMogoStatusChangedListener +import com.mogo.commons.module.status.MogoStatusManager +import com.mogo.commons.module.status.StatusDescriptor +import com.mogo.eagle.core.data.enums.EventTypeEnum +import com.mogo.eagle.core.data.enums.EventTypeHelper import com.mogo.commons.network.* import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_V2N import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_CLOUD_SHOW import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CLOUD_V2N import com.mogo.eagle.core.data.enums.* import com.mogo.eagle.core.data.map.* +import com.mogo.eagle.core.data.map.entity.MarkerExploreWay +import com.mogo.eagle.core.data.map.entity.MarkerShowEntity +import com.mogo.eagle.core.data.map.entity.V2XMessageEntity +import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity import com.mogo.eagle.core.data.traffic.* import com.mogo.eagle.core.function.api.hmi.warning.* import com.mogo.eagle.core.function.api.map.listener.* @@ -34,7 +45,6 @@ import com.mogo.eagle.core.function.v2x.events.receiver.* import com.mogo.eagle.core.function.v2x.events.scenario.impl.* import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.* import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.AiRoadMarker.Marker -import com.mogo.eagle.core.function.v2x.events.scenario.scene.road.* import com.mogo.eagle.core.function.v2x.events.utils.* import com.mogo.eagle.core.function.v2x.events.utils.MapUtils import com.mogo.eagle.core.function.v2x.events.voice.* @@ -45,16 +55,9 @@ import com.mogo.eagle.core.utilcode.mogo.storage.* import com.mogo.eagle.core.utilcode.util.* import com.mogo.eagle.core.utilcode.util.TimeUtils import com.mogo.eagle.core.utilcode.util.Utils +import com.mogo.map.MogoMarkerManager import com.mogo.map.listener.* import com.mogo.map.marker.* -import com.mogo.module.common.* -import com.mogo.module.common.drawer.* -import com.mogo.module.common.entity.* -import com.mogo.module.common.entity.V2XMessageEntity.V2XTypeEnum -import com.mogo.module.common.enums.* -import com.mogo.service.statusmanager.* -import com.mogo.service.statusmanager.StatusDescriptor.ACC_STATUS -import com.mogo.service.statusmanager.StatusDescriptor.SEEK_HELPING import com.mogo.v2x.* import com.mogo.v2x.callback.* import com.mogo.v2x.config.* @@ -127,7 +130,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb BridgeApi.registerCenter()?.let { it.registerMogoMapListener(MODULE_NAME, this) it.registerMogoMarkerClickListener( - ModuleNames.CARD_TYPE_ROAD_CONDITION, + CARD_TYPE_ROAD_CONDITION, object : IMogoMarkerClickListener { override fun onMarkerClicked(marker: IMogoMarker?): Boolean { handleRoadConditionMarkerClick(marker) @@ -135,10 +138,9 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb } }) } - BridgeApi.statusManager()?.let { - it.registerStatusChangedListener(MODULE_NAME, ACC_STATUS, this) - it.registerStatusChangedListener(MODULE_NAME, SEEK_HELPING, this) - } + MogoStatusManager.getInstance().registerStatusChangedListener(MODULE_NAME, StatusDescriptor.ACC_STATUS, this) + MogoStatusManager.getInstance().registerStatusChangedListener(MODULE_NAME, StatusDescriptor.SEEK_HELPING, this) + } private fun unRegisterListener() { @@ -146,12 +148,11 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb CallerMapLocationListenerManager.removeListener(TAG, false) BridgeApi.registerCenter()?.let { it.unregisterMogoMapListener(MODULE_NAME) - it.unregisterMogoMarkerClickListener(ModuleNames.CARD_TYPE_ROAD_CONDITION) - } - BridgeApi.statusManager()?.let { - it.unregisterStatusChangedListener(MODULE_NAME, ACC_STATUS, this) - it.unregisterStatusChangedListener(MODULE_NAME, SEEK_HELPING, this) + it.unregisterMogoMarkerClickListener(CARD_TYPE_ROAD_CONDITION) } + MogoStatusManager.getInstance().unregisterStatusChangedListener(MODULE_NAME, StatusDescriptor.ACC_STATUS, this) + MogoStatusManager.getInstance().unregisterStatusChangedListener(MODULE_NAME, StatusDescriptor.SEEK_HELPING, this) + } private fun initData() { @@ -201,7 +202,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb val v2XMessageEntity: V2XMessageEntity = V2XMessageEntity() - v2XMessageEntity.type = V2XTypeEnum.ALERT_ROAD_WARNING + v2XMessageEntity.type = V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING v2XMessageEntity.isShowState = true v2XMessageEntity.isOnlyShow = true v2XMessageEntity.isNeedAddLine = false @@ -242,20 +243,18 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb CallerLogger.d("$M_V2X$TAG", "状态发生改变\ndescriptor:$descriptor\nisTrue:$isTrue") // 记录状态更改 // 记录状态更改 SharedPrefsMgr.getInstance(Utils.getApp()).putBoolean("descriptor_$descriptor", isTrue) - if (descriptor == ACC_STATUS) { + if (descriptor == StatusDescriptor.ACC_STATUS) { if (isTrue) { // 刷新配置文件 refreshStrategyConfig() // 记录开机时间 FatigueDrivingUtils.refreshAccOnTime() initCarForHelpStatus() - BridgeApi.statusManager()?.let { - V2XManager.forceRefresh() - } + V2XManager.forceRefresh() } else { // 记录关机时间 SharedPrefsMgr.getInstance(Utils.getApp()) .putString(V2X_ACC_OFF_TIME_STR, TimeUtils.getNowString()) } - } else if (descriptor == SEEK_HELPING) { + } else if (descriptor == StatusDescriptor.SEEK_HELPING) { refreshMeSeekHelp(isTrue) } } @@ -267,7 +266,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb */ private fun refreshMeSeekHelp(isTrue: Boolean) { val entity = V2XMessageEntity() - entity.type = V2XTypeEnum.ALERT_CAR_FOR_HELP + entity.type = V2XMessageEntity.V2XTypeEnum.ALERT_CAR_FOR_HELP entity.content = isTrue V2XScenarioManager.getInstance().handlerMessage(entity) } @@ -286,10 +285,10 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb val vehicleType: Int = resultBean.vehicleType //故障车 if (vehicleType == 4) { refreshMeSeekHelp(true) - BridgeApi.statusManager()?.setSeekHelping(MODULE_NAME, true) + MogoStatusManager.getInstance().setSeekHelping(MODULE_NAME, true) } else { refreshMeSeekHelp(false) - BridgeApi.statusManager()?.setSeekHelping(MODULE_NAME, false) + MogoStatusManager.getInstance().setSeekHelping(MODULE_NAME, false) } } } @@ -360,7 +359,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb Logger.d(TAG, "--- trigger show ---:poiType:" + v2XRoadEventEntity.poiType) TrackUtils.trackV2xRoadProduceEvent(1) val v2XMessageEntity = V2XMessageEntity() - v2XMessageEntity.type = V2XTypeEnum.ALERT_ROAD_WARNING + v2XMessageEntity.type = V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING v2XMessageEntity.content = v2XRoadEventEntity v2XMessageEntity.isShowState = true V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity) @@ -470,7 +469,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb private fun handleWarningTargetEvent(data: V2XWarningTarget) { val v2xMessageEntity = V2XMessageEntity() - v2xMessageEntity.type = V2XTypeEnum.ALERT_THE_FRONT_WEAKNESS + v2xMessageEntity.type = V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_WEAKNESS // 设置数据 v2xMessageEntity.content = data val intent = Intent(BROADCAST_SCENE_HANDLER_ACTION) @@ -491,7 +490,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb private fun handleOptimalRouteEvent(event: V2XEvent.OptimalRoute) { val v2xMessageEntity: V2XMessageEntity = V2XMessageEntity() // 控制类型 - v2xMessageEntity.type = V2XTypeEnum.ALERT_PUSH_VR_SHOW // 设置数据 + v2xMessageEntity.type = V2XMessageEntity.V2XTypeEnum.ALERT_PUSH_VR_SHOW // 设置数据 v2xMessageEntity.content = event.data // 控制展示状态 v2xMessageEntity.isShowState = true val intent = Intent(BROADCAST_SCENE_HANDLER_ACTION) @@ -595,14 +594,14 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb true, 5000L ) - TrafficMarkerDrawer.updateITrafficInfo(trafficData) + CallerMapUIServiceManager.getMarkerService()?.updateITrafficInfo(trafficData) } 2 -> { - TrafficMarkerDrawer.updateITrafficInfo(trafficData) + CallerMapUIServiceManager.getMarkerService()?.updateITrafficInfo(trafficData) } 3 -> { trafficData.uuid?.let { - TrafficMarkerDrawer.removeCvxRvInfoIndInfo(it) + CallerMapUIServiceManager.getMarkerService()?.removeCvxRvInfoIndInfo(it) } } } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java index 29626c7b07..1d822f9a92 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java @@ -1,10 +1,10 @@ package com.mogo.eagle.core.function.v2x.events.alarm; import com.mogo.eagle.core.data.map.MogoLocation; +import com.mogo.eagle.core.data.map.entity.MarkerLocation; +import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; import com.mogo.eagle.core.function.v2x.events.utils.DrivingDirectionUtils; -import com.mogo.module.common.entity.MarkerLocation; -import com.mogo.module.common.entity.V2XRoadEventEntity; -import com.mogo.module.common.enums.EventTypeEnum; +import com.mogo.eagle.core.data.enums.EventTypeEnum; import java.util.Iterator; import java.util.concurrent.CopyOnWriteArrayList; import io.netty.util.internal.ConcurrentSet; diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/bridge/BridgeApi.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/bridge/BridgeApi.kt index 7739068c3b..2faa6952be 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/bridge/BridgeApi.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/bridge/BridgeApi.kt @@ -8,7 +8,6 @@ import com.mogo.eagle.core.function.v2x.events.manager.* import com.mogo.eagle.core.function.v2x.events.network.V2XRefreshModel import com.mogo.eagle.core.utilcode.util.Utils import com.mogo.module.common.MogoApisHandler -import com.mogo.service.statusmanager.IMogoStatusManager import java.lang.ref.WeakReference import java.util.concurrent.atomic.AtomicReference @@ -60,10 +59,6 @@ internal object BridgeApi { fun context(): Context = this.context.get()?.get() ?: Utils.getApp() - fun statusManager(): IMogoStatusManager? = apis?.statusManagerApi - - fun analytics() = apis?.analyticsApi - fun v2xMarker() = v2xMarker fun v2xPolyline() = v2xPolyline @@ -80,12 +75,4 @@ internal object BridgeApi { fun registerCenter() = apis?.registerCenterApi - fun imageLoader() = apis?.imageLoaderApi - - fun windowManager() = apis?.windowManagerApi - - fun displayEffects() = apis?.displayEffectsManager - - fun intentManager() = apis?.intentManagerApi - } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/entity/net/V2XAlarmEventRes.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/entity/net/V2XAlarmEventRes.java index 1700c72906..1d242de50b 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/entity/net/V2XAlarmEventRes.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/entity/net/V2XAlarmEventRes.java @@ -6,8 +6,8 @@ import android.text.TextUtils; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.mogo.eagle.core.data.BaseData; -import com.mogo.module.common.entity.MarkerLocation; -import com.mogo.module.common.entity.MarkerOnlineCar; +import com.mogo.eagle.core.data.map.entity.MarkerLocation; +import com.mogo.eagle.core.data.map.entity.MarkerOnlineCar; import java.io.Serializable; import java.util.ArrayList; diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/entity/net/V2XLiveCarRes.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/entity/net/V2XLiveCarRes.java index 91e4269a06..37c0e060cc 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/entity/net/V2XLiveCarRes.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/entity/net/V2XLiveCarRes.java @@ -2,7 +2,7 @@ package com.mogo.eagle.core.function.v2x.events.entity.net; import com.google.gson.annotations.Expose; import com.mogo.eagle.core.data.BaseData; -import com.mogo.module.common.entity.V2XLiveCarInfoEntity; +import com.mogo.eagle.core.data.map.entity.V2XLiveCarInfoEntity; import java.io.Serializable; import java.util.List; diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/entity/panel/SurroundingConstruction.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/entity/panel/SurroundingConstruction.java index 5327410adb..00af59ade0 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/entity/panel/SurroundingConstruction.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/entity/panel/SurroundingConstruction.java @@ -1,7 +1,7 @@ package com.mogo.eagle.core.function.v2x.events.entity.panel; -import com.mogo.module.common.entity.MarkerExploreWay; -import com.mogo.module.common.enums.EventTypeEnum; +import com.mogo.eagle.core.data.map.entity.MarkerExploreWay; +import com.mogo.eagle.core.data.enums.EventTypeEnum; import java.io.Serializable; import java.util.ArrayList; diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/entity/panel/SurroundingResponse.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/entity/panel/SurroundingResponse.java index a89c64fd5e..d2df876e59 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/entity/panel/SurroundingResponse.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/entity/panel/SurroundingResponse.java @@ -1,7 +1,7 @@ package com.mogo.eagle.core.function.v2x.events.entity.panel; import com.mogo.eagle.core.data.BaseData; -import com.mogo.module.common.entity.MarkerExploreWay; +import com.mogo.eagle.core.data.map.entity.MarkerExploreWay; import java.util.List; diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XMarkerManager.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XMarkerManager.java index 563998de73..739c8cdf99 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XMarkerManager.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XMarkerManager.java @@ -3,18 +3,10 @@ package com.mogo.eagle.core.function.v2x.events.manager; import android.content.Context; import com.alibaba.android.arouter.facade.template.IProvider; -import com.mogo.eagle.core.function.v2x.events.entity.net.V2XSpecialCarRes; -import com.mogo.map.marker.IMogoMarker; +import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; import com.mogo.map.marker.IMogoMarkerClickListener; -import com.mogo.module.common.entity.MarkerCardResult; -import com.mogo.module.common.entity.MarkerExploreWay; -import com.mogo.module.common.entity.MarkerNoveltyInfo; -import com.mogo.module.common.entity.MarkerOnlineCar; -import com.mogo.module.common.entity.MarkerShowEntity; -import com.mogo.module.common.entity.V2XRoadEventEntity; import com.mogo.v2x.data.V2XMarkerCardResult; -import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; /** @@ -43,23 +35,6 @@ public interface IMoGoV2XMarkerManager extends IProvider { */ void analysisV2XRoadEvent(V2XMarkerCardResult markerCardResult); - - /** - * 展开气泡 - * - * @param context - * @param currentMarker - */ - IMogoMarker openMarker(Context context, IMogoMarker currentMarker); - - /** - * 关闭气泡 - * - * @param context - * @param currentMarker - */ - void closeMarker(Context context, IMogoMarker currentMarker); - /** * 绘制正在预警的道路事件的POI点 * diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XPolylineManager.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XPolylineManager.java index 5d79c45760..00ccb22e7a 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XPolylineManager.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XPolylineManager.java @@ -3,8 +3,8 @@ package com.mogo.eagle.core.function.v2x.events.manager; import android.content.Context; import com.alibaba.android.arouter.facade.template.IProvider; +import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; import com.mogo.map.overlay.IMogoPolyline; -import com.mogo.module.common.entity.V2XRoadEventEntity; /** * author : donghongyu diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/V2XStatusManager.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/V2XStatusManager.java index 5faeb0b104..541a2090a7 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/V2XStatusManager.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/V2XStatusManager.java @@ -2,7 +2,7 @@ package com.mogo.eagle.core.function.v2x.events.manager; import com.mogo.eagle.core.data.map.MogoLatLng; import com.mogo.eagle.core.data.map.MogoLocation; -import com.mogo.module.common.entity.V2XRoadEventEntity; +import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; /** * author : donghongyu diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java index 25f438b6da..83ed3ee04d 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java @@ -1,18 +1,24 @@ package com.mogo.eagle.core.function.v2x.events.manager.impl; +import static com.mogo.commons.module.ServiceConst.CARD_TYPE_NOVELTY; import static com.mogo.eagle.core.function.v2x.events.consts.V2XConst.V2X_EVENT_ALARM_POI; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X; import android.content.Context; -import android.graphics.Bitmap; import com.alibaba.android.arouter.facade.annotation.Route; +import com.mogo.cloud.commons.utils.CoordinateUtils; import com.mogo.commons.AbsMogoApplication; +import com.mogo.commons.module.status.MogoStatusManager; import com.mogo.eagle.core.data.map.MogoLatLng; import com.mogo.eagle.core.data.map.MogoLocation; +import com.mogo.eagle.core.data.map.entity.MarkerExploreWay; +import com.mogo.eagle.core.data.map.entity.MarkerLocation; +import com.mogo.eagle.core.data.map.entity.MarkerShowEntity; +import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; +import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; 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.manager.IMoGoV2XMarkerManager; import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XPolylineManager; import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XStatusManager; @@ -21,30 +27,19 @@ 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.CallerLogger; -import com.mogo.eagle.core.utilcode.util.ViewUtils; import com.mogo.map.MogoMarkerManager; import com.mogo.map.marker.IMogoMarker; import com.mogo.map.marker.IMogoMarkerClickListener; import com.mogo.map.marker.IMogoMarkerManager; import com.mogo.map.marker.MogoMarkerOptions; -import com.mogo.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.entity.MarkerExploreWay; -import com.mogo.module.common.entity.MarkerLocation; -import com.mogo.module.common.entity.MarkerShowEntity; -import com.mogo.module.common.entity.V2XRoadEventEntity; -import com.mogo.module.common.enums.EventTypeEnum; -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.data.enums.EventTypeEnum; 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.List; +import java.util.Objects; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArraySet; @@ -86,10 +81,8 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager { // 事件位置 MarkerLocation location = v2XRoadEventEntity.getLocation(); if (location != null) { - float calculateDistance = Utils.calculateLineDistance( - new MogoLatLng(location.getLat(), location.getLon()), - new MogoLatLng(currentLocation.getLatitude(), currentLocation.getLongitude()) - ); + float calculateDistance = CoordinateUtils.calculateLineDistance(location.getLat(), location.getLon(), + currentLocation.getLatitude(), currentLocation.getLongitude()); v2XRoadEventEntity.setDistance(calculateDistance); } roadEventEntities.add(v2XRoadEventEntity); @@ -127,7 +120,7 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager { // 探路目前只有上报拥堵 String poi = markerExploreWay.getPoiType(); v2XRoadEventEntity.setPoiType(poi); - v2XRoadEventEntity.setNoveltyInfo(EntityUtilsKt.toMarkExploreWay(markerExploreWay,markerCardResult.getExtras())); + v2XRoadEventEntity.setNoveltyInfo(EntityUtilsKt.toMarkExploreWay(markerExploreWay, markerCardResult.getExtras())); v2XRoadEventEntity.setExpireTime(20000); mV2XRoadEventEntityArrayList.add(v2XRoadEventEntity); } @@ -139,67 +132,6 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager { } } - - @Override - public IMogoMarker openMarker(Context context, IMogoMarker currentMarker) { - try { - if (currentMarker != null) { - Object object = currentMarker.getObject(); - if (object != null) { - // 修改数据 - MarkerShowEntity showEntity = (MarkerShowEntity) object; - showEntity.setChecked(true); - - // 获取数据对应的View - IMarkerView markerView = MapMarkerAdapter.getMarkerView(context, - showEntity, - currentMarker.getMogoMarkerOptions()); - - Bitmap bitmap; - if (showEntity.getMarkerType().equals(ServiceConst.CARD_TYPE_USER_DATA) - || showEntity.getMarkerType().equals(V2XConst.V2X_MARKER_SPECIAL_CAR)) { - bitmap = V2XMarkerAdapter.getV2XCarMarkerView(context, showEntity); - } else { - bitmap = ViewUtils.fromView(markerView.getView()); - } - - currentMarker.setIcon(bitmap); - currentMarker.setToTop(); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - return currentMarker; - } - - @Override - public void closeMarker(Context context, IMogoMarker currentMarker) { - try { - if (currentMarker != null) { - Object object = currentMarker.getObject(); - if (object != null) { - MarkerShowEntity showEntity = (MarkerShowEntity) object; - showEntity.setChecked(false); - IMarkerView markerView = MapMarkerAdapter.getMarkerView(context, - showEntity, - currentMarker.getMogoMarkerOptions()); - - Bitmap bitmap; - if (showEntity.getMarkerType().equals(ServiceConst.CARD_TYPE_USER_DATA) - || showEntity.getMarkerType().equals(V2XConst.V2X_MARKER_SPECIAL_CAR)) { - bitmap = V2XMarkerAdapter.getV2XCarMarkerView(context, showEntity); - } else { - bitmap = ViewUtils.fromView(markerView.getView()); - } - currentMarker.setIcon(bitmap); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - } - @Override public void drawableAlarmPOI(Context context, V2XRoadEventEntity roadEventEntity, IMogoMarkerClickListener clickListener) { try { @@ -223,22 +155,13 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager { markerShowEntity.setChecked(false); markerShowEntity.setTextContent(markerExploreWay.getAddr()); markerShowEntity.setMarkerLocation(markerExploreWay.getLocation()); - markerShowEntity.setMarkerType(ServiceConst.CARD_TYPE_NOVELTY); + markerShowEntity.setMarkerType(CARD_TYPE_NOVELTY); - // 由于性能问题,D车机不使用事件扩散动画 - if (!CarSeries.isF8xxSeries()) { - optionsRipple.icon(V2XMarkerAdapter.getV2XRoadEventViewPng(context, roadEventEntity)); - } else { - optionsRipple.icons(V2XMarkerAdapter.getV2XRoadEventViewGif(context, roadEventEntity)); - optionsRipple.period(1); - } - 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, clickListener); + optionsRipple.icons(V2XMarkerAdapter.getV2XRoadEventViewGif(context, roadEventEntity)); + optionsRipple.period(1); + + if (MogoStatusManager.getInstance().isVrMode()) { + mAlarmInfoMarker = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerService()).drawMarker(markerShowEntity); } else { optionsRipple.icon(V2XMarkerAdapter.getV2XRoadEventViewPng(context, roadEventEntity)); IMogoMarkerManager marker = MogoMarkerManager.getInstance(context); diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XPolylineManager.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XPolylineManager.java index 451f7a4285..91318099b4 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XPolylineManager.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XPolylineManager.java @@ -3,23 +3,11 @@ package com.mogo.eagle.core.function.v2x.events.manager.impl; import android.content.Context; import com.alibaba.android.arouter.facade.annotation.Route; -import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; -import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi; +import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; 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.MogoOverlayManager; -import com.mogo.map.overlay.IMogoOverlayManager; import com.mogo.map.overlay.IMogoPolyline; -import com.mogo.map.overlay.MogoPolylineOptions; -import com.mogo.module.common.entity.V2XRoadEventEntity; -import com.mogo.module.common.enums.EventTypeEnum; -import com.mogo.service.statusmanager.IMogoStatusManager; - -import java.util.ArrayList; -import java.util.List; /** * author : donghongyu diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XStatusManager.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XStatusManager.java index e476192828..6a490ac288 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XStatusManager.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XStatusManager.java @@ -3,13 +3,12 @@ package com.mogo.eagle.core.function.v2x.events.manager.impl; import android.content.Context; import com.alibaba.android.arouter.facade.annotation.Route; -import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi; +import com.mogo.commons.module.status.MogoStatusManager; 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.manager.IMoGoV2XStatusChangedListener; import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XStatusManager; import com.mogo.eagle.core.function.v2x.events.manager.V2XStatusDescriptor; -import com.mogo.service.statusmanager.IMogoStatusManager; import java.util.List; import java.util.Map; @@ -54,10 +53,7 @@ public class MoGoV2XStatusManager implements IMoGoV2XStatusManager { @Override public void setRoadEventPOIShow(String tag, boolean show) { - IMogoStatusManager statusManager = BridgeApi.INSTANCE.statusManager(); - if (statusManager != null) { - statusManager.setV2XUIShow(V2XConst.MODULE_NAME, show); - } + MogoStatusManager.getInstance().setV2XUIShow(V2XConst.MODULE_NAME, show); mStatus.put(V2XStatusDescriptor.RoadEventPOI_UI, show); invokeStatusChangedListener(V2XStatusDescriptor.RoadEventPOI_UI, show); recordStatusModifier(tag, V2XStatusDescriptor.RoadEventPOI_UI); diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerAdapter.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerAdapter.java index 3c8ae23d36..215745c444 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerAdapter.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerAdapter.java @@ -3,10 +3,9 @@ package com.mogo.eagle.core.function.v2x.events.marker; import android.content.Context; import android.graphics.Bitmap; +import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; import com.mogo.eagle.core.function.v2x.R; -import com.mogo.module.common.entity.MarkerShowEntity; -import com.mogo.module.common.entity.V2XRoadEventEntity; -import com.mogo.module.common.enums.EventTypeEnum; +import com.mogo.eagle.core.data.enums.EventTypeEnum; import java.util.ArrayList; @@ -27,7 +26,7 @@ public class V2XMarkerAdapter { } /** - * 返回道路事件静态的图,因为D车机性能不行,会卡顿 + * 返回道路事件静态的图,因为车机性能不行,会卡顿 */ public static Bitmap getV2XRoadEventViewPng(Context context, V2XRoadEventEntity alarmInfo) { Bitmap bitmap; @@ -156,17 +155,4 @@ public class V2XMarkerAdapter { return icons; } - /** - * 获取模拟点 - * - * @param context 上下文 - * @return MarkerView - */ - public static Bitmap getV2XCarMarkerView(Context context, MarkerShowEntity showEntity) { - if (showEntity.isChecked()) { - return new V2XMarkerCarInfoView(context, showEntity).getView(); - } else { - return new V2XMarkerCarView(context, showEntity).getView(); - } - } } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerCarInfoView.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerCarInfoView.kt deleted file mode 100644 index aa3c0ac469..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerCarInfoView.kt +++ /dev/null @@ -1,144 +0,0 @@ -package com.mogo.eagle.core.function.v2x.events.marker - -import android.content.Context -import android.graphics.Bitmap -import android.text.TextUtils -import android.view.LayoutInflater -import android.view.View -import androidx.constraintlayout.widget.ConstraintLayout -import com.mogo.eagle.core.function.v2x.R -import com.mogo.eagle.core.function.v2x.events.entity.net.V2XSpecialCarRes.V2XMarkerEntity -import com.mogo.eagle.core.utilcode.util.ViewUtils -import com.mogo.module.common.entity.MarkerOnlineCar -import com.mogo.module.common.entity.MarkerShowEntity -import kotlinx.android.synthetic.main.view_marker_car.view.* -import kotlinx.android.synthetic.main.view_marker_car_info.view.* -import kotlinx.android.synthetic.main.view_marker_car_info.view.ivCar - -/** - * author : donghongyu - * e-mail : 1358506549@qq.com - * date : 2020-01-0619:55 - * desc : 绘制在线车辆,特殊车辆 - * version: 1.0 - */ -class V2XMarkerCarInfoView(context: Context, showEntity: MarkerShowEntity) : - ConstraintLayout(context) { - - init { - initView(context, showEntity) - } - - private fun initView(context: Context, showEntity: MarkerShowEntity) { - val bindObj: Any = showEntity.bindObj - if (bindObj is MarkerOnlineCar) { - //1 老司机 2 安全驾驶 3 危险驾驶 4 可直播车辆 - when (bindObj.userInfo.safeLabelType) { - // 可直播车机 - 4 -> { - LayoutInflater.from(context) - .inflate(R.layout.view_marker_car, this) - ivMarkerTip.setImageResource(R.drawable.v_to_x_marker_car_live_vedio) - } - else -> { - LayoutInflater.from(context) - .inflate(R.layout.view_marker_car_info, this) - } - } - } - if (bindObj is V2XMarkerEntity) { - LayoutInflater.from(context) - .inflate(R.layout.view_marker_car, this) - } - updateUI(showEntity) - } - - fun updateUI(showEntity: MarkerShowEntity) { - ivCar.rotation = showEntity.markerLocation.angle.toFloat() -// ivCar.rotation = 90f - - tvUserMarker.text = if (TextUtils.isEmpty(showEntity.textContent)) { - "" - } else { - showEntity.textContent - } - - val bindObj: Any = showEntity.bindObj - if (bindObj is MarkerOnlineCar) { - tvMarkerContent.text = - if (bindObj.userInfo == null && TextUtils.isEmpty(bindObj.userInfo.userName)) { - "蘑菇车主" - } else { - bindObj.userInfo.userName - } - - //车辆类型,0-普通车辆,1-警车,2-救护车,3-道路救援车辆', - when (bindObj.carInfo.vehicleType) { - // 普通车 - 0 -> { - clMarkerContent.visibility = View.VISIBLE - ivReverseTriangle.visibility = View.VISIBLE - ivCar.setImageResource(R.drawable.icon_car_gray) - } - // 警车 - 1 -> { - clMarkerContent.visibility = View.GONE - ivReverseTriangle.visibility = View.GONE - ivCar.setImageResource(R.drawable.icon_car_police) - } - // 救护车 - 2 -> { - clMarkerContent.visibility = View.GONE - ivReverseTriangle.visibility = View.GONE - ivCar.setImageResource(R.drawable.icon_car_ambulance) - } - // 道路救援车辆 - 3 -> { - clMarkerContent.visibility = View.GONE - ivReverseTriangle.visibility = View.GONE - ivCar.setImageResource(R.drawable.v_to_x_warning_car_red) - } - else -> { - clMarkerContent.visibility = View.GONE - ivReverseTriangle.visibility = View.GONE - ivCar.setImageResource(R.drawable.icon_car_gray) - } - } - } - if (bindObj is V2XMarkerEntity) { - when (bindObj.targetId) { - 10001 -> { - clMarkerContent.visibility = View.GONE - ivReverseTriangle.visibility = View.GONE - ivCar.setImageResource(R.drawable.icon_car_gray) - } - 10002 -> { - clMarkerContent.visibility = View.GONE - ivReverseTriangle.visibility = View.GONE - ivCar.setImageResource(R.drawable.icon_car_ambulance) - } - 10003 -> { - clMarkerContent.visibility = View.GONE - ivReverseTriangle.visibility = View.GONE - ivCar.setImageResource(R.drawable.icon_car_police) - } - //失控车 - 10004 -> { - clMarkerContent.visibility = View.GONE - ivReverseTriangle.visibility = View.GONE - ivCar.setImageResource(R.drawable.v_to_x_warning_car_red) - } - // 故障车 - 20007 -> { - clMarkerContent.visibility = View.GONE - ivReverseTriangle.visibility = View.GONE - ivCar.setImageResource(R.drawable.v_to_x_warning_car_red) - } - } - } - } - - fun getView(): Bitmap { - return ViewUtils.fromView(this) - } -} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerCarView.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerCarView.kt deleted file mode 100644 index fb0ab56d62..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerCarView.kt +++ /dev/null @@ -1,114 +0,0 @@ -package com.mogo.eagle.core.function.v2x.events.marker - -import android.content.Context -import android.graphics.Bitmap -import android.view.LayoutInflater -import android.view.View -import androidx.constraintlayout.widget.ConstraintLayout -import com.mogo.eagle.core.function.v2x.R -import com.mogo.eagle.core.function.v2x.events.entity.net.V2XSpecialCarRes.V2XMarkerEntity -import com.mogo.eagle.core.utilcode.util.ViewUtils -import com.mogo.module.common.entity.MarkerOnlineCar -import com.mogo.module.common.entity.MarkerShowEntity -import kotlinx.android.synthetic.main.view_marker_car.view.* - -/** - * author : donghongyu - * e-mail : 1358506549@qq.com - * date : 2020-01-0619:55 - * desc : 绘制在线车辆,特殊车辆 - * version: 1.0 - */ -class V2XMarkerCarView(context: Context, showEntity: MarkerShowEntity) : - ConstraintLayout(context) { - - init { - initView(context, showEntity) - } - - private fun initView(context: Context, showEntity: MarkerShowEntity) { - LayoutInflater.from(context) - .inflate(R.layout.view_marker_car, this) - updateUI(showEntity) - } - - fun updateUI(showEntity: MarkerShowEntity) { - ivCar.rotation = showEntity.markerLocation.angle.toFloat() - - val bindObj: Any = showEntity.bindObj - if (bindObj is MarkerOnlineCar) { - //1 老司机 2 安全驾驶 3 危险驾驶 4 可直播车辆 - when (bindObj.userInfo.safeLabelType) { - 1 -> { - ivMarkerTip.setImageResource(R.drawable.v_to_x_marker_car_blue) - } - 2 -> { - ivMarkerTip.setImageResource(R.drawable.v_to_x_marker_car_green) - } - 3 -> { - ivMarkerTip.setImageResource(R.drawable.v_to_x_marker_car_red) - } - 4 -> { - ivMarkerTip.setImageResource(R.drawable.v_to_x_marker_car_live_vedio) - } - } - - //车辆类型,0-普通车辆,1-警车,2-救护车,3-道路救援车辆', - when (bindObj.carInfo.vehicleType) { - // 普通车 - 0 -> { - ivMarkerTip.visibility = View.VISIBLE - ivCar.setImageResource(R.drawable.icon_car_gray) - } - // 警车 - 1 -> { - ivMarkerTip.visibility = View.GONE - ivCar.setImageResource(R.drawable.icon_car_police) - } - // 救护车 - 2 -> { - ivMarkerTip.visibility = View.GONE - ivCar.setImageResource(R.drawable.icon_car_ambulance) - } - // 道路救援车辆 - 3 -> { - ivMarkerTip.visibility = View.GONE - ivCar.setImageResource(R.drawable.v_to_x_warning_car_red) - } - else -> { - ivMarkerTip.visibility = View.GONE - ivCar.setImageResource(R.drawable.icon_car_gray) - } - } - } - if (bindObj is V2XMarkerEntity) { - when (bindObj.targetId) { - 10001 -> { - ivMarkerTip.visibility = View.GONE - ivCar.setImageResource(R.drawable.icon_car_gray) - } - 10002 -> { - ivMarkerTip.visibility = View.GONE - ivCar.setImageResource(R.drawable.icon_car_ambulance) - } - 10003 -> { - ivMarkerTip.visibility = View.GONE - ivCar.setImageResource(R.drawable.icon_car_police) - } - 10004 -> { - ivMarkerTip.visibility = View.GONE - ivCar.setImageResource(R.drawable.v_to_x_warning_car_red) - } - // 故障车 - 20007 -> { - ivMarkerTip.visibility = View.GONE - ivCar.setImageResource(R.drawable.v_to_x_warning_car_red) - } - } - } - } - - fun getView(): Bitmap { - return ViewUtils.fromView(this) - } -} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerRoadEventView.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerRoadEventView.kt index 02cbd0cee3..2fe26980a0 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerRoadEventView.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerRoadEventView.kt @@ -5,10 +5,10 @@ import android.content.Context import android.graphics.Bitmap import android.view.LayoutInflater import androidx.constraintlayout.widget.ConstraintLayout +import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity import com.mogo.eagle.core.function.v2x.R import com.mogo.eagle.core.utilcode.util.ViewUtils -import com.mogo.module.common.entity.V2XRoadEventEntity -import com.mogo.module.common.enums.EventTypeEnum +import com.mogo.eagle.core.data.enums.EventTypeEnum import kotlinx.android.synthetic.main.view_marker_event_car.view.* /** diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/network/V2XApiServiceFactory.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/network/V2XApiServiceFactory.java index 8f687d8f5c..b20266d1f5 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/network/V2XApiServiceFactory.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/network/V2XApiServiceFactory.java @@ -1,7 +1,7 @@ package com.mogo.eagle.core.function.v2x.events.network; import com.mogo.eagle.core.network.MoGoRetrofitFactory; -import com.mogo.module.common.constants.HostConst; +import com.mogo.eagle.core.data.constants.HostConst; /** * 应对不同接口对应不同服务域名的工厂累 diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/SceneBroadcastReceiver.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/SceneBroadcastReceiver.kt index f093b60e02..a9790d35a9 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/SceneBroadcastReceiver.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/SceneBroadcastReceiver.kt @@ -3,9 +3,9 @@ package com.mogo.eagle.core.function.v2x.events.receiver import android.content.BroadcastReceiver import android.content.Context import android.content.Intent +import com.mogo.eagle.core.data.map.entity.V2XMessageEntity import com.mogo.eagle.core.function.v2x.events.consts.V2XConst import com.mogo.eagle.core.function.v2x.events.scenario.impl.V2XScenarioManager -import com.mogo.module.common.entity.V2XMessageEntity import java.lang.Exception class SceneBroadcastReceiver: BroadcastReceiver() { diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/TestPanelBroadcastReceiver.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/TestPanelBroadcastReceiver.java index de171cf38c..acb38623e6 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/TestPanelBroadcastReceiver.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/TestPanelBroadcastReceiver.java @@ -6,20 +6,19 @@ import android.content.Intent; import androidx.localbroadcastmanager.content.LocalBroadcastManager; +import com.mogo.commons.module.status.MogoStatusManager; import com.mogo.eagle.core.data.map.MogoLatLng; +import com.mogo.eagle.core.data.map.entity.MarkerExploreWay; +import com.mogo.eagle.core.data.map.entity.V2XMessageEntity; +import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; import com.mogo.eagle.core.function.call.chat.CallerChatManager; import com.mogo.eagle.core.function.call.map.CallerSmpManager; -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.entity.net.V2XOptimalRouteDataRes; import com.mogo.eagle.core.function.v2x.events.entity.net.V2XSpecialCarRes; import com.mogo.eagle.core.function.v2x.events.utils.TestOnLineCarUtils; import com.mogo.eagle.core.function.v2x.events.utils.V2XSQLiteUtils; import com.mogo.eagle.core.utilcode.util.Utils; -import com.mogo.module.common.entity.MarkerExploreWay; -import com.mogo.module.common.entity.V2XMessageEntity; -import com.mogo.module.common.entity.V2XRoadEventEntity; -import com.mogo.service.statusmanager.IMogoStatusManager; import java.util.List; @@ -66,7 +65,8 @@ public class TestPanelBroadcastReceiver extends BroadcastReceiver { // 存储本地,出行动态作展示 saveLocalStory(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING, v2XMessageEntity.getContent().getNoveltyInfo()); - } if (sceneType == 2) {// 触发AI道路施工事件 + } + if (sceneType == 2) {// 触发AI道路施工事件 V2XMessageEntity v2XMessageEntity = TestOnLineCarUtils.getV2XScenarioAIRoadEventData(); Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); @@ -129,10 +129,7 @@ public class TestPanelBroadcastReceiver extends BroadcastReceiver { Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity); LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); - IMogoStatusManager statusManager = BridgeApi.INSTANCE.statusManager(); - if (statusManager != null) { - statusManager.setSeekHelping(V2XConst.MODULE_NAME, true); - } + MogoStatusManager.getInstance().setSeekHelping(V2XConst.MODULE_NAME, true); } else if (sceneType == 20) {// 小地图绘制线 List coordinates = TestOnLineCarUtils.getTestCoordinates(); CallerSmpManager.drawablePolyline(coordinates); diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/IV2XScenario.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/IV2XScenario.java index d442e28196..40ef63740f 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/IV2XScenario.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/IV2XScenario.java @@ -1,6 +1,6 @@ package com.mogo.eagle.core.function.v2x.events.scenario; -import com.mogo.module.common.entity.V2XMessageEntity; +import com.mogo.eagle.core.data.map.entity.V2XMessageEntity; /** * author : donghongyu diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/IV2XScenarioManager.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/IV2XScenarioManager.java index 90be90fbb1..7e055dcca3 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/IV2XScenarioManager.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/IV2XScenarioManager.java @@ -1,6 +1,7 @@ package com.mogo.eagle.core.function.v2x.events.scenario; -import com.mogo.module.common.entity.V2XMessageEntity; + +import com.mogo.eagle.core.data.map.entity.V2XMessageEntity; /** * author : donghongyu diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/AbsV2XScenario.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/AbsV2XScenario.java index f13fae8a64..cd72feafbd 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/AbsV2XScenario.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/AbsV2XScenario.java @@ -2,9 +2,10 @@ package com.mogo.eagle.core.function.v2x.events.scenario.impl; import androidx.annotation.Nullable; + +import com.mogo.eagle.core.data.map.entity.V2XMessageEntity; import com.mogo.eagle.core.function.v2x.events.scenario.IV2XScenario; import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker; -import com.mogo.module.common.entity.V2XMessageEntity; /** * author : donghongyu diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/V2XScenarioManager.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/V2XScenarioManager.java index f1b6a9b176..e8024eadf1 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/V2XScenarioManager.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/V2XScenarioManager.java @@ -6,22 +6,19 @@ import android.content.Intent; import androidx.localbroadcastmanager.content.LocalBroadcastManager; -import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.AiRoadMarker; -import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; -import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi; +import com.mogo.commons.module.status.MogoStatusManager; +import com.mogo.eagle.core.data.map.entity.V2XMessageEntity; import com.mogo.eagle.core.function.v2x.events.consts.V2XConst; import com.mogo.eagle.core.function.v2x.events.scenario.IV2XScenarioManager; import com.mogo.eagle.core.function.v2x.events.scenario.scene.road.V2XRoadEventScenario; import com.mogo.eagle.core.function.v2x.events.scenario.scene.route.V2XOptimalRouteVREventScenario; import com.mogo.eagle.core.function.v2x.events.scenario.scene.warning.V2XFrontWarningScenario; -import com.mogo.eagle.core.utilcode.mogo.toast.TipToast; +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.util.ThreadUtils; import com.mogo.eagle.core.utilcode.util.Utils; import com.mogo.map.MogoMapUIController; import com.mogo.map.uicontroller.IMogoMapUIController; import com.mogo.map.uicontroller.VisualAngleMode; -import com.mogo.module.common.entity.V2XMessageEntity; -import com.mogo.service.statusmanager.IMogoStatusManager; /** * author : donghongyu @@ -74,12 +71,7 @@ public class V2XScenarioManager implements IV2XScenarioManager { break; case V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_WEAKNESS: sceneChange(); - boolean isVrMode1 = false; - IMogoStatusManager statusManager1 = BridgeApi.INSTANCE.statusManager(); - if (statusManager1 != null) { - isVrMode1 = statusManager1.isVrMode(); - } - if (isVrMode1) { + if (MogoStatusManager.getInstance().isVrMode()) { mV2XScenario = new V2XFrontWarningScenario(); } else { mV2XScenario = null; diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/airoad/AiRoadMarker.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/airoad/AiRoadMarker.kt index 4eed099ce7..5adc3dda75 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/airoad/AiRoadMarker.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/airoad/AiRoadMarker.kt @@ -10,8 +10,10 @@ import androidx.lifecycle.* import androidx.lifecycle.Lifecycle.Event import androidx.lifecycle.Lifecycle.Event.ON_CREATE import androidx.lifecycle.Lifecycle.Event.ON_DESTROY +import com.mogo.commons.utils.DrivingDirectionUtils import com.mogo.eagle.core.data.map.* import com.mogo.eagle.core.data.map.MapRoadInfo.StopLine +import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity import com.mogo.eagle.core.function.api.map.listener.* import com.mogo.eagle.core.function.api.v2x.* import com.mogo.eagle.core.function.call.map.* @@ -23,8 +25,6 @@ import com.mogo.eagle.core.utilcode.kotlin.* import com.mogo.eagle.core.utilcode.mogo.logger.* import com.mogo.map.* import com.mogo.map.overlay.* -import com.mogo.module.common.entity.* -import com.mogo.module.common.utils.* import io.netty.util.internal.* import java.lang.Runnable import java.util.* diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt index 4689c0d8d7..971eec6f0b 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt @@ -3,15 +3,15 @@ package com.mogo.eagle.core.function.v2x.events.scenario.scene.road import android.graphics.* import android.util.* import com.mogo.cloud.commons.utils.* +import com.mogo.commons.utils.DrivingDirectionUtils import com.mogo.eagle.core.data.map.* +import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi.context import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi.v2xMarker import com.mogo.map.* import com.mogo.map.R.raw import com.mogo.map.marker.* import com.mogo.map.overlay.* -import com.mogo.module.common.entity.* -import com.mogo.module.common.utils.* import java.util.* import java.util.concurrent.atomic.* import kotlin.Pair diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventMarker.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventMarker.java index f992e577d8..7b0637ba7e 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventMarker.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventMarker.java @@ -2,16 +2,15 @@ package com.mogo.eagle.core.function.v2x.events.scenario.scene.road; import androidx.core.util.Pair; -import com.mogo.cloud.commons.utils.CoordinateUtils; +import com.mogo.eagle.core.data.map.entity.MarkerExploreWay; +import com.mogo.eagle.core.data.map.entity.MarkerLocation; +import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi; import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XMarkerManager; import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XPolylineManager; import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.AiRoadMarker; import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker; -import com.mogo.module.common.entity.MarkerExploreWay; -import com.mogo.module.common.entity.MarkerLocation; -import com.mogo.module.common.entity.V2XRoadEventEntity; -import com.mogo.module.common.enums.EventTypeEnum; +import com.mogo.eagle.core.data.enums.EventTypeEnum; import java.util.ArrayList; import java.util.List; diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java index 9b6d11fc98..8ccb7815ce 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java @@ -2,23 +2,21 @@ package com.mogo.eagle.core.function.v2x.events.scenario.scene.road; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X; +import com.mogo.commons.analytics.AnalyticsUtils; import com.mogo.eagle.core.data.enums.WarningDirectionEnum; +import com.mogo.eagle.core.data.map.entity.MarkerExploreWay; +import com.mogo.eagle.core.data.map.entity.V2XMessageEntity; +import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener; import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager; -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.manager.V2XStatusManager; import com.mogo.eagle.core.function.v2x.events.scenario.impl.AbsV2XScenario; import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker; import com.mogo.eagle.core.network.utils.GsonUtil; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; -import com.mogo.module.common.entity.MarkerExploreWay; -import com.mogo.module.common.entity.V2XMessageEntity; -import com.mogo.module.common.entity.V2XRoadEventEntity; -import com.mogo.module.common.enums.EventTypeEnum; -import com.mogo.service.analytics.IMogoAnalytics; -import com.mogo.service.v2x.DisplayEffectsInterface; +import com.mogo.eagle.core.data.enums.EventTypeEnum; import java.util.HashMap; import java.util.Map; @@ -70,29 +68,27 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp boolean onlyShow = getV2XMessageEntity().isOnlyShow(); if (!onlyShow) { // 设置TTS - getV2XMessageEntity().getContent().getTts(false); + getV2XMessageEntity().getContent().getTts(); } showWindow(); - IMogoAnalytics analytics = BridgeApi.INSTANCE.analytics(); - if (analytics != null) { - String poiType = getV2XMessageEntity().getContent().getPoiType(); - String lat = String.valueOf(getV2XMessageEntity().getContent().getLocation().getLat()); - String lon = String.valueOf(getV2XMessageEntity().getContent().getLocation().getLon()); - String infoId = getV2XMessageEntity().getContent().getNoveltyInfo().getInfoId(); - String style = "1"; - Map properties = new HashMap<>(); - properties.put("dbid", infoId); - properties.put("type", poiType); - properties.put("lng", lon); - properties.put("lat", lat); - properties.put("style", style); - analytics.track(V2XConst.V2X_ROAD_SHOW, properties); - } + String poiType = getV2XMessageEntity().getContent().getPoiType(); + String lat = String.valueOf(getV2XMessageEntity().getContent().getLocation().getLat()); + String lon = String.valueOf(getV2XMessageEntity().getContent().getLocation().getLon()); + String infoId = getV2XMessageEntity().getContent().getNoveltyInfo().getInfoId(); + String style = "1"; + Map properties = new HashMap<>(); + properties.put("dbid", infoId); + properties.put("type", poiType); + properties.put("lng", lon); + properties.put("lat", lat); + properties.put("style", style); + AnalyticsUtils.track(V2XConst.V2X_ROAD_SHOW, properties); } } catch (Exception e) { e.printStackTrace(); } } + private void showWindow() { V2XMessageEntity entity = getV2XMessageEntity(); V2XRoadEventEntity content = entity != null ? entity.getContent() : null; @@ -131,12 +127,11 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp if (entity.isNeedAddLine()) { drawPOI(); } - DisplayEffectsInterface wu = BridgeApi.INSTANCE.displayEffects(); V2XRoadEventEntity content = entity.getContent(); - if (wu != null && content != null) { + if (content != null) { MarkerExploreWay noveltyInfo = content.getNoveltyInfo(); if (noveltyInfo != null && EventTypeEnum.FOURS_FOG.getPoiType().equals(content.getNoveltyInfo().getPoiType())) { - wu.displayEffects(EventTypeEnum.FOURS_FOG.getPoiType()); + CallerHmiManager.INSTANCE.displayEffects(); } } } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/route/V2XOptimalRouteVREventScenario.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/route/V2XOptimalRouteVREventScenario.java index 642da8f42a..bc12e44e79 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/route/V2XOptimalRouteVREventScenario.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/route/V2XOptimalRouteVREventScenario.java @@ -4,6 +4,7 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X import androidx.annotation.Nullable; +import com.mogo.eagle.core.data.map.entity.V2XMessageEntity; import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener; import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; @@ -13,7 +14,6 @@ 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.scenario.view.IV2XMarker; import com.mogo.eagle.core.network.utils.GsonUtil; -import com.mogo.module.common.entity.V2XMessageEntity; import java.util.concurrent.TimeUnit; diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XFrontWarningScenario.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XFrontWarningScenario.java index b1059d7077..e45788e227 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XFrontWarningScenario.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XFrontWarningScenario.java @@ -9,13 +9,13 @@ import android.text.style.ForegroundColorSpan; import androidx.annotation.Nullable; import com.mogo.eagle.core.data.enums.WarningDirectionEnum; import com.mogo.eagle.core.data.map.MogoLocation; +import com.mogo.eagle.core.data.map.entity.V2XMessageEntity; import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener; import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener; import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.function.v2x.events.scenario.impl.AbsV2XScenario; import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker; -import com.mogo.module.common.entity.V2XMessageEntity; import com.mogo.v2x.data.V2XWarningTarget; import java.math.BigDecimal; import java.util.Locale; diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XWarningMarker.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XWarningMarker.java index 6c75c97edd..934749b42e 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XWarningMarker.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XWarningMarker.java @@ -1,36 +1,37 @@ package com.mogo.eagle.core.function.v2x.events.scenario.scene.warning; -import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X; +import static com.mogo.eagle.core.data.constants.DataTypes.TYPE_MARKER_CLOUD_STOP_LINE_DATA; +import static com.mogo.eagle.core.data.constants.DataTypes.TYPE_MARKER_CLOUD_WARN_DATA; import static com.mogo.eagle.core.function.v2x.events.consts.V2XConst.V2X_FRONT_WARNING_MARKER; -import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_STOP_LINE_DATA; -import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_WARN_DATA; +import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X; import com.mogo.cloud.commons.utils.CoordinateUtils; import com.mogo.commons.AbsMogoApplication; +import com.mogo.commons.module.status.MogoStatusManager; import com.mogo.eagle.core.data.map.MogoLatLng; import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; -import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; +import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi; import com.mogo.eagle.core.function.v2x.events.entity.model.DrawLineInfo; import com.mogo.eagle.core.function.v2x.events.manager.IMoGoPersonWarnPolylineManager; import com.mogo.eagle.core.function.v2x.events.manager.IMoGoStopPolylineManager; import com.mogo.eagle.core.function.v2x.events.manager.IMoGoWarnPolylineManager; import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker; +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler; import com.mogo.eagle.core.utilcode.util.UiThreadHandler; import com.mogo.map.MogoMarkerManager; import com.mogo.map.marker.IMogoMarkerManager; import com.mogo.map.overlay.IMogoPolyline; -import com.mogo.module.common.MogoApisHandler; -import com.mogo.module.common.drawer.V2XWarnDataDrawer; -import com.mogo.module.common.utils.Trigonometric; +import com.mogo.commons.utils.Trigonometric; import com.mogo.v2x.data.V2XLocation; import com.mogo.v2x.data.V2XWarningTarget; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Objects; /** * @author liujing @@ -110,7 +111,7 @@ public class V2XWarningMarker implements IV2XMarker { warningLocation); */ - V2XWarnDataDrawer.getInstance().renderWarnData(mCloundWarningInfo.getLon(), mCloundWarningInfo.getLat(), mCloundWarningInfo.getType(), mCloundWarningInfo.getCollisionLat(), mCloundWarningInfo.getCollisionLon(), mCloundWarningInfo.getAngle(), mCloundWarningInfo.getShowTime()); + Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerService()).renderWarningMoveMarker(mCloundWarningInfo.getLon(), mCloundWarningInfo.getLat(), mCloundWarningInfo.getType(), mCloundWarningInfo.getCollisionLat(), mCloundWarningInfo.getCollisionLon(), mCloundWarningInfo.getAngle(), mCloundWarningInfo.getShowTime()); //添加停止线marker //衡阳交付-取消划线需求,只渲染识别物红色模型移动过程 @@ -134,8 +135,13 @@ public class V2XWarningMarker implements IV2XMarker { CallerLogger.INSTANCE.d(M_V2X + TAG, "数据为空carLocation == null"); } */ - V2XWarnDataDrawer.getInstance().renderWarnData(mCloundWarningInfo.getLon(), mCloundWarningInfo.getLat(), mCloundWarningInfo.getType(), mCloundWarningInfo.getCollisionLat(), mCloundWarningInfo.getCollisionLon(), mCloundWarningInfo.getAngle(), mCloundWarningInfo.getShowTime()); - + Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerService()).renderWarningMoveMarker(mCloundWarningInfo.getLon() + , mCloundWarningInfo.getLat() + , mCloundWarningInfo.getType() + , mCloundWarningInfo.getCollisionLat() + , mCloundWarningInfo.getCollisionLon() + , mCloundWarningInfo.getAngle() + , mCloundWarningInfo.getShowTime()); }, 0); } @@ -271,7 +277,7 @@ public class V2XWarningMarker implements IV2XMarker { entity.setLat(latLng.lat); entity.setLon(latLng.lon); entity.setHeading(mCloundWarningInfo.getHeading()); - V2XWarnDataDrawer.getInstance().renderStopLineData(entity.getLon(), entity.getLat()); + Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerService()).renderStopLineMarker(entity.getLon(), entity.getLat()); } } } catch (Exception e) { @@ -417,7 +423,7 @@ public class V2XWarningMarker implements IV2XMarker { for (int i = 0; i < count; i++) { MogoLatLng newLo = Trigonometric.getNewLocation( startLatLng.getLon(), startLatLng.getLat(), 5 * (i + 1), Trigonometric.getAngle(startLatLng.lon, startLatLng.lat, endLatLng.lon, endLatLng.lat)); - V2XWarnDataDrawer.getInstance().drawerArrowsMarkerWithLocation(newLo, WARNING_ARROWS, 10, new Double(rotate).intValue()); + Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerService()).drawerArrowsMarkerWithLocation(newLo, WARNING_ARROWS, 10, new Double(rotate).intValue()); CallerLogger.INSTANCE.d(M_V2X + TAG, "小箭头位置" + newLo); } } @@ -427,7 +433,7 @@ public class V2XWarningMarker implements IV2XMarker { //线随车动 public void onCarLocationChanged2(MogoLocation latLng) { carLocation = new MogoLatLng(latLng.getLatitude(), latLng.getLongitude()); - if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() && isSelfLineClear == false) { + if (MogoStatusManager.getInstance().isVrMode() && !isSelfLineClear) { if (mCloundWarningInfo != null) { V2XLocation v2XLocation = new V2XLocation(); v2XLocation.setLat(latLng.getLatitude()); @@ -437,7 +443,7 @@ public class V2XWarningMarker implements IV2XMarker { //衡阳交付-取消划线需求,只渲染识别物红色模型移动过程 //drawSelfCarLine(latLng.getLongitude(), latLng.getLatitude(), latLng.getBearing()); } - CallerLogger.INSTANCE.d(M_V2X + TAG, "车辆行驶轨迹" + String.valueOf(latLng.getLongitude()) + "," + String.valueOf(latLng.getLatitude())); + CallerLogger.INSTANCE.d(M_V2X + TAG, "车辆行驶轨迹" + latLng.getLongitude() + "," + latLng.getLatitude()); } @Override diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/EntityUtils.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/EntityUtils.kt index 2165993bf9..042c5b9e54 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/EntityUtils.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/EntityUtils.kt @@ -1,8 +1,8 @@ package com.mogo.eagle.core.function.v2x.events.utils -import com.mogo.module.common.entity.MarkerExploreWay -import com.mogo.module.common.entity.MarkerLocation -import com.mogo.module.common.entity.MarkerUserInfo +import com.mogo.eagle.core.data.map.entity.MarkerExploreWay +import com.mogo.eagle.core.data.map.entity.MarkerLocation +import com.mogo.eagle.core.data.map.entity.MarkerUserInfo import com.mogo.v2x.data.MarkerExploreWayItem import com.mogo.v2x.data.V2XMarkerExploreWay import com.mogo.v2x.data.V2XMarkerLocation @@ -16,7 +16,7 @@ fun V2XMarkerLocation?.toMarkerLocation(): MarkerLocation? = if (this == null) n it.angle = this.angle } -fun MarkerExploreWayItem?.toMarkerExploreWayItem(): com.mogo.module.common.entity.MarkerExploreWayItem? = if (this == null) null else com.mogo.module.common.entity.MarkerExploreWayItem().also { +fun MarkerExploreWayItem?.toMarkerExploreWayItem(): com.mogo.eagle.core.data.map.entity.MarkerExploreWayItem? = if (this == null) null else com.mogo.eagle.core.data.map.entity.MarkerExploreWayItem().also { it.illegalCount = this.illegalCount it.content = this.content it.url = this.url diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/LocationUtils.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/LocationUtils.java index 5065941603..64d51123ba 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/LocationUtils.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/LocationUtils.java @@ -8,11 +8,8 @@ import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; -import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi; -import com.mogo.eagle.core.utilcode.util.AppUtils; import com.mogo.map.location.IMogoLocationClient; import com.mogo.map.uicontroller.IMogoMapUIController; -import com.mogo.module.common.MogoApisHandler; /** * author : donghongyu diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/MapUtils.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/MapUtils.kt index e92c8eacae..09ec0fb754 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/MapUtils.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/MapUtils.kt @@ -5,11 +5,7 @@ import android.graphics.Rect import com.mogo.eagle.core.data.map.MogoLatLng import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager -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 class MapUtils { @@ -22,34 +18,18 @@ class MapUtils { return } val mBoundRect = Rect() - val paddingTop: Int - val paddingBottom: Int - val paddingRight: Int - val paddingLeft: Int - if (CarSeries.isF8xxSeries()) { - paddingTop = WindowUtils.dip2px(context, 250f) - paddingBottom = WindowUtils.dip2px(context, 100f) - paddingRight = WindowUtils.dip2px(context, 100f) - paddingLeft = WindowUtils.dip2px(context, 475f) - } else { - paddingTop = WindowUtils.dip2px(context, 370f) - paddingBottom = WindowUtils.dip2px(context, 100f) - paddingRight = WindowUtils.dip2px(context, 100f) - paddingLeft = WindowUtils.dip2px(context, 575f) - } - mBoundRect.bottom = paddingBottom - mBoundRect.top = paddingTop - mBoundRect.left = paddingLeft - mBoundRect.right = paddingRight + mBoundRect.bottom = WindowUtils.dip2px(context, 100f) + mBoundRect.top = WindowUtils.dip2px(context, 370f) + mBoundRect.left = WindowUtils.dip2px(context, 575f) + mBoundRect.right = WindowUtils.dip2px(context, 100f) // 当前车辆位置 val carLocation = MogoLatLng( CallerAutoPilotStatusListenerManager.getCurWgs84Lat(), CallerAutoPilotStatusListenerManager.getCurWgs84Lon() ) // 调整自适应的地图镜头 - carLocation?.let { - CallerMapUIServiceManager.getMapUIController()?.showBounds("MapUtils", it, listOf(latLng), mBoundRect, true) - } + CallerMapUIServiceManager.getMapUIController() + ?.showBounds("MapUtils", carLocation, listOf(latLng), mBoundRect, true) } catch (e: Exception) { e.printStackTrace() } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/TestOnLineCarUtils.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/TestOnLineCarUtils.java index 1dbffa8b64..65b023b98d 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/TestOnLineCarUtils.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/TestOnLineCarUtils.java @@ -1,20 +1,19 @@ package com.mogo.eagle.core.function.v2x.events.utils; -import static com.mogo.module.common.entity.V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING; +import static com.mogo.eagle.core.data.map.entity.V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING; import com.mogo.eagle.core.data.map.MogoLatLng; +import com.mogo.eagle.core.data.map.entity.MarkerExploreWay; +import com.mogo.eagle.core.data.map.entity.MarkerLocation; +import com.mogo.eagle.core.data.map.entity.MarkerResponse; +import com.mogo.eagle.core.data.map.entity.V2XMessageEntity; +import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; +import com.mogo.eagle.core.data.map.entity.V2XWarningEntity; import com.mogo.eagle.core.function.v2x.R; import com.mogo.eagle.core.function.v2x.events.entity.net.V2XOptimalRouteDataRes; import com.mogo.eagle.core.function.v2x.events.entity.net.V2XSpecialCarRes; import com.mogo.eagle.core.network.utils.GsonUtil; import com.mogo.eagle.core.utilcode.util.Utils; -import com.mogo.module.common.entity.MarkerExploreWay; -import com.mogo.module.common.entity.MarkerLocation; -import com.mogo.module.common.entity.MarkerResponse; -import com.mogo.module.common.entity.V2XMessageEntity; -import com.mogo.module.common.entity.V2XRoadEventEntity; -import com.mogo.module.common.entity.V2XWarningEntity; -import com.mogo.v2x.event.V2XEvent; import java.io.ByteArrayOutputStream; import java.io.InputStream; diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/TrackUtils.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/TrackUtils.java index 279fac491a..a1eec13954 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/TrackUtils.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/TrackUtils.java @@ -1,9 +1,8 @@ package com.mogo.eagle.core.function.v2x.events.utils; -import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi; +import com.mogo.commons.analytics.AnalyticsUtils; import com.mogo.eagle.core.function.v2x.events.consts.V2XConst; import com.mogo.eagle.core.function.v2x.events.manager.V2XStatusManager; -import com.mogo.service.analytics.IMogoAnalytics; import java.util.HashMap; import java.util.Map; @@ -15,17 +14,13 @@ public class TrackUtils { //埋点 public static void trackV2xRoadShow(String dbid, String type, String style) { try { - IMogoAnalytics analytics = BridgeApi.INSTANCE.analytics(); - if (analytics == null) { - return; - } Map properties = new HashMap<>(); properties.put("dbid", dbid); properties.put("type", type); properties.put("lng", V2XStatusManager.getInstance().getLocation().getLongitude()); properties.put("lat", V2XStatusManager.getInstance().getLocation().getLatitude()); properties.put("style", style); - analytics.track(V2XConst.V2X_ROAD_SHOW, properties); + AnalyticsUtils.track(V2XConst.V2X_ROAD_SHOW, properties); } catch (Exception e) { e.printStackTrace(); } @@ -34,15 +29,11 @@ public class TrackUtils { //道路事件操作埋点 v2x_road_event public static void trackV2xRoadEvent(String dbid, String sn, String type) { try { - IMogoAnalytics analytics = BridgeApi.INSTANCE.analytics(); - if (analytics == null) { - return; - } Map properties = new HashMap<>(); properties.put("dbid", dbid); properties.put("sn", sn); properties.put("type", type); - analytics.track(V2XConst.V2X_ROAD_EVET, properties); + AnalyticsUtils.track(V2XConst.V2X_ROAD_EVET, properties); } catch (Exception e) { e.printStackTrace(); } @@ -54,13 +45,9 @@ public class TrackUtils { */ public static void trackV2xRoadProduceEvent(int type) { try { - IMogoAnalytics analytics = BridgeApi.INSTANCE.analytics(); - if (analytics == null) { - return; - } Map properties = new HashMap<>(); properties.put("type", type); - analytics.track(V2XConst.V2X_ROAD_PRODUCE, properties); + AnalyticsUtils.track(V2XConst.V2X_ROAD_PRODUCE, properties); } catch (Exception e) { e.printStackTrace(); } @@ -68,13 +55,9 @@ public class TrackUtils { public static void trackV2XMarkerClick(int type) { try { - IMogoAnalytics analytics = BridgeApi.INSTANCE.analytics(); - if (analytics == null) { - return; - } Map properties = new HashMap<>(); properties.put("type", type); - analytics.track(V2XConst.LAUNCHER_ICON_CLICK, properties); + AnalyticsUtils.track(V2XConst.LAUNCHER_ICON_CLICK, properties); } catch (Exception e) { e.printStackTrace(); } @@ -95,13 +78,9 @@ public class TrackUtils { */ public static void trackV2xHistoryEvent(int type) { try { - IMogoAnalytics analytics = BridgeApi.INSTANCE.analytics(); - if (analytics == null) { - return; - } Map properties = new HashMap<>(); properties.put("type", type); - analytics.track(V2XConst.V2X_ROAD_EVET_HISTORY_BUTTON, properties); + AnalyticsUtils.track(V2XConst.V2X_ROAD_EVET_HISTORY_BUTTON, properties); } catch (Exception e) { e.printStackTrace(); } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/V2XSQLiteUtils.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/V2XSQLiteUtils.java index ffcd3ce0d4..19e697b0e1 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/V2XSQLiteUtils.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/V2XSQLiteUtils.java @@ -2,13 +2,13 @@ package com.mogo.eagle.core.function.v2x.events.utils; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X; +import com.mogo.eagle.core.data.map.entity.V2XEventZanData; +import com.mogo.eagle.core.data.map.entity.V2XHistoryScenarioData; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.network.utils.GsonUtil; import com.mogo.eagle.core.utilcode.mogo.sqlite.SQLIDao; import com.mogo.eagle.core.utilcode.util.TimeUtils; import com.mogo.eagle.core.utilcode.util.Utils; -import com.mogo.module.common.entity.V2XEventZanData; -import com.mogo.module.common.entity.V2XHistoryScenarioData; import com.mogo.utils.sqlite.SQLDaoFactory; import java.util.List; diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/view/HeartLikeView.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/view/HeartLikeView.java index d9e1775efd..4f123ab83c 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/view/HeartLikeView.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/view/HeartLikeView.java @@ -12,9 +12,8 @@ import android.widget.LinearLayout; import androidx.annotation.Nullable; +import com.mogo.commons.module.status.MogoStatusManager; import com.mogo.eagle.core.function.v2x.R; -import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi; -import com.mogo.service.statusmanager.IMogoStatusManager; /** @@ -42,11 +41,7 @@ public class HeartLikeView extends LinearLayout implements Animator.AnimatorList super(context, attrs, defStyleAttr); TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.HeartLikeView, defStyleAttr, 0); - boolean isVrMode = false; - IMogoStatusManager statusManager = BridgeApi.INSTANCE.statusManager(); - if (statusManager != null) { - isVrMode = statusManager.isVrMode(); - } + boolean isVrMode = MogoStatusManager.getInstance().isVrMode(); boolean showGrayBack = typedArray.getBoolean(R.styleable.HeartLikeView_showGrayBack, false); @@ -57,14 +52,12 @@ public class HeartLikeView extends LinearLayout implements Animator.AnimatorList inflate(context, isVrMode ? R.layout.view_heart_like_vr : R.layout.view_heart_like, this); mIllegalParkingLike = findViewById(R.id.ivIllegalParkingLike); } - - boolean finalIsVrMode = isVrMode; setOnClickListener(v -> { if (!isAnimator) { isAnimator = true; if (mAnimatorSet == null) { mAnimatorSet = (AnimatorSet) AnimatorInflater.loadAnimator(getContext(), - finalIsVrMode ? R.animator.v2x_like_heart_animation_vr : R.animator.v2x_like_heart_animation); + isVrMode ? R.animator.v2x_like_heart_animation_vr : R.animator.v2x_like_heart_animation); mAnimatorSet.setTarget(mIllegalParkingLike); mAnimatorSet.addListener(this); } @@ -84,12 +77,7 @@ public class HeartLikeView extends LinearLayout implements Animator.AnimatorList if (mOnClickCallListener != null) { mOnClickCallListener.onClicked(HeartLikeView.this); } - boolean isVrMode = false; - IMogoStatusManager statusManager = BridgeApi.INSTANCE.statusManager(); - if (statusManager != null) { - isVrMode = statusManager.isVrMode(); - } - if (isVrMode) { + if (MogoStatusManager.getInstance().isVrMode()) { mIllegalParkingLike.setImageResource(R.drawable.module_common_icon_like_selected_vr); } } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/view/HeartUnLikeView.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/view/HeartUnLikeView.java index b050310a98..1cc972fba2 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/view/HeartUnLikeView.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/view/HeartUnLikeView.java @@ -13,9 +13,8 @@ import android.widget.LinearLayout; import androidx.annotation.Nullable; +import com.mogo.commons.module.status.MogoStatusManager; import com.mogo.eagle.core.function.v2x.R; -import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi; -import com.mogo.service.statusmanager.IMogoStatusManager; /** @@ -42,29 +41,24 @@ public class HeartUnLikeView extends LinearLayout implements Animator.AnimatorLi public HeartUnLikeView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); - boolean isVrMode = false; - IMogoStatusManager statusManager = BridgeApi.INSTANCE.statusManager(); - if (statusManager != null) { - isVrMode = statusManager.isVrMode(); - } + boolean isVrMode = MogoStatusManager.getInstance().isVrMode(); inflate(context, isVrMode ? R.layout.view_heart_unlike_vr : R.layout.view_heart_unlike, this); mIllegalParkingUnLike = findViewById(R.id.ivIllegalParkingUnLike); animationImageView = findViewById(R.id.animationImage); - boolean finalIsVrMode = isVrMode; setOnClickListener(v -> { if (!isAnimator) { isAnimator = true; if (mAnimatorSet == null) { mAnimatorSet = (AnimatorSet) AnimatorInflater.loadAnimator(getContext(), - finalIsVrMode ? + isVrMode ? R.animator.v2x_unlike_heart_animation_vr : R.animator.v2x_unlike_heart_animation); mAnimatorSet.setTarget(mIllegalParkingUnLike); mAnimatorSet.addListener(this); } mAnimatorSet.start(); } - if (finalIsVrMode) { + if (isVrMode) { animationImageView.setVisibility(View.VISIBLE); Animation animation = AnimationUtils.loadAnimation(getContext(), R.anim.v2x_unlike_heart_scale_ani_vr); animationImageView.startAnimation(animation); @@ -84,12 +78,7 @@ public class HeartUnLikeView extends LinearLayout implements Animator.AnimatorLi if (mOnClickCallListener != null) { mOnClickCallListener.onClicked(HeartUnLikeView.this); } - boolean isVrMode = false; - IMogoStatusManager statusManager = BridgeApi.INSTANCE.statusManager(); - if (statusManager != null) { - isVrMode = statusManager.isVrMode(); - } - if (isVrMode) { + if (MogoStatusManager.getInstance().isVrMode()) { mIllegalParkingUnLike.setImageResource(R.drawable.module_common_icon_unlike_selected_vr); } } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/view/SimpleCoverVideoPlayer.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/view/SimpleCoverVideoPlayer.kt index 5833ae1535..280b79c49d 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/view/SimpleCoverVideoPlayer.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/view/SimpleCoverVideoPlayer.kt @@ -7,6 +7,7 @@ import android.view.View import android.widget.ImageView import com.bumptech.glide.Glide import com.bumptech.glide.request.RequestOptions +import com.mogo.commons.module.status.MogoStatusManager import com.mogo.eagle.core.function.v2x.R import com.mogo.eagle.core.widget.glide.SkinAbleBitmapTarget import com.shuyu.gsyvideoplayer.GSYVideoManager @@ -14,8 +15,6 @@ import com.shuyu.gsyvideoplayer.utils.GSYVideoType import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer import com.shuyu.gsyvideoplayer.video.base.GSYVideoView import com.shuyu.gsyvideoplayer.video.base.GSYVideoViewBridge -import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi.statusManager -import com.mogo.service.statusmanager.IMogoStatusManager class SimpleCoverVideoPlayer : StandardGSYVideoPlayer { @@ -45,12 +44,7 @@ class SimpleCoverVideoPlayer : StandardGSYVideoPlayer { } override fun getLayoutId(): Int { - var isVrMode = false - val statusManager: IMogoStatusManager? = statusManager() - if (statusManager != null) { - isVrMode = statusManager.isVrMode - } - if (isVrMode) { + if (MogoStatusManager.getInstance().isVrMode) { return R.layout.v2x_road_video_plyer_layout_vr } return R.layout.v2x_road_video_plyer_layout diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/view/V2XCrossRoadVideoView.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/view/V2XCrossRoadVideoView.java index c59152eb02..7a77aa786c 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/view/V2XCrossRoadVideoView.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/view/V2XCrossRoadVideoView.java @@ -19,6 +19,7 @@ import com.mogo.cloud.trafficlive.api.ITrafficIntersectionLiveCallBack; import com.mogo.cloud.trafficlive.api.MoGoAiCloudTrafficLive; import com.mogo.commons.voice.AIAssist; import com.mogo.eagle.core.data.map.MogoLocation; +import com.mogo.eagle.core.data.map.entity.MarkerCarInfo; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.function.v2x.R; import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi; @@ -30,7 +31,6 @@ import com.mogo.eagle.core.widget.RoundLayout; import com.mogo.eagle.core.widget.media.video.SimpleVideoPlayer; import com.mogo.map.MogoLocationClient; import com.mogo.map.location.IMogoLocationClient; -import com.mogo.module.common.entity.MarkerCarInfo; import com.shuyu.gsyvideoplayer.GSYVideoManager; import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder; import com.shuyu.gsyvideoplayer.cache.CacheFactory; diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/view/V2XLiveGSYVideoView.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/view/V2XLiveGSYVideoView.java index 66e9597a30..a17198c64f 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/view/V2XLiveGSYVideoView.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/view/V2XLiveGSYVideoView.java @@ -16,6 +16,7 @@ import androidx.constraintlayout.widget.ConstraintLayout; import androidx.core.content.ContextCompat; import com.mogo.commons.voice.AIAssist; +import com.mogo.eagle.core.data.map.entity.MarkerCarInfo; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.function.v2x.R; import com.mogo.eagle.core.function.v2x.events.voice.V2XVoiceCallbackListener; @@ -24,7 +25,6 @@ import com.mogo.eagle.core.function.v2x.events.voice.V2XVoiceManager; import com.mogo.eagle.core.network.utils.GsonUtil; import com.mogo.eagle.core.utilcode.util.Utils; import com.mogo.eagle.core.widget.RoundLayout; -import com.mogo.module.common.entity.MarkerCarInfo; import com.tencent.rtmp.ITXLivePlayListener; import com.tencent.rtmp.TXLiveConstants; import com.tencent.rtmp.TXLivePlayConfig; diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/voice/V2XVoiceManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/voice/V2XVoiceManager.kt index d065055f7c..577567cd72 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/voice/V2XVoiceManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/voice/V2XVoiceManager.kt @@ -3,10 +3,10 @@ package com.mogo.eagle.core.function.v2x.events.voice import android.content.Context import android.content.Intent import android.text.TextUtils +import com.mogo.commons.module.intent.IMogoIntentListener +import com.mogo.commons.module.intent.IntentManager import com.mogo.commons.voice.AIAssist import com.mogo.commons.voice.IMogoVoiceCmdCallBack -import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi -import com.mogo.service.intent.IMogoIntentListener import java.lang.ref.WeakReference import java.util.concurrent.ConcurrentHashMap @@ -51,7 +51,7 @@ object V2XVoiceManager : IMogoVoiceCmdCallBack, IMogoIntentListener { try { unRegisterWakeCmd(cmd) voiceCallbackMap[cmd] = callbackListener - BridgeApi.intentManager()?.registerIntentListener(cmd, this) + IntentManager.getInstance().registerIntentListener(cmd, this) } catch (e: Exception) { e.printStackTrace() } @@ -63,7 +63,7 @@ object V2XVoiceManager : IMogoVoiceCmdCallBack, IMogoIntentListener { fun unRegisterWakeCmd(cmd: String): V2XVoiceManager { try { voiceCallbackMap.remove(cmd) - BridgeApi.intentManager()?.unregisterIntentListener(cmd, this) + IntentManager.getInstance().unregisterIntentListener(cmd, this) } catch (e: Exception) { e.printStackTrace() } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/redlightwarning/RedLightWarningManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/redlightwarning/RedLightWarningManager.kt index fa0c9d62ae..dd7f938765 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/redlightwarning/RedLightWarningManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/redlightwarning/RedLightWarningManager.kt @@ -1,25 +1,25 @@ package com.mogo.eagle.core.function.v2x.redlightwarning -import android.location.Location import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_IVP import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_IVP_GREEN import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2I -import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X import com.mogo.eagle.core.data.map.MogoLatLng +import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.data.trafficlight.* import com.mogo.eagle.core.data.trafficlight.TrafficLightStatusHelper.getCurrentRoadTrafficLight +import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener import com.mogo.eagle.core.function.api.vip.IMoGoVipSetListener import com.mogo.eagle.core.function.call.hmi.CallerHmiManager -import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager import com.mogo.eagle.core.function.call.vip.CallVipSetListenerManager import com.mogo.eagle.core.function.v2x.trafficlight.core.MogoTrafficLightManager +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X import com.mogo.eagle.core.utilcode.util.ThreadUtils -import com.mogo.map.navi.IMogoCarLocationChangedListener2 -import com.mogo.module.common.MogoApisHandler -import com.mogo.module.common.enums.EventTypeEnum +import com.mogo.eagle.core.data.enums.EventTypeEnum import com.zhjt.service_biz.BizConfig import kotlin.math.abs import kotlin.math.ceil @@ -28,7 +28,7 @@ import kotlin.math.min class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener, - IMogoCarLocationChangedListener2 { + IMoGoMapLocationListener { private var vip: Boolean = false @@ -38,7 +38,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener, // 是否已进入到路口(停止线处) private var isEnter = false - private var mLocation: Location? = null + private var mLocation: MogoLocation? = null companion object { @@ -53,7 +53,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener, // 到路口100m时回调 CallerLogger.d("$M_V2X$TAG", "处理路口交通数据:是否是第一次处理:${isFirst}是否进入路口:${isEnter}") if (trafficLightResult.currentRoadIsRight()) { - CallerLogger.d("$M_V2X$TAG","当前道路右转,不处理") + CallerLogger.d("$M_V2X$TAG", "当前道路右转,不处理") return } if (isFirst && !isEnter) { @@ -79,7 +79,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener, fun listenTrafficLight() { CallerTrafficLightListenerManager.registerEnterCrossRoadListener(TAG, this) CallerTrafficLightListenerManager.registerTrafficLightListener(TAG, this) - MogoApisHandler.getInstance().apis.registerCenterApi.registerCarLocationChangedListener(TAG, this) + CallerMapLocationListenerManager.addListener(TAG, this, false) CallVipSetListenerManager.registerVipSetListener(TAG, this) } @@ -177,7 +177,17 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener, for (i in 0..size step 2) { if (i < size) { // 自车到0-1、2-3、4-5、6-7组成的线段的最小距离 - minValue = min(minValue, LocationUtils.pointToLine(points[i].lon, points[i].lat, points[i+1].lon, points[i+1].lat, lon, lat)) + minValue = min( + minValue, + LocationUtils.pointToLine( + points[i].lon, + points[i].lat, + points[i + 1].lon, + points[i + 1].lat, + lon, + lat + ) + ) } } return if (minValue > 9999) 0f else minValue.toFloat() @@ -186,18 +196,26 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener, /** * 闯红灯预警 */ - @BizConfig(V2I,"",BIZ_IVP) + @BizConfig(V2I, "", BIZ_IVP) private fun redLightWarning() { CallerLogger.d("$M_V2X$TAG", "=====闯红灯预警=====") ThreadUtils.runOnUiThread { - CallerHmiManager.showWarningV2X(EventTypeEnum.TYPE_USECASE_ID_IVP.poiType, EventTypeEnum.TYPE_USECASE_ID_IVP.content, EventTypeEnum.TYPE_USECASE_ID_IVP.tts, EventTypeEnum.TYPE_USECASE_ID_IVP.poiType, null, true, 5000L) + CallerHmiManager.showWarningV2X( + EventTypeEnum.TYPE_USECASE_ID_IVP.poiType, + EventTypeEnum.TYPE_USECASE_ID_IVP.content, + EventTypeEnum.TYPE_USECASE_ID_IVP.tts, + EventTypeEnum.TYPE_USECASE_ID_IVP.poiType, + null, + true, + 5000L + ) } } /** * 绿灯通行提示 */ - @BizConfig(V2I,"",BIZ_IVP_GREEN) + @BizConfig(V2I, "", BIZ_IVP_GREEN) private fun greenLightWarning(speed: String = "50") { CallerLogger.d("$M_V2X$TAG", "=====绿灯通行预警=====") ThreadUtils.runOnUiThread { @@ -209,7 +227,15 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener, EventTypeEnum.getWarningTts(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType), speed ) - CallerHmiManager.showWarningV2X(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType, content, tts, EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType, null, true, 5000L) + CallerHmiManager.showWarningV2X( + EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType, + content, + tts, + EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType, + null, + true, + 5000L + ) } } @@ -221,13 +247,11 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener, CallerTrafficLightListenerManager.unRegisterTrafficLightListener(TAG) CallVipSetListenerManager.unRegisterVipSetListener(TAG) CallerTrafficLightListenerManager.unRegisterEnterCrossRoadListener(TAG) - MogoApisHandler.getInstance().apis.registerCenterApi.unregisterCarLocationChangedListener( - TAG, this - ) + CallerMapLocationListenerManager.removeListener(TAG,false) } - override fun onCarLocationChanged2(latLng: Location?) { - latLng?.let { + override fun onLocationChanged(location: MogoLocation?, from: Int, isGps: Boolean) { + location?.let { mLocation = it } } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/network/TrafficLightNetWorkModel.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/network/TrafficLightNetWorkModel.kt index f9a30eeb9a..880ecafd32 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/network/TrafficLightNetWorkModel.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/network/TrafficLightNetWorkModel.kt @@ -8,7 +8,7 @@ import com.mogo.eagle.core.network.MoGoRetrofitFactory import com.mogo.eagle.core.network.apiCall import com.mogo.eagle.core.network.cancel import com.mogo.eagle.core.network.request -import com.mogo.module.common.constants.HostConst.CITY_HOST +import com.mogo.eagle.core.data.constants.HostConst.CITY_HOST class TrafficLightNetWorkModel { diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/vip/VipCarManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/vip/VipCarManager.kt index affbba02b8..031de57a8d 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/vip/VipCarManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/vip/VipCarManager.kt @@ -25,7 +25,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X import com.mogo.eagle.core.utilcode.util.ToastUtils import com.mogo.eagle.core.utilcode.util.UiThreadHandler -import com.mogo.module.common.enums.EventTypeEnum +import com.mogo.eagle.core.data.enums.EventTypeEnum import com.zhjt.service_biz.BizConfig class VipCarManager : IMogoOnMessageListener, IMoGoTrafficLightListener, diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/vip/network/VipNetWorkModel.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/vip/network/VipNetWorkModel.kt index 5d44e53012..350a24dc78 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/vip/network/VipNetWorkModel.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/vip/network/VipNetWorkModel.kt @@ -6,7 +6,7 @@ import com.mogo.eagle.core.data.v2x.VipRequest import com.mogo.eagle.core.network.MoGoRetrofitFactory import com.mogo.eagle.core.network.apiCall import com.mogo.eagle.core.network.request -import com.mogo.module.common.constants.HostConst.DATA_SERVICE_HOST +import com.mogo.eagle.core.data.constants.HostConst.DATA_SERVICE_HOST class VipNetWorkModel { diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-ldpi/icon_talk.png b/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-ldpi/icon_talk.png deleted file mode 100644 index 3f90fd4af5..0000000000 Binary files a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-ldpi/icon_talk.png and /dev/null differ diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi-1920x1000/icon_talk.png b/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi-1920x1000/icon_talk.png deleted file mode 100644 index 89680bd182..0000000000 Binary files a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi-1920x1000/icon_talk.png and /dev/null differ diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/icon_talk.png b/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/icon_talk.png deleted file mode 100644 index 89680bd182..0000000000 Binary files a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/icon_talk.png and /dev/null differ diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable/v2x_map_marker_blue_info.xml b/core/function-impl/mogo-core-function-v2x/src/main/res/drawable/v2x_map_marker_blue_info.xml deleted file mode 100644 index e71c897020..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable/v2x_map_marker_blue_info.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable/v2x_map_marker_driver_type_blue_info.xml b/core/function-impl/mogo-core-function-v2x/src/main/res/drawable/v2x_map_marker_driver_type_blue_info.xml deleted file mode 100644 index eefd1be813..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable/v2x_map_marker_driver_type_blue_info.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable/v2x_shape_reverse_triangle_blue.xml b/core/function-impl/mogo-core-function-v2x/src/main/res/drawable/v2x_shape_reverse_triangle_blue.xml deleted file mode 100644 index 9320416f62..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable/v2x_shape_reverse_triangle_blue.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/layout/item_v2x_event_detail.xml b/core/function-impl/mogo-core-function-v2x/src/main/res/layout/item_v2x_event_detail.xml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/layout/item_v2x_event_detail_vr.xml b/core/function-impl/mogo-core-function-v2x/src/main/res/layout/item_v2x_event_detail_vr.xml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/layout/item_v2x_event_share_load_more.xml b/core/function-impl/mogo-core-function-v2x/src/main/res/layout/item_v2x_event_share_load_more.xml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/layout/item_v2x_fault_help.xml b/core/function-impl/mogo-core-function-v2x/src/main/res/layout/item_v2x_fault_help.xml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/layout/item_v2x_fault_help_vr.xml b/core/function-impl/mogo-core-function-v2x/src/main/res/layout/item_v2x_fault_help_vr.xml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/layout/item_v2x_illegal_parking.xml b/core/function-impl/mogo-core-function-v2x/src/main/res/layout/item_v2x_illegal_parking.xml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/layout/item_v2x_illegal_parking_vr.xml b/core/function-impl/mogo-core-function-v2x/src/main/res/layout/item_v2x_illegal_parking_vr.xml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/layout/item_v2x_live_video.xml b/core/function-impl/mogo-core-function-v2x/src/main/res/layout/item_v2x_live_video.xml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/layout/item_v2x_live_video_vr.xml b/core/function-impl/mogo-core-function-v2x/src/main/res/layout/item_v2x_live_video_vr.xml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/layout/item_v2x_push_event_detail.xml b/core/function-impl/mogo-core-function-v2x/src/main/res/layout/item_v2x_push_event_detail.xml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/layout/item_v2x_scennario_history.xml b/core/function-impl/mogo-core-function-v2x/src/main/res/layout/item_v2x_scennario_history.xml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/layout/item_v2x_scennario_history_other_help.xml b/core/function-impl/mogo-core-function-v2x/src/main/res/layout/item_v2x_scennario_history_other_help.xml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/layout/view_history_empty.xml b/core/function-impl/mogo-core-function-v2x/src/main/res/layout/view_history_empty.xml index f6eec98091..7099a2edac 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/res/layout/view_history_empty.xml +++ b/core/function-impl/mogo-core-function-v2x/src/main/res/layout/view_history_empty.xml @@ -23,7 +23,7 @@ android:gravity="center" android:text="周边5公里,暂无交通事件\n 你可以试着分享一个交通事件给其他车主" - android:textColor="@color/v2x_FFF_666" + android:textColor="@android:color/white" android:textSize="@dimen/dp_36" app:layout_constraintBottom_toTopOf="@+id/btnShear" app:layout_constraintEnd_toEndOf="parent" @@ -32,8 +32,8 @@ - - - - - - - \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/layout/view_marker_car_info.xml b/core/function-impl/mogo-core-function-v2x/src/main/res/layout/view_marker_car_info.xml index 6a0b702d11..e69de29bb2 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/res/layout/view_marker_car_info.xml +++ b/core/function-impl/mogo-core-function-v2x/src/main/res/layout/view_marker_car_info.xml @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/layout/view_v2x_optimal_speed_marker.xml b/core/function-impl/mogo-core-function-v2x/src/main/res/layout/view_v2x_optimal_speed_marker.xml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/layout/window_road_video_layout.xml b/core/function-impl/mogo-core-function-v2x/src/main/res/layout/window_road_video_layout.xml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/layout/window_road_video_layout_vr.xml b/core/function-impl/mogo-core-function-v2x/src/main/res/layout/window_road_video_layout_vr.xml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/layout/window_simple_obu_event_detail_vr.xml b/core/function-impl/mogo-core-function-v2x/src/main/res/layout/window_simple_obu_event_detail_vr.xml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/core/mogo-core-data/build.gradle b/core/mogo-core-data/build.gradle index 8405737a50..4bda16c773 100644 --- a/core/mogo-core-data/build.gradle +++ b/core/mogo-core-data/build.gradle @@ -66,6 +66,7 @@ dependencies { } else { implementation project(':core:mogo-core-res') api project(":libraries:mogo-adas-data") + api project(':core:mogo-core-utils') } } diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/utils/CloudPoiManager.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/CloudPoiManager.java similarity index 96% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/utils/CloudPoiManager.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/CloudPoiManager.java index c065a00369..540ffc7574 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/utils/CloudPoiManager.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/CloudPoiManager.java @@ -1,15 +1,15 @@ -package com.mogo.module.common.utils; +package com.mogo.eagle.core.data.config; import android.content.Context; import android.util.ArrayMap; -import com.mogo.eagle.core.network.utils.GsonUtil; +import com.elegant.network.utils.GsonUtil; +import com.mogo.eagle.core.data.R; +import com.mogo.eagle.core.data.enums.EventTypeEnum; +import com.mogo.eagle.core.data.map.PoiWrapper; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr; -import com.mogo.module.common.R; -import com.mogo.module.common.enums.EventTypeEnum; -import com.mogo.module.common.marker.PoiWrapper; import java.util.List; import java.util.Map; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/DataTypes.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/DataTypes.java similarity index 96% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/DataTypes.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/DataTypes.java index 5bb7d02c3d..e1e11c3fbb 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/DataTypes.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/DataTypes.java @@ -1,4 +1,4 @@ -package com.mogo.module.common.constants; +package com.mogo.eagle.core.data.constants; public /** diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/HostConst.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/HostConst.java similarity index 96% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/HostConst.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/HostConst.java index db14171a5e..b5ca4488e6 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/HostConst.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/HostConst.java @@ -1,4 +1,4 @@ -package com.mogo.module.common.constants; +package com.mogo.eagle.core.data.constants; /** * 通用接口请求host diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java index c16465cc33..fb05de9da6 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java @@ -23,57 +23,20 @@ public class MogoServicePaths { @Deprecated public static final String PATH_SERVICES_MAP = "/mapservices/api"; - /** - * 图片接口ARouter实例化路径 - */ - @Keep - @Deprecated - public static final String PATH_UTILS_IMAGE_LOADER = "/imageloader/api"; - - /** - * 埋点接口ARouter实例化路径 - */ - @Keep - @Deprecated - public static final String PATH_UTILS_ANALYTICS = "/utils/analytics"; - - /** - * 状态管理接口 - */ - @Keep - @Deprecated - public static final String PATH_STATUS_MANAGER = "/statusmanager/api"; - /** * 消息中心 */ @Keep @Deprecated - public static final String PATH_WINDOW_MANAGER = "/windowmanger/api"; - - /** - * 管理 fragment - */ - @Keep - @Deprecated - public static final String PATH_FRAGMENT_MANAGER = "/fragmentmanager/api"; + public static final String PATH_FLOAT_VIEW_MANAGER = "/floatview/api"; /** * 免唤醒语音控制 - * - * @deprecated use {@link #PATH_INTENT_MANAGER} instead. */ @Keep @Deprecated public static final String PATH_VOICE_MANAGER = "/voicemanager/api"; - /** - * 意图控制接口 - */ - @Keep - @Deprecated - public static final String PATH_INTENT_MANAGER = "/intentmanager/api"; - /** * 基础功能监听回调注册 */ @@ -88,27 +51,6 @@ public class MogoServicePaths { @Deprecated public static final String PATH_SERVICE_APIS = "/mogoservice/apis"; - /** - * 顶部1/2屏管理 - */ - @Keep - @Deprecated - public static final String PATH_EXTENSIONS_TOP_VIEW_MANAGER = "/topview/api"; - - /** - * 浓雾等极端事件特殊效果 - */ - @Keep - @Deprecated - public static final String PATH_MAIN_DISPLAY_EFFECTS_MANAGER = "/displayeffects/api"; - - /** - * 其他模块调用公共的marker打点 - */ - @Keep - @Deprecated - public static final String PATH_MARKER_SERVICE = "/mogomarker/api"; - /** * 自研地图和高德地图切换 */ @@ -170,7 +112,7 @@ public class MogoServicePaths { public static final String PATH_BINDING_CAR = "/bindingcar/api"; /** - * 云公告 模块 + * 路侧直播流 模块 */ @Keep @Deprecated diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/RoomConstants.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/RoomConstants.java similarity index 81% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/RoomConstants.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/RoomConstants.java index 406e9d4840..3be960e813 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/RoomConstants.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/RoomConstants.java @@ -1,4 +1,4 @@ -package com.mogo.module.common.constants; +package com.mogo.eagle.core.data.constants; /** * 数据库常量 diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/enums/EventTypeEnum.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnum.kt similarity index 96% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/enums/EventTypeEnum.kt rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnum.kt index 40edb00409..fb67f3b68d 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/enums/EventTypeEnum.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnum.kt @@ -1,8 +1,8 @@ -package com.mogo.module.common.enums +package com.mogo.eagle.core.data.enums + +import com.mogo.eagle.core.data.R +import com.mogo.eagle.core.data.config.CloudPoiManager -import com.mogo.module.common.R -import com.mogo.module.common.utils.CloudPoiManager -import com.zhidao.support.obu.constants.ObuConstants /** * OBU、V2N事件类型枚举类 @@ -139,63 +139,63 @@ enum class EventTypeEnum( ALERT_ILLEGAL_PARK("99992"), TYPE_USECASE_ID_EBW( - ObuConstants.USE_CASE_ID.EBW.toString(), + 0x2A01.toString(), "紧急制动预警", poiTypeSrcVr = R.drawable.icon_warning_v2x_emergency_brake, content = "前车急刹车", tts = "前车急刹车" ), TYPE_USECASE_ID_FCW( - ObuConstants.USE_CASE_ID.FCW.toString(), + 0x2A02.toString(), "前向碰撞预警", poiTypeSrcVr = R.drawable.icon_warning_v2x_collision_warning, content = "前车碰撞预警", tts = "小心前车" ), TYPE_USECASE_ID_ICW( - ObuConstants.USE_CASE_ID.ICW.toString(), + 0x2A03.toString(), "交叉路口碰撞预警", poiTypeSrcVr = R.drawable.icon_warning_v2x_collision_warning, content = "交叉路口碰撞预警", tts = "注意交叉路口车辆" ), TYPE_USECASE_ID_CLW( - ObuConstants.USE_CASE_ID.CLW.toString(), + 0x2A04.toString(), "车辆失控预警", poiTypeSrcVr = R.drawable.icon_warning_v2x_vehicle_control, content = "前%s失控预警", tts = "小心%s失控车辆" ), TYPE_USECASE_ID_DNPW( - ObuConstants.USE_CASE_ID.DNPW.toString(), + 0x2A05.toString(), "逆向超车预警", poiTypeSrcVr = R.drawable.icon_warning_v2x_reverse_overtaking, content = "逆向超车预警", tts = "注意对向来车" ), TYPE_USECASE_ID_AVW( - ObuConstants.USE_CASE_ID.AVW.toString(), + 0x2A06.toString(), "异常车辆提醒", poiTypeSrcVr = R.drawable.icon_warning_v2x_abnormal_vehicle, content = "%s车异常", tts = "小心%s异常车辆" ), TYPE_USECASE_ID_BSW( - ObuConstants.USE_CASE_ID.BSW.toString(), + 0x2A07.toString(), "盲区预警", poiTypeSrcVr = R.drawable.icon_warning_v2x_blind_area_collision, content = "%s后盲区预警", tts = "注意%s后车辆" ), TYPE_USECASE_ID_LCW( - ObuConstants.USE_CASE_ID.LCW.toString(), + 0x2A08.toString(), "变道预警", poiTypeSrcVr = R.drawable.icon_warning_v2x_reverse_overtaking, content = "%s向变道预警", tts = "注意%s后车辆" ),//注意左后车辆/注意右后车辆 TYPE_USECASE_ID_EVW( - ObuConstants.USE_CASE_ID.EVW.toString(), + 0x2A09.toString(), "紧急车辆提醒", poiTypeSrcVr = R.drawable.icon_warning_v2x_special_vehicle_access, content = "注意特种车辆通行", @@ -216,49 +216,49 @@ enum class EventTypeEnum( tts = "注意摩托车" ),//摩托车碰撞预警 TYPE_USECASE_ID_SLW( - ObuConstants.USE_CASE_ID.SLW.toString(), + 0x2B04.toString(), "限速预警", poiTypeSrcVr = R.drawable.icon_warning_v2x_over_speed, content = "已超速", tts = "已超速" ), TYPE_USECASE_ID_LTA( - ObuConstants.USE_CASE_ID.LTA.toString(), + 0x2B05.toString(), "左转辅助", poiTypeSrcVr = R.drawable.icon_warning_v2x_collision_warning, content = "左转碰撞预警", tts = "注意路口对向来车" ), TYPE_USECASE_ID_HLW( - ObuConstants.USE_CASE_ID.HLW.toString(), + 0x2B06.toString(), "道路危险情况预警", poiTypeSrcVr = R.drawable.icon_warning_v2x_road_dangerous, content = "道路危险情况预警", tts = "前方路况危险,小心行驶" ),//(如果能给出具体的类别,则播报具体危险类别) TYPE_USECASE_OPTIMAL_LANE( - ObuConstants.USE_CASE_ID.HLW.toString(), + 0x2B06.toString(), "最优车道", poiTypeSrcVr = R.drawable.v2x_icon_live_logo, content = "最优车道", tts = "最优车道" ), TYPE_USECASE_ID_IVS( - ObuConstants.USE_CASE_ID.IVS.toString(), + 0x2B07.toString(), "车内标牌", poiTypeSrcVr = R.drawable.icon_warning_v2x_road_construction, content = "车内标牌", tts = "" ), TYPE_USECASE_ID_TJW( - ObuConstants.USE_CASE_ID.TJW.toString(), + 0x2B08.toString(), "前方拥堵提醒", poiTypeSrcVr = R.drawable.icon_warning_v2x_congestion, content = "前方%d米道路拥堵", tts = "前方拥堵,减速慢行" ), TYPE_USECASE_ID_IVP( - ObuConstants.USE_CASE_ID.IVP.toString(), + 0x2B09.toString(), "闯红灯预警", poiTypeSrcVr = R.drawable.icon_warning_v2x_traffic_lights_red, content = "路口红灯,禁止通行", @@ -272,7 +272,7 @@ enum class EventTypeEnum( tts = "建议车速 %s KM/H" ), TYPE_USECASE_ID_COC( - ObuConstants.USE_CASE_ID.COC.toString(), + 0x2B0A.toString(), "预留", poiTypeSrcVr = R.drawable.icon_warning_v2x_abnormal_vehicle, content = "路况预警", @@ -356,7 +356,7 @@ enum class EventTypeEnum( tts = "路况复杂,减速慢行" ), TYPE_ERROR( - ObuConstants.USE_CASE_ID.ERROR.toString(), + "-1", "未知/错误/异常", poiTypeSrcVr = R.drawable.icon_warning_v2x_abnormal_vehicle, content = "", @@ -447,7 +447,7 @@ enum class EventTypeEnum( fun getPoiTypeBg(poiType: String, isVrMode: Boolean): Int { return when (poiType) { FOURS_BLOCK_UP.poiType, FOURS_LIVING.poiType-> if (isVrMode) R.drawable.bg_v2x_event_type_orange_vr else R.drawable.bg_v2x_event_type_orange - TRAFFIC_CHECK.poiType, ROAD_CLOSED.poiType, FOURS_ROAD_WORK.poiType,AI_ROAD_WORK.poiType, + TRAFFIC_CHECK.poiType, ROAD_CLOSED.poiType, FOURS_ROAD_WORK.poiType, AI_ROAD_WORK.poiType, FOURS_PONDING.poiType, FOURS_FOG.poiType, FOURS_ICE.poiType, FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType, FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> if (isVrMode) R.drawable.bg_v2x_event_type_red_vr else R.drawable.bg_v2x_event_type_read @@ -463,7 +463,7 @@ enum class EventTypeEnum( FOURS_BLOCK_UP.poiType, FOURS_LIVING.poiType -> R.drawable.bg_v2x_event_type_orange TRAFFIC_CHECK.poiType, ROAD_CLOSED.poiType, - FOURS_ROAD_WORK.poiType,AI_ROAD_WORK.poiType, FOURS_PONDING.poiType, + FOURS_ROAD_WORK.poiType, AI_ROAD_WORK.poiType, FOURS_PONDING.poiType, FOURS_FOG.poiType, FOURS_ICE.poiType, FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType, FOURS_ACCIDENT_03.poiType, @@ -480,7 +480,7 @@ enum class EventTypeEnum( fun isRoadEvent(poiType: String?): Boolean { return when (poiType) { TRAFFIC_CHECK.poiType, ROAD_CLOSED.poiType, - FOURS_ROAD_WORK.poiType,AI_ROAD_WORK.poiType, FOURS_BLOCK_UP.poiType, + FOURS_ROAD_WORK.poiType, AI_ROAD_WORK.poiType, FOURS_BLOCK_UP.poiType, FOURS_PONDING.poiType, FOURS_FOG.poiType, FOURS_ICE.poiType, FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType, @@ -496,7 +496,7 @@ enum class EventTypeEnum( @JvmStatic fun isNeedRoadEventUgc(poiType: String?): Boolean { return when (poiType) { - ROAD_CLOSED.poiType, FOURS_ROAD_WORK.poiType,AI_ROAD_WORK.poiType, + ROAD_CLOSED.poiType, FOURS_ROAD_WORK.poiType, AI_ROAD_WORK.poiType, FOURS_BLOCK_UP.poiType, FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType, FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/enums/EventTypeHelper.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeHelper.kt similarity index 97% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/enums/EventTypeHelper.kt rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeHelper.kt index 59d0db1c9f..8f8cd1ff35 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/enums/EventTypeHelper.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeHelper.kt @@ -1,4 +1,4 @@ -package com.mogo.module.common.enums +package com.mogo.eagle.core.data.enums import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_AVW import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_BSW @@ -13,9 +13,6 @@ import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_VRU import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_VRU_RI import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2N import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2V -import com.mogo.eagle.core.data.enums.WarningDirectionEnum -import com.mogo.eagle.core.data.enums.isLeft -import com.mogo.eagle.core.data.enums.isRight import com.zhjt.service_biz.BizConfig class EventTypeHelper { diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/marker/PoiWrapper.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/PoiWrapper.java similarity index 94% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/marker/PoiWrapper.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/PoiWrapper.java index 46b3a51238..9092ea0d05 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/marker/PoiWrapper.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/PoiWrapper.java @@ -1,4 +1,4 @@ -package com.mogo.module.common.marker; +package com.mogo.eagle.core.data.map; /** * poi信息封装 @@ -20,7 +20,7 @@ public class PoiWrapper { } - public PoiWrapper(String poiType, int iconRes,int iconInfoRes, String title) { + public PoiWrapper(String poiType, int iconRes, int iconInfoRes, String title) { this.poiType = poiType; this.iconRes = iconRes; this.iconInfoRes = iconInfoRes; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerActivitiesScope.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerActivitiesScope.java similarity index 94% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerActivitiesScope.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerActivitiesScope.java index 90df97f521..16fcbb989c 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerActivitiesScope.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerActivitiesScope.java @@ -1,5 +1,5 @@ -package com.mogo.module.common.entity; +package com.mogo.eagle.core.data.map.entity; import android.text.TextUtils; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerCarChat.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerCarChat.java similarity index 95% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerCarChat.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerCarChat.java index 8a87118e91..b04b506da0 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerCarChat.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerCarChat.java @@ -1,5 +1,5 @@ -package com.mogo.module.common.entity; +package com.mogo.eagle.core.data.map.entity; import java.io.Serializable; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerCarInfo.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerCarInfo.java similarity index 98% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerCarInfo.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerCarInfo.java index 3ff892d263..5cfe488908 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerCarInfo.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerCarInfo.java @@ -1,5 +1,5 @@ -package com.mogo.module.common.entity; +package com.mogo.eagle.core.data.map.entity; import android.text.TextUtils; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerCarPois.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerCarPois.java similarity index 94% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerCarPois.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerCarPois.java index 30c997b77d..fa1bb0ad2e 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerCarPois.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerCarPois.java @@ -1,4 +1,4 @@ -package com.mogo.module.common.entity; +package com.mogo.eagle.core.data.map.entity; import java.util.List; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerCardResult.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerCardResult.java similarity index 97% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerCardResult.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerCardResult.java index 86a14edad5..3f6fb3c8dd 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerCardResult.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerCardResult.java @@ -1,5 +1,5 @@ -package com.mogo.module.common.entity; +package com.mogo.eagle.core.data.map.entity; import com.mogo.eagle.core.data.BaseData; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerDynamicData.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerDynamicData.java similarity index 98% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerDynamicData.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerDynamicData.java index 656f115afb..60ac614813 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerDynamicData.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerDynamicData.java @@ -1,5 +1,5 @@ -package com.mogo.module.common.entity; +package com.mogo.eagle.core.data.map.entity; import android.text.TextUtils; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerExploreWay.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerExploreWay.java similarity index 95% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerExploreWay.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerExploreWay.java index 7314267422..8516d97fcf 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerExploreWay.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerExploreWay.java @@ -1,9 +1,8 @@ -package com.mogo.module.common.entity; +package com.mogo.eagle.core.data.map.entity; import android.text.TextUtils; -import com.mogo.module.common.enums.EventTypeEnum; import java.io.Serializable; import java.util.List; @@ -15,9 +14,6 @@ public class MarkerExploreWay implements Serializable { private String infoId; private String type;//卡片类型, - /** - * @see EventTypeEnum - */ private String poiType; private String sn; private MarkerLocation location;//位置信息 @@ -159,9 +155,6 @@ public class MarkerExploreWay implements Serializable { } public String getPoiType() { - if (TextUtils.isEmpty(poiType)) { - return EventTypeEnum.FOURS_BLOCK_UP.getPoiType(); - } return poiType; } diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerExploreWayItem.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerExploreWayItem.java similarity index 96% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerExploreWayItem.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerExploreWayItem.java index 47f9d1857f..ada9e398a6 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerExploreWayItem.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerExploreWayItem.java @@ -1,5 +1,5 @@ -package com.mogo.module.common.entity; +package com.mogo.eagle.core.data.map.entity; import android.text.TextUtils; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerHobbyDatum.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerHobbyDatum.java similarity index 97% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerHobbyDatum.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerHobbyDatum.java index a190f2f759..9f0a995afd 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerHobbyDatum.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerHobbyDatum.java @@ -1,4 +1,4 @@ -package com.mogo.module.common.entity; +package com.mogo.eagle.core.data.map.entity; import java.io.Serializable; import java.util.List; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerLocation.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerLocation.java similarity index 96% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerLocation.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerLocation.java index 16158a78c3..385e92d337 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerLocation.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerLocation.java @@ -1,5 +1,5 @@ -package com.mogo.module.common.entity; +package com.mogo.eagle.core.data.map.entity; import android.text.TextUtils; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerNoveltyInfo.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerNoveltyInfo.java similarity index 97% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerNoveltyInfo.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerNoveltyInfo.java index fe9375e3c8..4339f7003b 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerNoveltyInfo.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerNoveltyInfo.java @@ -1,5 +1,6 @@ -package com.mogo.module.common.entity; +package com.mogo.eagle.core.data.map.entity; + /** * 新鲜事儿Marker数据 @@ -8,9 +9,6 @@ public class MarkerNoveltyInfo { private String type; private String sn; private MarkerLocation location; - /** - * @see com.mogo.module.common.enums.EventTypeEnum - */ private String poiType; private ContentData contentData; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerOnlineCar.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerOnlineCar.java similarity index 98% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerOnlineCar.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerOnlineCar.java index 5b5ce5a8d7..a66f73a6ad 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerOnlineCar.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerOnlineCar.java @@ -1,4 +1,4 @@ -package com.mogo.module.common.entity; +package com.mogo.eagle.core.data.map.entity; import java.io.Serializable; import java.util.List; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerOnlineTag.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerOnlineTag.java similarity index 94% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerOnlineTag.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerOnlineTag.java index 00f2e6377c..31645b1d88 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerOnlineTag.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerOnlineTag.java @@ -1,5 +1,5 @@ -package com.mogo.module.common.entity; +package com.mogo.eagle.core.data.map.entity; import android.text.TextUtils; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerResponse.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerResponse.java similarity index 95% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerResponse.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerResponse.java index c0217288e6..5d8161a0b7 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerResponse.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerResponse.java @@ -1,5 +1,5 @@ -package com.mogo.module.common.entity; +package com.mogo.eagle.core.data.map.entity; import com.mogo.eagle.core.data.BaseData; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerShareMusic.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerShareMusic.java similarity index 98% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerShareMusic.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerShareMusic.java index 96eedf67e8..6a77bf6297 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerShareMusic.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerShareMusic.java @@ -1,5 +1,5 @@ -package com.mogo.module.common.entity; +package com.mogo.eagle.core.data.map.entity; import android.text.TextUtils; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerShowEntity.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerShowEntity.java similarity index 91% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerShowEntity.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerShowEntity.java index 69b2df5411..bf8ef0c3c1 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerShowEntity.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerShowEntity.java @@ -1,10 +1,8 @@ -package com.mogo.module.common.entity; +package com.mogo.eagle.core.data.map.entity; import android.text.TextUtils; -import com.mogo.map.marker.IMogoMarker; -import java.lang.ref.WeakReference; import java.util.Objects; /** @@ -30,7 +28,6 @@ public class MarkerShowEntity { private Object bindObj; //Marker 经纬度位置信息 private MarkerLocation markerLocation; - private IMogoMarker mMarker; public boolean isChecked() { return isChecked; @@ -103,14 +100,6 @@ public class MarkerShowEntity { Objects.equals(markerLocation, that.markerLocation); } - public void setMarker( IMogoMarker marker ) { - this.mMarker = marker; - } - - public IMogoMarker getMarker() { - return mMarker; - } - @Override public int hashCode() { return Objects.hash(iconUrl, textContent, markerType, bindObj, markerLocation); diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerUserInfo.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerUserInfo.java similarity index 99% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerUserInfo.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerUserInfo.java index 70c0f7f2c5..d38a08955b 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerUserInfo.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerUserInfo.java @@ -1,5 +1,5 @@ -package com.mogo.module.common.entity; +package com.mogo.eagle.core.data.map.entity; import android.text.TextUtils; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XEventZanData.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XEventZanData.java similarity index 95% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XEventZanData.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XEventZanData.java index 0301db0b9a..a348611558 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XEventZanData.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XEventZanData.java @@ -1,4 +1,4 @@ -package com.mogo.module.common.entity; +package com.mogo.eagle.core.data.map.entity; import com.mogo.utils.sqlite.annotation.DbDatabase; import com.mogo.utils.sqlite.annotation.DbField; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XHistoryScenarioData.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XHistoryScenarioData.java similarity index 95% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XHistoryScenarioData.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XHistoryScenarioData.java index 23a176a04d..1256fde084 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XHistoryScenarioData.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XHistoryScenarioData.java @@ -1,6 +1,6 @@ -package com.mogo.module.common.entity; +package com.mogo.eagle.core.data.map.entity; -import com.mogo.module.common.constants.RoomConstants; +import com.mogo.eagle.core.data.constants.RoomConstants; import com.mogo.utils.sqlite.annotation.DbDatabase; import com.mogo.utils.sqlite.annotation.DbField; import com.mogo.utils.sqlite.annotation.DbTable; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XLiveCarInfoEntity.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XLiveCarInfoEntity.java similarity index 96% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XLiveCarInfoEntity.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XLiveCarInfoEntity.java index 94af904dc0..485dde6de8 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XLiveCarInfoEntity.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XLiveCarInfoEntity.java @@ -1,4 +1,4 @@ -package com.mogo.module.common.entity; +package com.mogo.eagle.core.data.map.entity; import java.util.Objects; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XMessageEntity.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XMessageEntity.java similarity index 99% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XMessageEntity.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XMessageEntity.java index 98a0129bda..0bc8351697 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XMessageEntity.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XMessageEntity.java @@ -1,4 +1,4 @@ -package com.mogo.module.common.entity; +package com.mogo.eagle.core.data.map.entity; import androidx.annotation.IntDef; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XRoadEventEntity.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XRoadEventEntity.java similarity index 73% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XRoadEventEntity.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XRoadEventEntity.java index 9e0de3ca6c..b6ea46986b 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XRoadEventEntity.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XRoadEventEntity.java @@ -1,8 +1,7 @@ -package com.mogo.module.common.entity; +package com.mogo.eagle.core.data.map.entity; import android.text.TextUtils; -import com.mogo.module.common.enums.EventTypeEnum; import java.io.Serializable; import java.util.Objects; @@ -15,9 +14,7 @@ import java.util.Objects; * version: 1.0 */ public class V2XRoadEventEntity implements Serializable { - /** - * @see EventTypeEnum - */ + // 事件类型 private String poiType; // 事件位置 @@ -57,33 +54,6 @@ public class V2XRoadEventEntity implements Serializable { this.poiType = poiType; } - public String getTts(boolean haveLiveCar) { - if (EventTypeEnum.GHOST_PROBE.getPoiType().equals(poiType)) { - tts = EventTypeEnum.GHOST_PROBE.getTts(); - return tts; - } - tts = "前方#" + (int) getDistance() + "米#"; - tts += EventTypeEnum.getTts(getPoiType()); - if (haveLiveCar) { - tts += ",查看实况请说确定。"; - setShowEventButton(true); - } else { - tts += ",请注意躲避。"; - setShowEventButton(false); - } - return tts; - } - - /** - * 检测到附近#道路施工#,确认该信息是否正确?您可以说“正确”或“错误”帮助其他车友。 - */ - public String getTtsWithFeedback() { - tts = "检测到附近"; - tts += EventTypeEnum.getTtsWithFeedback(getPoiType()); - tts += ",确认该信息是否正确?您可以说“正确”或“错误”帮助其他车友。"; - return tts; - } - public String getTts() { return tts; } @@ -100,8 +70,7 @@ public class V2XRoadEventEntity implements Serializable { isShowEventButton = showEventButton; } - public String getAlarmContent() { - alarmContent = EventTypeEnum.getAlarmContent(getPoiType()); + public String getAlarmContent(){ //todo 缺少 return alarmContent; } diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XWarningEntity.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XWarningEntity.java similarity index 99% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XWarningEntity.java rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XWarningEntity.java index 9773232763..9f9e66a8cc 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XWarningEntity.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XWarningEntity.java @@ -1,4 +1,4 @@ -package com.mogo.module.common.entity; +package com.mogo.eagle.core.data.map.entity; import com.mogo.eagle.core.data.map.MogoLatLng; diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/windowview/IMogoWindowManager.java b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/view/IViewLayoutSet.kt similarity index 65% rename from services/mogo-service-api/src/main/java/com/mogo/service/windowview/IMogoWindowManager.java rename to core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/view/IViewLayoutSet.kt index 591f113706..a4b9b2ab1f 100644 --- a/services/mogo-service-api/src/main/java/com/mogo/service/windowview/IMogoWindowManager.java +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/view/IViewLayoutSet.kt @@ -1,18 +1,13 @@ -package com.mogo.service.windowview; +package com.mogo.eagle.core.function.api.hmi.view -import android.view.View; -import android.widget.FrameLayout; - -import com.alibaba.android.arouter.facade.template.IProvider; +import android.view.View +import android.widget.FrameLayout +import com.alibaba.android.arouter.facade.template.IProvider /** - * @author congtaowang - * @since 2020-01-06 - *

* 根据优先级控制显示 window view. */ -public interface IMogoWindowManager extends IProvider { - +interface IViewLayoutSet : IProvider{ /** * 向window中添加指定的布局,不考虑优先级 @@ -22,7 +17,7 @@ public interface IMogoWindowManager extends IProvider { * @param y 左上角y坐标 * @param movable 是否可移动(无效) */ - void addView( View view, int x, int y, boolean movable ); + fun addView(view: View, x: Int, y: Int, movable: Boolean) /** @@ -32,7 +27,7 @@ public interface IMogoWindowManager extends IProvider { * @param params 布局参数 * @param movable 是否可移动(无效) */ - void addView( View view, FrameLayout.LayoutParams params, boolean movable ); + fun addView(view: View, params: FrameLayout.LayoutParams, movable: Boolean) /** * 向window中添加指定的布局,优先级大的展示 @@ -43,7 +38,7 @@ public interface IMogoWindowManager extends IProvider { * @param y 左上角y坐标 * @param movable 是否可移动(无效) */ - void addView( int priority, View view, int x, int y, boolean movable ); + fun addView(priority: Int, view: View, x: Int, y: Int, movable: Boolean) /** * 向window中添加指定的布局,优先级大的展示 @@ -53,28 +48,28 @@ public interface IMogoWindowManager extends IProvider { * @param params 布局参数 * @param movable 是否可移动(无效) */ - void addView( int priority, View view, FrameLayout.LayoutParams params, boolean movable ); + fun addView(priority: Int, view: View, params: FrameLayout.LayoutParams, movable: Boolean) /** * 移除对应的 view * * @param view */ - void removeView( View view ); + fun removeView(view: View) /** * 隐藏所有 */ - void hideAll(); + fun hideAll() /** * 显示所有 */ - void showAll(); + fun showAll() /** * 为了配合导航动画,主屏上方1/2屏的view通过此方法添加 * @param view 主屏上方1/2屏的view */ - void addTopView(View view); -} + fun addTopView(view: View) +} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoWaringProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoWaringProvider.kt index 2ab37413c9..46e773b7bb 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoWaringProvider.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoWaringProvider.kt @@ -17,6 +17,11 @@ import com.mogo.eagle.core.function.api.hmi.view.IOchBusView */ interface IMoGoWaringProvider : IMoGoHmiViewProxy { + /** + * 浓雾预警 + */ + fun displayEffects() + /** * 隐藏 脉速表 * @param visibility View.VISIBLE, View.INVISIBLE,View.GONE diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/IMogoMapService.java b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/IMogoMapService.java index 90b86a1810..d760fbeec0 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/IMogoMapService.java +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/IMogoMapService.java @@ -3,6 +3,7 @@ package com.mogo.eagle.core.function.api.map; import android.content.Context; import com.alibaba.android.arouter.facade.template.IProvider; +import com.mogo.eagle.core.function.api.map.marker.IMogoMarkerService; import com.mogo.map.listener.IMogoHosListenerRegister; import com.mogo.map.location.IMogoLocationClient; import com.mogo.map.marker.IMogoMarkerManager; @@ -54,6 +55,12 @@ public interface IMogoMapService extends IProvider { */ IMogoMarkerManager getMarkerManager( Context context ); + /** + * 带有业务标注的服务marker + * @return + */ + IMogoMarkerService getMarkerService(); + /** * 地图UI控制 * diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/marker/IMogoMarkerService.java b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/marker/IMogoMarkerService.java index 7bfe77bd25..45666c116e 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/marker/IMogoMarkerService.java +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/marker/IMogoMarkerService.java @@ -2,24 +2,65 @@ package com.mogo.eagle.core.function.api.map.marker; import androidx.annotation.Nullable; -import com.alibaba.android.arouter.facade.template.IProvider; +import com.mogo.eagle.core.data.map.MogoLatLng; +import com.mogo.eagle.core.data.traffic.TrafficData; import com.mogo.map.marker.IMogoMarker; -import com.mogo.map.uicontroller.IMogoMapUIController; -/** - * @author congtaowang - * @since 2020-05-27 - *

- * 描述 - */ -public interface IMogoMarkerService extends IProvider { + +public interface IMogoMarkerService { /** - * @param object instance of com.mogo.module.common.entity.MarkerShowEntity + * @param object * @return */ @Nullable - IMogoMarker drawMarker( Object object ); + IMogoMarker drawMarker(Object object); + + /** + * 识别物体移动 + * @param lon + * @param lat + * @param type + * @param collisionlat + * @param collisionLon + * @param angle + * @param showTime + */ + void renderWarningMoveMarker(double lon, double lat, int type, double collisionlat, double collisionLon, double angle, long showTime); + + /** + * 绘制停止线marker + * @param lon + * @param lat + */ + void renderStopLineMarker(double lon, double lat); + + void drawerArrowsMarkerWithLocation(MogoLatLng location, String markerType, int type, int rotate); + + /** + * 更新OBU/V2X传来的 单个物体感知数据 + * @param trafficData + */ + void updateITrafficInfo(TrafficData trafficData); + + /** + * 更新数据 + */ + void updateITrafficLocationInfo(TrafficData trafficData); + + /** + * 更新识别数据颜色 + */ + void updateITrafficThreatLevelInfo(TrafficData trafficData); + + /** + * 移除OBU/V2X传来的 单个物体感知数据 + * @param uuid + */ + void removeCvxRvInfoIndInfo(String uuid); + + + + - IMogoMapUIController getMapUIController(); } diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiFloatViewManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiFloatViewManager.kt index 28a1224340..abec4372d0 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiFloatViewManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiFloatViewManager.kt @@ -1,14 +1,25 @@ package com.mogo.eagle.core.function.call.hmi +import android.view.View +import android.widget.FrameLayout +import com.alibaba.android.arouter.launcher.ARouter +import com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_FLOAT_VIEW_MANAGER +import com.mogo.eagle.core.function.api.hmi.view.IViewLayoutSet + /** - * @author xiaoyuzhou - * @date 2021/9/23 10:22 上午 - * HMI 悬浮控件管理 + * HMI 控件管理 */ object CallerHmiFloatViewManager { - private val TAG = "CallerHmiFloatViewManager" - + private val floatViewProviderApi + get() = ARouter.getInstance().build(PATH_FLOAT_VIEW_MANAGER) + .navigation() as? IViewLayoutSet + fun addView(view: View, params: FrameLayout.LayoutParams, movable: Boolean) { + floatViewProviderApi?.addView(view, params, movable) + } + fun removeView(view: View) { + floatViewProviderApi?.removeView(view) + } } \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt index 20a408e34c..8392c124bd 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt @@ -32,6 +32,13 @@ object CallerHmiManager : CallerBase() { get() = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_HMI) .navigation() as? IMoGoWaringProvider + /** + * 浓雾预警 + */ + fun displayEffects(){ + waringProviderApi?.displayEffects() + } + /** * 隐藏 脉速表 * @param visibility View.VISIBLE, View.INVISIBLE,View.GONE diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapUIServiceManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapUIServiceManager.kt index bab7121e86..2c2698f641 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapUIServiceManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapUIServiceManager.kt @@ -3,6 +3,7 @@ package com.mogo.eagle.core.function.call.map import android.content.Context import com.mogo.eagle.core.data.constants.MogoServicePaths import com.mogo.eagle.core.function.api.map.IMogoMapService +import com.mogo.eagle.core.function.api.map.marker.IMogoMarkerService import com.mogo.eagle.core.function.call.base.CallerBase import com.mogo.map.listener.IMogoHosListenerRegister import com.mogo.map.location.IMogoLocationClient @@ -11,10 +12,11 @@ import com.mogo.map.search.geo.IMogoGeoSearch import com.mogo.map.uicontroller.IMogoMapUIController object CallerMapUIServiceManager { - private val serviceProvider : IMogoMapService? by lazy { + private val serviceProvider: IMogoMapService? by lazy { CallerBase.getApiInstance( IMogoMapService::class.java, - MogoServicePaths.PATH_SERVICES_MAP) + MogoServicePaths.PATH_SERVICES_MAP + ) } fun getMapUIController(): IMogoMapUIController? { @@ -36,4 +38,8 @@ object CallerMapUIServiceManager { fun getMarkerManager(context: Context): IMogoMarkerManager? { return serviceProvider?.getMarkerManager(context) } + + fun getMarkerService(): IMogoMarkerService? { + return serviceProvider?.markerService + } } \ No newline at end of file diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/icon_default_user_head.png b/core/mogo-core-res/src/main/res/drawable-mdpi/icon_default_user_head.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-ldpi/icon_default_user_head.png rename to core/mogo-core-res/src/main/res/drawable-mdpi/icon_default_user_head.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/icon_car_red.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/icon_car_red.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/icon_car_red.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/icon_car_red.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_car_gray.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/icon_map_marker_car_gray.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_car_gray.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/icon_map_marker_car_gray.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_car_type_110.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/icon_map_marker_car_type_110.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_car_type_110.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/icon_map_marker_car_type_110.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_car_type_119.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/icon_map_marker_car_type_119.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_car_type_119.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/icon_map_marker_car_type_119.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_car_type_120.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/icon_map_marker_car_type_120.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_car_type_120.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/icon_map_marker_car_type_120.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_car_type_bus.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/icon_map_marker_car_type_bus.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_car_type_bus.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/icon_map_marker_car_type_bus.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_car_type_taxi.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/icon_map_marker_car_type_taxi.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_car_type_taxi.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/icon_map_marker_car_type_taxi.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_location_yellow.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/icon_map_marker_location_yellow.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_location_yellow.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/icon_map_marker_location_yellow.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_location_yellow_vr.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/icon_map_marker_location_yellow_vr.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_location_yellow_vr.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/icon_map_marker_location_yellow_vr.png diff --git a/modules/mogo-module-service/src/main/res/drawable-ldpi/icon_map_marker_road_block_up.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/icon_map_marker_road_block_up.png similarity index 100% rename from modules/mogo-module-service/src/main/res/drawable-ldpi/icon_map_marker_road_block_up.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/icon_map_marker_road_block_up.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_road_block_up2.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/icon_map_marker_road_block_up2.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_road_block_up2.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/icon_map_marker_road_block_up2.png diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/icon_map_marker_road_block_up2_white.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/icon_map_marker_road_block_up2_white.png similarity index 100% rename from modules/mogo-module-service/src/main/res/drawable-xhdpi/icon_map_marker_road_block_up2_white.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/icon_map_marker_road_block_up2_white.png diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/icon_map_marker_road_check2_white.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/icon_map_marker_road_check2_white.png similarity index 100% rename from modules/mogo-module-service/src/main/res/drawable-xhdpi/icon_map_marker_road_check2_white.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/icon_map_marker_road_check2_white.png diff --git a/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/icon_module_small_map_four_corners.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/icon_module_small_map_four_corners.png similarity index 100% rename from core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/icon_module_small_map_four_corners.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/icon_module_small_map_four_corners.png diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi-1920x1000/map_api_ic_current_location2_cursor.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/map_api_ic_current_location2_cursor.png similarity index 100% rename from modules/mogo-module-service/src/main/res/drawable-xhdpi-1920x1000/map_api_ic_current_location2_cursor.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/map_api_ic_current_location2_cursor.png diff --git a/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/map_bus_icon.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/map_bus_icon.png similarity index 100% rename from core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/map_bus_icon.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/map_bus_icon.png diff --git a/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/map_car_icon.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/map_car_icon.png similarity index 100% rename from core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/map_car_icon.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/map_car_icon.png diff --git a/modules/mogo-module-common/src/main/res/drawable-mdpi/module_camera_real_time_traffic.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_camera_real_time_traffic.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-mdpi/module_camera_real_time_traffic.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_camera_real_time_traffic.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_ic_rc_accident3.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_ic_rc_accident3.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_ic_rc_accident3.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_ic_rc_accident3.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_ic_rc_accident3_white.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_ic_rc_accident3_white.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_ic_rc_accident3_white.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_ic_rc_accident3_white.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_ic_rc_dark_frog2.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_ic_rc_dark_frog2.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_ic_rc_dark_frog2.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_ic_rc_dark_frog2.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_ic_rc_dark_frog2_white.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_ic_rc_dark_frog2_white.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_ic_rc_dark_frog2_white.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_ic_rc_dark_frog2_white.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_ic_rc_freeze2.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_ic_rc_freeze2.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_ic_rc_freeze2.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_ic_rc_freeze2.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_ic_rc_freeze2_white.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_ic_rc_freeze2_white.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_ic_rc_freeze2_white.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_ic_rc_freeze2_white.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_ic_rc_illegal_park.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_ic_rc_illegal_park.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_ic_rc_illegal_park.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_ic_rc_illegal_park.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_ic_rc_illegal_park_white.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_ic_rc_illegal_park_white.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_ic_rc_illegal_park_white.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_ic_rc_illegal_park_white.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_close.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_close.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_close.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_close.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_close_press.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_close_press.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_close_press.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_close_press.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_close_vr.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_close_vr.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_close_vr.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_close_vr.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_like_selected_vr.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_like_selected_vr.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_like_selected_vr.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_like_selected_vr.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_like_vr.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_like_vr.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_like_vr.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_like_vr.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_living.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_map_marker_living.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_living.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_map_marker_living.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_living_white.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_map_marker_living_white.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_living_white.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_map_marker_living_white.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_pondingl2.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_map_marker_pondingl2.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_pondingl2.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_map_marker_pondingl2.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_pondingl2_white.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_map_marker_pondingl2_white.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_pondingl2_white.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_map_marker_pondingl2_white.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_block_off2.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_block_off2.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_block_off2.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_block_off2.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_block_off2_white.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_block_off2_white.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_block_off2_white.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_block_off2_white.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_block_up2.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_block_up2.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_block_up2.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_block_up2.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_block_up2_white.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_block_up2_white.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_block_up2_white.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_block_up2_white.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_check2.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_check2.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_check2.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_check2.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_check2_white.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_check2_white.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_check2_white.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_check2_white.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_work2.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_work2.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_work2.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_work2.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_work2_white.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_work2_white.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_work2_white.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_work2_white.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_seek_help.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_seek_help.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_seek_help.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_seek_help.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_unlike_selected_vr.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_unlike_selected_vr.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_unlike_selected_vr.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_unlike_selected_vr.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_unlike_vr.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_unlike_vr.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_unlike_vr.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_unlike_vr.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_ext_shadow_bkg.9.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_ext_shadow_bkg.9.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_ext_shadow_bkg.9.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_ext_shadow_bkg.9.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_ext_shadow_bkg_pressed.9.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_ext_shadow_bkg_pressed.9.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_ext_shadow_bkg_pressed.9.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_ext_shadow_bkg_pressed.9.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_services_marker_bkg.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_services_marker_bkg.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_services_marker_bkg.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_services_marker_bkg.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_services_marker_vr_bkg.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_services_marker_vr_bkg.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_services_marker_vr_bkg.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_services_marker_vr_bkg.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_services_marker_vr_bkg_checked.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_services_marker_vr_bkg_checked.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/module_services_marker_vr_bkg_checked.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_services_marker_vr_bkg_checked.png diff --git a/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/module_small_map_view_border.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_small_map_view_border.png similarity index 100% rename from core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/module_small_map_view_border.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_small_map_view_border.png diff --git a/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/module_small_map_view_border_north.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_small_map_view_border_north.png similarity index 100% rename from core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/module_small_map_view_border_north.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_small_map_view_border_north.png diff --git a/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/module_small_map_view_my_location_logo.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/module_small_map_view_my_location_logo.png similarity index 100% rename from core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/module_small_map_view_my_location_logo.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/module_small_map_view_my_location_logo.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/mogo_image_accident_small.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_accident_small.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/mogo_image_accident_small.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_accident_small.png diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_daolushigong_nor.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_daolushigong_nor.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_daolushigong_nor.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_daolushigong_nor.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/mogo_image_daolushigong_small.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_daolushigong_small.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/mogo_image_daolushigong_small.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_daolushigong_small.png diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_fenglu_nor.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_fenglu_nor.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_fenglu_nor.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_fenglu_nor.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/mogo_image_fenglu_small.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_fenglu_small.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/mogo_image_fenglu_small.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_fenglu_small.png diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_jiaotongjiancha_nor.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_jiaotongjiancha_nor.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_jiaotongjiancha_nor.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_jiaotongjiancha_nor.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/mogo_image_jiaotongjiancha_small.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_jiaotongjiancha_small.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/mogo_image_jiaotongjiancha_small.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_jiaotongjiancha_small.png diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_jiaotongshigu_nor.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_jiaotongshigu_nor.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_jiaotongshigu_nor.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_jiaotongshigu_nor.png diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_jiebing_nor.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_jiebing_nor.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_jiebing_nor.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_jiebing_nor.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/mogo_image_jiebing_small.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_jiebing_small.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/mogo_image_jiebing_small.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_jiebing_small.png diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_jishui_nor.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_jishui_nor.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_jishui_nor.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_jishui_nor.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/mogo_image_jishui_small.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_jishui_small.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/mogo_image_jishui_small.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_jishui_small.png diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_nongwu_nor.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_nongwu_nor.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_nongwu_nor.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_nongwu_nor.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/mogo_image_nongwu_small.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_nongwu_small.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/mogo_image_nongwu_small.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_nongwu_small.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/mogo_image_shishilukuang_small.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_shishilukuang_small.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/mogo_image_shishilukuang_small.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_shishilukuang_small.png diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_shishlukuang_nor.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_shishlukuang_nor.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_shishlukuang_nor.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_shishlukuang_nor.png diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_yongdu_nor.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_yongdu_nor.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_yongdu_nor.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_yongdu_nor.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/mogo_image_yongdu_small.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_yongdu_small.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/mogo_image_yongdu_small.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/mogo_image_yongdu_small.png diff --git a/modules/mogo-module-common/src/main/res/drawable/selector_call_btn_normal.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/selector_call_btn_normal.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable/selector_call_btn_normal.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/selector_call_btn_normal.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/selector_call_btn_pressed.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/selector_call_btn_pressed.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/selector_call_btn_pressed.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/selector_call_btn_pressed.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v2x_icon_daolushigong_vr.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/v2x_icon_daolushigong_vr.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/v2x_icon_daolushigong_vr.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/v2x_icon_daolushigong_vr.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v2x_icon_fenglu_vr.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/v2x_icon_fenglu_vr.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/v2x_icon_fenglu_vr.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/v2x_icon_fenglu_vr.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v2x_icon_jiaotongjiancha_vr.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/v2x_icon_jiaotongjiancha_vr.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/v2x_icon_jiaotongjiancha_vr.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/v2x_icon_jiaotongjiancha_vr.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v2x_icon_jiaotongshigu_vr.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/v2x_icon_jiaotongshigu_vr.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/v2x_icon_jiaotongshigu_vr.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/v2x_icon_jiaotongshigu_vr.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v2x_icon_jishui_vr.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/v2x_icon_jishui_vr.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/v2x_icon_jishui_vr.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/v2x_icon_jishui_vr.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v2x_icon_live_logo.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/v2x_icon_live_logo.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/v2x_icon_live_logo.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/v2x_icon_live_logo.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v2x_icon_nongwu_vr.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/v2x_icon_nongwu_vr.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/v2x_icon_nongwu_vr.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/v2x_icon_nongwu_vr.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v2x_icon_yongdu_vr.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/v2x_icon_yongdu_vr.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/v2x_icon_yongdu_vr.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/v2x_icon_yongdu_vr.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_event_ugc_yongdu.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/v_to_x_event_ugc_yongdu.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_event_ugc_yongdu.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/v_to_x_event_ugc_yongdu.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_1.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/v_to_x_marker_1.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_1.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/v_to_x_marker_1.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_11.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/v_to_x_marker_11.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_11.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/v_to_x_marker_11.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_16.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/v_to_x_marker_16.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_16.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/v_to_x_marker_16.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_2.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/v_to_x_marker_2.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_2.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/v_to_x_marker_2.png diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_3.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/v_to_x_marker_3.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_3.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/v_to_x_marker_3.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_5.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/v_to_x_marker_5.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_5.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/v_to_x_marker_5.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_6.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/v_to_x_marker_6.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_6.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/v_to_x_marker_6.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_7.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/v_to_x_marker_7.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_7.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/v_to_x_marker_7.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_8.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/v_to_x_marker_8.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_8.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/v_to_x_marker_8.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_9.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/v_to_x_marker_9.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_9.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/v_to_x_marker_9.png diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_warning_car_red.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/v_to_x_warning_car_red.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_warning_car_red.png rename to core/mogo-core-res/src/main/res/drawable-xhdpi/v_to_x_warning_car_red.png diff --git a/modules/mogo-module-common/src/main/res/drawable/bg_v2x_event_type_blue.xml b/core/mogo-core-res/src/main/res/drawable/bg_v2x_event_type_blue.xml similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable/bg_v2x_event_type_blue.xml rename to core/mogo-core-res/src/main/res/drawable/bg_v2x_event_type_blue.xml diff --git a/modules/mogo-module-common/src/main/res/drawable/bg_v2x_event_type_orange.xml b/core/mogo-core-res/src/main/res/drawable/bg_v2x_event_type_orange.xml similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable/bg_v2x_event_type_orange.xml rename to core/mogo-core-res/src/main/res/drawable/bg_v2x_event_type_orange.xml diff --git a/modules/mogo-module-common/src/main/res/drawable/bg_v2x_event_type_orange_vr.xml b/core/mogo-core-res/src/main/res/drawable/bg_v2x_event_type_orange_vr.xml similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable/bg_v2x_event_type_orange_vr.xml rename to core/mogo-core-res/src/main/res/drawable/bg_v2x_event_type_orange_vr.xml diff --git a/modules/mogo-module-common/src/main/res/drawable/bg_v2x_event_type_read.xml b/core/mogo-core-res/src/main/res/drawable/bg_v2x_event_type_read.xml similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable/bg_v2x_event_type_read.xml rename to core/mogo-core-res/src/main/res/drawable/bg_v2x_event_type_read.xml diff --git a/modules/mogo-module-common/src/main/res/drawable/bg_v2x_event_type_red_vr.xml b/core/mogo-core-res/src/main/res/drawable/bg_v2x_event_type_red_vr.xml similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable/bg_v2x_event_type_red_vr.xml rename to core/mogo-core-res/src/main/res/drawable/bg_v2x_event_type_red_vr.xml diff --git a/modules/mogo-module-common/src/main/res/drawable/module_common_close_selector.xml b/core/mogo-core-res/src/main/res/drawable/module_common_close_selector.xml similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable/module_common_close_selector.xml rename to core/mogo-core-res/src/main/res/drawable/module_common_close_selector.xml diff --git a/modules/mogo-module-common/src/main/res/drawable/module_common_close_selector_vr.xml b/core/mogo-core-res/src/main/res/drawable/module_common_close_selector_vr.xml similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable/module_common_close_selector_vr.xml rename to core/mogo-core-res/src/main/res/drawable/module_common_close_selector_vr.xml diff --git a/modules/mogo-module-common/src/main/res/drawable/module_common_like_vr.xml b/core/mogo-core-res/src/main/res/drawable/module_common_like_vr.xml similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable/module_common_like_vr.xml rename to core/mogo-core-res/src/main/res/drawable/module_common_like_vr.xml diff --git a/modules/mogo-module-common/src/main/res/drawable/module_common_selector_call.xml b/core/mogo-core-res/src/main/res/drawable/module_common_selector_call.xml similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable/module_common_selector_call.xml rename to core/mogo-core-res/src/main/res/drawable/module_common_selector_call.xml diff --git a/modules/mogo-module-common/src/main/res/drawable/module_common_unlike_vr.xml b/core/mogo-core-res/src/main/res/drawable/module_common_unlike_vr.xml similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable/module_common_unlike_vr.xml rename to core/mogo-core-res/src/main/res/drawable/module_common_unlike_vr.xml diff --git a/modules/mogo-module-common/src/main/res/drawable/module_commons_dialog_bg.xml b/core/mogo-core-res/src/main/res/drawable/module_commons_dialog_bg.xml similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable/module_commons_dialog_bg.xml rename to core/mogo-core-res/src/main/res/drawable/module_commons_dialog_bg.xml diff --git a/modules/mogo-module-common/src/main/res/drawable/module_commons_dialog_left_bg.xml b/core/mogo-core-res/src/main/res/drawable/module_commons_dialog_left_bg.xml similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable/module_commons_dialog_left_bg.xml rename to core/mogo-core-res/src/main/res/drawable/module_commons_dialog_left_bg.xml diff --git a/modules/mogo-module-common/src/main/res/drawable/module_commons_dialog_right_bg.xml b/core/mogo-core-res/src/main/res/drawable/module_commons_dialog_right_bg.xml similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable/module_commons_dialog_right_bg.xml rename to core/mogo-core-res/src/main/res/drawable/module_commons_dialog_right_bg.xml diff --git a/modules/mogo-module-common/src/main/res/drawable/module_dw_common_corner_bkg_light.xml b/core/mogo-core-res/src/main/res/drawable/module_dw_common_corner_bkg_light.xml similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable/module_dw_common_corner_bkg_light.xml rename to core/mogo-core-res/src/main/res/drawable/module_dw_common_corner_bkg_light.xml diff --git a/modules/mogo-module-common/src/main/res/drawable/module_ext_drawable_shadow_bg.xml b/core/mogo-core-res/src/main/res/drawable/module_ext_drawable_shadow_bg.xml similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable/module_ext_drawable_shadow_bg.xml rename to core/mogo-core-res/src/main/res/drawable/module_ext_drawable_shadow_bg.xml diff --git a/modules/mogo-module-common/src/main/res/drawable/module_ext_shadow_bkg.9.png b/core/mogo-core-res/src/main/res/drawable/module_ext_shadow_bkg.9.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable/module_ext_shadow_bkg.9.png rename to core/mogo-core-res/src/main/res/drawable/module_ext_shadow_bkg.9.png diff --git a/modules/mogo-module-common/src/main/res/drawable/module_ext_shadow_bkg_pressed.9.png b/core/mogo-core-res/src/main/res/drawable/module_ext_shadow_bkg_pressed.9.png similarity index 100% rename from modules/mogo-module-common/src/main/res/drawable/module_ext_shadow_bkg_pressed.9.png rename to core/mogo-core-res/src/main/res/drawable/module_ext_shadow_bkg_pressed.9.png diff --git a/core/mogo-core-res/src/main/res/values/dimens.xml b/core/mogo-core-res/src/main/res/values/dimens.xml index 46091d3de0..f669742fe9 100644 --- a/core/mogo-core-res/src/main/res/values/dimens.xml +++ b/core/mogo-core-res/src/main/res/values/dimens.xml @@ -1,16 +1,1094 @@ - 20dp - 52dp - 65dp - 200dp - 100dp - 1200dp - 1600dp - 300dp - 300dp - 60dp + + + + -60px + -30px + -20px + -12px + -10px + -8px + -5px + -2px + -1px + 0px + 0.1px + 0.5px + 1px + 1.5px + 2px + 2.5px + 3px + 3.5px + 4px + 4.5px + 5px + 6px + 7px + 7.5px + 8px + 9px + 10px + 11px + 12px + 13px + 14px + 15px + 16px + 17px + 18px + 19px + 20px + 21px + 22px + 23px + 24px + 25px + 26px + 27px + 28px + 29px + 30px + 31px + 32px + 33px + 34px + 35px + 36px + 37px + 38px + 39px + 40px + 41px + 42px + 43px + 44px + 45px + 46px + 47px + 48px + 49px + 50px + 51px + 52px + 53px + 54px + 55px + 56px + 57px + 58px + 59px + 60px + 61px + 62px + 63px + 64px + 65px + 66px + 67px + 68px + 69px + 70px + 71px + 72px + 73px + 74px + 75px + 76px + 77px + 78px + 79px + 80px + 81px + 82px + 83px + 84px + 85px + 86px + 87px + 88px + 89px + 90px + 91px + 92px + 93px + 94px + 95px + 96px + 97px + 98px + 99px + 100px + 101px + 102px + 103px + 104px + 104.5px + 105px + 106px + 107px + 108px + 109px + 110px + 111px + 112px + 113px + 114px + 115px + 116px + 117px + 118px + 119px + 120px + 121px + 122px + 123px + 124px + 125px + 126px + 127px + 128px + 129px + 130px + 131px + 132px + 133px + 134px + 134.5px + 135px + 136px + 137px + 138px + 139px + 140px + 141px + 142px + 143px + 144px + 145px + 146px + 147px + 148px + 149px + 150px + 151px + 152px + 153px + 154px + 155px + 156px + 157px + 158px + 159px + 160px + 161px + 162px + 163px + 164px + 165px + 166px + 167px + 168px + 169px + 170px + 171px + 172px + 173px + 174px + 175px + 176px + 177px + 178px + 179px + 180px + 181px + 182px + 183px + 184px + 185px + 186px + 187px + 188px + 189px + 190px + 191px + 191.25px + 192px + 193px + 194px + 195px + 196px + 197px + 198px + 199px + 200px + 201px + 202px + 203px + 204px + 205px + 206px + 207px + 208px + 209px + 210px + 211px + 212px + 213px + 214px + 215px + 216px + 217px + 218px + 219px + 220px + 221px + 222px + 223px + 224px + 225px + 226px + 227px + 228px + 229px + 230px + 231px + 232px + 233px + 234px + 235px + 236px + 237px + 238px + 239px + 240px + 241px + 242px + 243px + 244px + 245px + 246px + 247px + 248px + 249px + 250px + 251px + 252px + 253px + 254px + 255px + 256px + 257px + 258px + 259px + 260px + 261px + 262px + 263px + 264px + 265px + 266px + 267px + 268px + 269px + 270px + 271px + 272px + 273px + 274px + 275px + 276px + 277px + 278px + 279px + 280px + 281px + 282px + 283px + 284px + 285px + 286px + 287px + 288px + 289px + 290px + 291px + 292px + 293px + 294px + 295px + 296px + 297px + 298px + 299px + 300px + 301px + 302px + 303px + 304px + 305px + 306px + 307px + 308px + 309px + 310px + 311px + 312px + 313px + 314px + 315px + 316px + 317px + 318px + 319px + 320px + 321px + 322px + 323px + 324px + 325px + 326px + 327px + 328px + 329px + 330px + 331px + 332px + 333px + 334px + 335px + 336px + 337px + 338px + 339px + 340px + 341px + 342px + 343px + 344px + 345px + 346px + 347px + 348px + 349px + 350px + 351px + 352px + 353px + 354px + 355px + 356px + 357px + 358px + 359px + 366px + 367px + 368px + 369px + 370px + 371px + 372px + 373px + 374px + 375px + 376px + 377px + 378px + 379px + 380px + 381px + 382px + 383px + 384px + 385px + 386px + 387px + 388px + 389px + 390px + 391px + 392px + 393px + 394px + 395px + 396px + 397px + 398px + 399px + 400px + 401px + 402px + 403px + 404px + 405px + 406px + 407px + 408px + 409px + 410px + 411px + 412px + 413px + 414px + 415px + 416px + 417px + 418px + 419px + 420px + 421px + 422px + 423px + 424px + 425px + 426px + 427px + 428px + 429px + 430px + 431px + 432px + 433px + 434px + 435px + 436px + 437px + 438px + 439px + 440px + 441px + 442px + 443px + 444px + 445px + 446px + 447px + 448px + 449px + 450px + 451px + 452px + 453px + 454px + 455px + 456px + 457px + 458px + 459px + 460px + 461px + 462px + 463px + 464px + 465px + 466px + 467px + 468px + 469px + 470px + 471px + 472px + 473px + 474px + 475px + 476px + 477px + 478px + 479px + 480px + 481px + 482px + 483px + 484px + 485px + 486px + 487px + 488px + 489px + 490px + 491px + 492px + 493px + 494px + 495px + 496px + 497px + 498px + 499px + 500px + 501px + 502px + 503px + 504px + 505px + 506px + 507px + 508px + 509px + 510px + 511px + 512px + 513px + 514px + 515px + 516px + 517px + 518px + 519px + 520px + 521px + 522px + 523px + 524px + 525px + 526px + 527px + 528px + 529px + 530px + 531px + 532px + 533px + 534px + 535px + 536px + 537px + 538px + 539px + 540px + 541px + 542px + 543px + 544px + 545px + 546px + 547px + 548px + 549px + 550px + 551px + 552px + 553px + 554px + 555px + 556px + 557px + 558px + 559px + 560px + 561px + 562px + 563px + 564px + 565px + 566px + 567px + 568px + 569px + 570px + 571px + 572px + 573px + 574px + 575px + 576px + 577px + 578px + 579px + 580px + 581px + 582px + 583px + 584px + 585px + 586px + 587px + 588px + 589px + 590px + 591px + 592px + 593px + 594px + 595px + 596px + 597px + 598px + 599px + 600px + 601px + 602px + 603px + 604px + 605px + 606px + 607px + 608px + 609px + 610px + 611px + 612px + 613px + 614px + 615px + 616px + 617px + 618px + 619px + 620px + 621px + 622px + 623px + 624px + 625px + 626px + 627px + 628px + 629px + 630px + 631px + 632px + 633px + 634px + 635px + 636px + 637px + 638px + 639px + 640px + 641px + 642px + 643px + 644px + 645px + 646px + 647px + 648px + 649px + 650px + 651px + 652px + 653px + 654px + 655px + 656px + 657px + 658px + 659px + 660px + 661px + 662px + 663px + 664px + 665px + 666px + 667px + 668px + 669px + 670px + 671px + 672px + 673px + 674px + 675px + 676px + 677px + 678px + 679px + 680px + 681px + 682px + 683px + 684px + 685px + 686px + 687px + 688px + 689px + 690px + 691px + 692px + 693px + 694px + 695px + 696px + 697px + 698px + 699px + 700px + 701px + 702px + 703px + 704px + 705px + 706px + 707px + 708px + 709px + 710px + 711px + 712px + 713px + 714px + 715px + 716px + 717px + 718px + 719px + 720px + 721px + 722px + 723px + 724px + 725px + 726px + 727px + 728px + 729px + 730px + 731px + 732px + 733px + 734px + 735px + 736px + 737px + 738px + 739px + 740px + 741px + 742px + 743px + 744px + 745px + 746px + 747px + 748px + 749px + 750px + 751px + 752px + 753px + 754px + 755px + 756px + 757px + 758px + 759px + 760px + 761px + 762px + 763px + 764px + 765px + 766px + 767px + 768px + 769px + 770px + 771px + 772px + 773px + 774px + 775px + 776px + 777px + 778px + 779px + 780px + 781px + 782px + 783px + 784px + 785px + 786px + 787px + 788px + 789px + 790px + 791px + 792px + 793px + 794px + 795px + 796px + 797px + 798px + 799px + 800px + 801px + 802px + 803px + 804px + 805px + 806px + 807px + 808px + 809px + 810px + 811px + 812px + 813px + 814px + 815px + 816px + 817px + 818px + 819px + 820px + 821px + 822px + 823px + 824px + 825px + 826px + 827px + 828px + 829px + 830px + 831px + 832px + 833px + 834px + 835px + 836px + 837px + 838px + 839px + 840px + 841px + 842px + 843px + 844px + 845px + 846px + 847px + 848px + 849px + 850px + 851px + 852px + 853px + 854px + 855px + 856px + 857px + 858px + 859px + 860px + 861px + 862px + 863px + 864px + 865px + 866px + 867px + 868px + 869px + 870px + 871px + 872px + 873px + 874px + 875px + 876px + 877px + 878px + 879px + 880px + 881px + 882px + 883px + 884px + 885px + 886px + 887px + 888px + 889px + 890px + 891px + 892px + 893px + 894px + 895px + 896px + 897px + 898px + 899px + 900px + 901px + 902px + 903px + 904px + 905px + 906px + 907px + 908px + 909px + 910px + 911px + 912px + 913px + 914px + 915px + 916px + 917px + 918px + 919px + 920px + 921px + 922px + 923px + 924px + 925px + 926px + 927px + 928px + 929px + 930px + 931px + 932px + 933px + 934px + 935px + 936px + 937px + 938px + 939px + 940px + 941px + 942px + 943px + 944px + 945px + 946px + 947px + 948px + 949px + 950px + 951px + 952px + 953px + 954px + 955px + 956px + 957px + 958px + 959px + 960px + 961px + 962px + 963px + 964px + 965px + 966px + 967px + 968px + 969px + 970px + 971px + 972px + 973px + 974px + 975px + 976px + 977px + 978px + 979px + 980px + 981px + 982px + 983px + 984px + 985px + 986px + 987px + 988px + 989px + 990px + 991px + 992px + 993px + 994px + 995px + 996px + 997px + 998px + 999px + 1000px + 1100px + 1200px + 1300px + 1600px + 1920px + + + + + 6px + 7px + 8px + 9px + 10px + 11px + 12px + 13px + 14px + 15px + 16px + 17px + 18px + 19px + 20px + 21px + 22px + 23px + 24px + 25px + 28px + 30px + 32px + 34px + 36px + 38px + 40px + 42px + 46px + 48px + 76px + 120px + + + 50px + 36px + 151px + 33px + 102px + 26px + 30px + 34px + 9px + 40px + 20px + 70px + 16px + 21px + 28px + 45px + 22px + 42px + 20px + 34px + 28px + 60px + 22.5px + + + 300px + 300px + 60px 104dp 104dp diff --git a/core/mogo-core-utils/build.gradle b/core/mogo-core-utils/build.gradle index cf28ac9c2a..6999dfa86f 100644 --- a/core/mogo-core-utils/build.gradle +++ b/core/mogo-core-utils/build.gradle @@ -54,6 +54,7 @@ dependencies { kapt rootProject.ext.dependencies.androidxannotation api rootProject.ext.dependencies.glide kapt rootProject.ext.dependencies.glidecompiler + api rootProject.ext.dependencies.fresco implementation rootProject.ext.dependencies.kotlinstdlibjdk7 implementation rootProject.ext.dependencies.androidxannotation implementation rootProject.ext.dependencies.material diff --git a/services/mogo-service/src/main/java/com/mogo/service/impl/imageloader/glide/GlideImageLoader.java b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/GlideImageLoader.java similarity index 88% rename from services/mogo-service/src/main/java/com/mogo/service/impl/imageloader/glide/GlideImageLoader.java rename to core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/GlideImageLoader.java index 0f521405eb..9d81c90944 100644 --- a/services/mogo-service/src/main/java/com/mogo/service/impl/imageloader/glide/GlideImageLoader.java +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/GlideImageLoader.java @@ -1,4 +1,4 @@ -package com.mogo.service.impl.imageloader.glide; +package com.mogo.eagle.core.utilcode.mogo.glide; import android.content.Context; import android.graphics.Bitmap; @@ -10,14 +10,12 @@ import androidx.annotation.Nullable; import com.bumptech.glide.request.RequestOptions; import com.bumptech.glide.request.target.SimpleTarget; import com.bumptech.glide.request.transition.Transition; -import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp; -import com.mogo.service.imageloader.IMogoImageLoaderListener; -import com.mogo.service.imageloader.IMogoImageloader; -import com.mogo.service.imageloader.MogoImageView; -import com.mogo.service.impl.imageloader.glide.transform.GlideBlurTransform; -import com.mogo.service.impl.imageloader.glide.transform.GlideCircleBitmapTransform; -import com.mogo.service.impl.imageloader.glide.transform.GlideRoundBitmapTransform; -import com.mogo.service.impl.imageloader.glide.utils.DiskLruCacheManager; +import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideBlurTransform; +import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideCircleBitmapTransform; +import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundBitmapTransform; +import com.mogo.eagle.core.utilcode.mogo.glide.utils.DiskLruCacheManager; +import com.mogo.eagle.core.utilcode.mogo.imageloader.IMogoImageLoaderListener; +import com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView; /** * @author congtaowang @@ -25,7 +23,7 @@ import com.mogo.service.impl.imageloader.glide.utils.DiskLruCacheManager; *

* 实现图片接口 */ -public class GlideImageLoader implements IMogoImageloader { +public class GlideImageLoader{ private static final String TAG = "GlideImageLoader"; @@ -45,27 +43,18 @@ public class GlideImageLoader implements IMogoImageloader { return sInstance; } - @Override - public void init( Context context ) { - - } - - @Override public void displayImage( String url, MogoImageView imageView ) { displayImage( url, imageView, null ); } - @Override - public void displayImage( String url, MogoImageView imageView, int width, int height ) { + public void displayImage(String url, MogoImageView imageView, int width, int height ) { displayImage( url, imageView, width, height, null ); } - @Override public void displayImage( String url, MogoImageView imageView, IMogoImageLoaderListener listener ) { displayImage( url, imageView, 0, 0, listener ); } - @Override public void displayImage( String url, MogoImageView imageView, int width, int height, final IMogoImageLoaderListener listener ) { if ( listener != null ) { @@ -149,7 +138,6 @@ public class GlideImageLoader implements IMogoImageloader { } ); } - @Override public void downloadImage( Context context, String url, final IMogoImageLoaderListener listener ) { if ( listener != null ) { listener.onStart(); @@ -179,7 +167,4 @@ public class GlideImageLoader implements IMogoImageloader { } ); } - @Override - public void destroy() { - } } diff --git a/services/mogo-service/src/main/java/com/mogo/service/impl/imageloader/glide/transform/GlideBlurTransform.java b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/transform/GlideBlurTransform.java similarity index 84% rename from services/mogo-service/src/main/java/com/mogo/service/impl/imageloader/glide/transform/GlideBlurTransform.java rename to core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/transform/GlideBlurTransform.java index 65f1c49fbf..0d443b66dd 100644 --- a/services/mogo-service/src/main/java/com/mogo/service/impl/imageloader/glide/transform/GlideBlurTransform.java +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/transform/GlideBlurTransform.java @@ -1,4 +1,4 @@ -package com.mogo.service.impl.imageloader.glide.transform; +package com.mogo.eagle.core.utilcode.mogo.glide.transform; import android.content.Context; import android.graphics.Bitmap; @@ -7,8 +7,8 @@ import androidx.annotation.NonNull; import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool; import com.bumptech.glide.load.resource.bitmap.BitmapTransformation; -import com.mogo.service.impl.imageloader.glide.utils.DiskLruCacheManager; -import com.mogo.service.impl.imageloader.glide.utils.FastBlurUtil; +import com.mogo.eagle.core.utilcode.mogo.glide.utils.DiskLruCacheManager; +import com.mogo.eagle.core.utilcode.mogo.glide.utils.FastBlurUtil; import java.security.MessageDigest; diff --git a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/GlideBlurTransformation.java b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/transform/GlideBlurTransformation.java similarity index 98% rename from core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/GlideBlurTransformation.java rename to core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/transform/GlideBlurTransformation.java index 6458b189c9..795cb12f6d 100644 --- a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/GlideBlurTransformation.java +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/transform/GlideBlurTransformation.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.utilcode.mogo.glide; +package com.mogo.eagle.core.utilcode.mogo.glide.transform; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_UTIL; diff --git a/services/mogo-service/src/main/java/com/mogo/service/impl/imageloader/glide/transform/GlideCircleBitmapTransform.java b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/transform/GlideCircleBitmapTransform.java similarity index 95% rename from services/mogo-service/src/main/java/com/mogo/service/impl/imageloader/glide/transform/GlideCircleBitmapTransform.java rename to core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/transform/GlideCircleBitmapTransform.java index 340b8d1627..b56d33102a 100644 --- a/services/mogo-service/src/main/java/com/mogo/service/impl/imageloader/glide/transform/GlideCircleBitmapTransform.java +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/transform/GlideCircleBitmapTransform.java @@ -1,5 +1,5 @@ -package com.mogo.service.impl.imageloader.glide.transform; +package com.mogo.eagle.core.utilcode.mogo.glide.transform; import android.content.Context; import android.graphics.Bitmap; @@ -11,7 +11,7 @@ import androidx.annotation.NonNull; import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool; import com.bumptech.glide.load.resource.bitmap.BitmapTransformation; -import com.mogo.service.impl.imageloader.glide.utils.DiskLruCacheManager; +import com.mogo.eagle.core.utilcode.mogo.glide.utils.DiskLruCacheManager; import java.security.MessageDigest; diff --git a/services/mogo-service/src/main/java/com/mogo/service/impl/imageloader/glide/transform/GlideRoundBitmapTransform.java b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/transform/GlideRoundBitmapTransform.java similarity index 95% rename from services/mogo-service/src/main/java/com/mogo/service/impl/imageloader/glide/transform/GlideRoundBitmapTransform.java rename to core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/transform/GlideRoundBitmapTransform.java index 261d7f9be4..fe2a63f1d5 100644 --- a/services/mogo-service/src/main/java/com/mogo/service/impl/imageloader/glide/transform/GlideRoundBitmapTransform.java +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/transform/GlideRoundBitmapTransform.java @@ -1,5 +1,5 @@ -package com.mogo.service.impl.imageloader.glide.transform; +package com.mogo.eagle.core.utilcode.mogo.glide.transform; import android.content.Context; import android.graphics.Bitmap; @@ -12,7 +12,7 @@ import androidx.annotation.NonNull; import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool; import com.bumptech.glide.load.resource.bitmap.BitmapTransformation; -import com.mogo.service.impl.imageloader.glide.utils.DiskLruCacheManager; +import com.mogo.eagle.core.utilcode.mogo.glide.utils.DiskLruCacheManager; import java.security.MessageDigest; diff --git a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/GlideRoundedCornersTransform.java b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/transform/GlideRoundedCornersTransform.java similarity index 99% rename from core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/GlideRoundedCornersTransform.java rename to core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/transform/GlideRoundedCornersTransform.java index 1beeae7e25..a16f333132 100644 --- a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/GlideRoundedCornersTransform.java +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/transform/GlideRoundedCornersTransform.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.utilcode.mogo.glide; +package com.mogo.eagle.core.utilcode.mogo.glide.transform; import android.graphics.Bitmap; import android.graphics.BitmapShader; diff --git a/services/mogo-service/src/main/java/com/mogo/service/impl/imageloader/glide/utils/DiskLruCache.java b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/utils/DiskLruCache.java similarity index 99% rename from services/mogo-service/src/main/java/com/mogo/service/impl/imageloader/glide/utils/DiskLruCache.java rename to core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/utils/DiskLruCache.java index b0beddced2..89431ce387 100644 --- a/services/mogo-service/src/main/java/com/mogo/service/impl/imageloader/glide/utils/DiskLruCache.java +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/utils/DiskLruCache.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.mogo.service.impl.imageloader.glide.utils; +package com.mogo.eagle.core.utilcode.mogo.glide.utils; import java.io.BufferedWriter; import java.io.Closeable; diff --git a/services/mogo-service/src/main/java/com/mogo/service/impl/imageloader/glide/utils/DiskLruCacheManager.java b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/utils/DiskLruCacheManager.java similarity index 97% rename from services/mogo-service/src/main/java/com/mogo/service/impl/imageloader/glide/utils/DiskLruCacheManager.java rename to core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/utils/DiskLruCacheManager.java index 0c38ed7c12..5742564602 100644 --- a/services/mogo-service/src/main/java/com/mogo/service/impl/imageloader/glide/utils/DiskLruCacheManager.java +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/utils/DiskLruCacheManager.java @@ -1,4 +1,4 @@ -package com.mogo.service.impl.imageloader.glide.utils; +package com.mogo.eagle.core.utilcode.mogo.glide.utils; import android.content.Context; import android.graphics.Bitmap; diff --git a/services/mogo-service/src/main/java/com/mogo/service/impl/imageloader/glide/utils/FastBlurUtil.java b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/utils/FastBlurUtil.java similarity index 99% rename from services/mogo-service/src/main/java/com/mogo/service/impl/imageloader/glide/utils/FastBlurUtil.java rename to core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/utils/FastBlurUtil.java index 9de44f0cd3..5b0ccdf2a9 100755 --- a/services/mogo-service/src/main/java/com/mogo/service/impl/imageloader/glide/utils/FastBlurUtil.java +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/utils/FastBlurUtil.java @@ -1,4 +1,4 @@ -package com.mogo.service.impl.imageloader.glide.utils; +package com.mogo.eagle.core.utilcode.mogo.glide.utils; import android.graphics.Bitmap; diff --git a/services/mogo-service/src/main/java/com/mogo/service/impl/imageloader/glide/utils/StrictLineReader.java b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/utils/StrictLineReader.java similarity index 99% rename from services/mogo-service/src/main/java/com/mogo/service/impl/imageloader/glide/utils/StrictLineReader.java rename to core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/utils/StrictLineReader.java index 6083bb107a..a7ab8e7994 100644 --- a/services/mogo-service/src/main/java/com/mogo/service/impl/imageloader/glide/utils/StrictLineReader.java +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/utils/StrictLineReader.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.mogo.service.impl.imageloader.glide.utils; +package com.mogo.eagle.core.utilcode.mogo.glide.utils; import java.io.ByteArrayOutputStream; import java.io.Closeable; diff --git a/services/mogo-service/src/main/java/com/mogo/service/impl/imageloader/glide/utils/Util.java b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/utils/Util.java similarity index 97% rename from services/mogo-service/src/main/java/com/mogo/service/impl/imageloader/glide/utils/Util.java rename to core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/utils/Util.java index eaf34b7a49..895f7e0e1d 100644 --- a/services/mogo-service/src/main/java/com/mogo/service/impl/imageloader/glide/utils/Util.java +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/utils/Util.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.mogo.service.impl.imageloader.glide.utils; +package com.mogo.eagle.core.utilcode.mogo.glide.utils; import java.io.Closeable; import java.io.File; diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/imageloader/IMogoImageLoaderListener.java b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/imageloader/IMogoImageLoaderListener.java similarity index 88% rename from services/mogo-service-api/src/main/java/com/mogo/service/imageloader/IMogoImageLoaderListener.java rename to core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/imageloader/IMogoImageLoaderListener.java index ead28da3fb..d584393027 100644 --- a/services/mogo-service-api/src/main/java/com/mogo/service/imageloader/IMogoImageLoaderListener.java +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/imageloader/IMogoImageLoaderListener.java @@ -1,4 +1,4 @@ -package com.mogo.service.imageloader; +package com.mogo.eagle.core.utilcode.mogo.imageloader; import android.graphics.Bitmap; diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/imageloader/MogoImageView.java b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/imageloader/MogoImageView.java similarity index 98% rename from services/mogo-service-api/src/main/java/com/mogo/service/imageloader/MogoImageView.java rename to core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/imageloader/MogoImageView.java index 69c88fecf4..a3ef83ef6a 100644 --- a/services/mogo-service-api/src/main/java/com/mogo/service/imageloader/MogoImageView.java +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/imageloader/MogoImageView.java @@ -1,4 +1,4 @@ -package com.mogo.service.imageloader; +package com.mogo.eagle.core.utilcode.mogo.imageloader; import android.content.Context; import android.content.res.TypedArray; @@ -10,7 +10,7 @@ import androidx.annotation.DrawableRes; import androidx.annotation.Keep; import com.facebook.drawee.view.GenericDraweeView; -import com.mogo.service.R; +import com.mogo.eagle.core.utilcode.util.R; /** * @author congtaowang diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/view/OnPreventFastClickListener.java b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/view/OnPreventFastClickListener.java similarity index 73% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/view/OnPreventFastClickListener.java rename to core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/view/OnPreventFastClickListener.java index cc87f416d7..63f5e3369e 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/view/OnPreventFastClickListener.java +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/view/OnPreventFastClickListener.java @@ -1,19 +1,12 @@ -package com.mogo.module.common.view; +package com.mogo.eagle.core.utilcode.mogo.view; import android.view.View; -public -/** - * @author congtaowang - * @since 2020/9/25 - * - * 防止短时间内多次点击 - */ -abstract class OnPreventFastClickListener implements View.OnClickListener { +public abstract class OnPreventFastClickListener implements View.OnClickListener { public static final long INTERVAL = 1_000L; - private long mInterval; + private final long mInterval; private long mLastClickTime = 0L; public OnPreventFastClickListener() { diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/view/SpacesItemDecoration.java b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/view/SpacesItemDecoration.java similarity index 87% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/view/SpacesItemDecoration.java rename to core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/view/SpacesItemDecoration.java index 909ec058dd..d1b0753769 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/view/SpacesItemDecoration.java +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/view/SpacesItemDecoration.java @@ -1,4 +1,4 @@ -package com.mogo.module.common.view; +package com.mogo.eagle.core.utilcode.mogo.view; import android.graphics.Rect; import android.view.View; @@ -11,7 +11,7 @@ import androidx.recyclerview.widget.RecyclerView; * @author donghongyu */ public class SpacesItemDecoration extends RecyclerView.ItemDecoration { - private int space; + private final int space; public SpacesItemDecoration(int space) { this.space = space; diff --git a/services/mogo-service-api/src/main/res/values/attrs.xml b/core/mogo-core-utils/src/main/res/values/attrs.xml similarity index 100% rename from services/mogo-service-api/src/main/res/values/attrs.xml rename to core/mogo-core-utils/src/main/res/values/attrs.xml diff --git a/foudations/mogo-commons/src/main/AndroidManifest.xml b/foudations/mogo-commons/src/main/AndroidManifest.xml index b4d9c66476..4e20539844 100644 --- a/foudations/mogo-commons/src/main/AndroidManifest.xml +++ b/foudations/mogo-commons/src/main/AndroidManifest.xml @@ -2,4 +2,18 @@ package="com.mogo.commons" > + + + + + + + + + + + + diff --git a/foudations/mogo-commons/src/main/java/com/mogo/commons/AbsMogoApplication.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/AbsMogoApplication.java index 4bd3d6aa61..da32bdba3d 100644 --- a/foudations/mogo-commons/src/main/java/com/mogo/commons/AbsMogoApplication.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/AbsMogoApplication.java @@ -11,6 +11,7 @@ import android.widget.TextView; import com.mogo.commons.crash.FinalizeCrashFixer; import com.mogo.commons.screen.ScreenHelper; +import com.mogo.commons.module.MogoServices; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.mogo.toast.TipDrawable; import com.mogo.eagle.core.utilcode.mogo.toast.TipToast; @@ -47,6 +48,7 @@ public abstract class AbsMogoApplication extends Application { } ScreenHelper.setScreenConfig(this); Utils.init(this); + MogoServices.getInstance().init(this); } private void initRxJavaErrorHandler() { @@ -99,4 +101,5 @@ public abstract class AbsMogoApplication extends Application { } return contentView; } + } diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/MogoModule.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/MogoModule.java similarity index 97% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/MogoModule.java rename to foudations/mogo-commons/src/main/java/com/mogo/commons/module/MogoModule.java index 6e8ed16cf0..4e023c24ba 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/MogoModule.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/MogoModule.java @@ -1,4 +1,4 @@ -package com.mogo.module.common; +package com.mogo.commons.module; /** * @author congtaowang diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/MogoModulePaths.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/MogoModulePaths.java similarity index 98% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/MogoModulePaths.java rename to foudations/mogo-commons/src/main/java/com/mogo/commons/module/MogoModulePaths.java index b0d243ef8c..4693d1cb44 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/MogoModulePaths.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/MogoModulePaths.java @@ -1,4 +1,4 @@ -package com.mogo.module.common; +package com.mogo.commons.module; import android.text.TextUtils; diff --git a/foudations/mogo-commons/src/main/java/com/mogo/commons/module/MogoServices.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/MogoServices.java new file mode 100644 index 0000000000..017b3c747e --- /dev/null +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/MogoServices.java @@ -0,0 +1,113 @@ +package com.mogo.commons.module; + +import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_OLD_OTHER; + +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.net.ConnectivityManager; +import android.text.TextUtils; + +import com.mogo.commons.debug.DebugConfig; +import com.mogo.commons.module.intent.IMogoIntentListener; +import com.mogo.commons.module.intent.IntentHandlerFactory; +import com.mogo.commons.module.intent.IntentManager; +import com.mogo.commons.module.status.MogoStatusManager; +import com.mogo.commons.module.receiver.MogoReceiver; +import com.mogo.commons.voice.AIAssist; +import com.mogo.eagle.core.data.config.CloudPoiManager; +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; +import com.mogo.eagle.core.utilcode.util.NetworkUtils; +import com.mogo.realtime.api.MoGoAiCloudRealTime; + +import java.util.List; + + +public class MogoServices implements IMogoIntentListener { + + private MogoServices() { + } + + private static final class InstanceHolder { + private static final MogoServices INSTANCE = new MogoServices(); + } + + public static MogoServices getInstance() { + return InstanceHolder.INSTANCE; + } + + private static final String TAG = "MogoServices"; + + private IntentManager mIntentManager; + + private Context mContext; + + public void init(Context context) { + mContext = context; + MogoStatusManager.getInstance().setAIAssistReady(TAG, AIAssist.getInstance(mContext).hasFlush()); + CloudPoiManager.getInstance().updateFromConfig(context); + + registerMogoReceiver(context); + + mIntentManager = IntentManager.getInstance(); + mIntentManager.registerIntentListener(MogoReceiver.ACTION_VOICE_UI, this); + mIntentManager.registerIntentListener(MogoReceiver.ACTION_VOICE_READY, this); + mIntentManager.registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, this); + + Intent intent = new Intent("com.freedom.ser.ACTION"); + intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); + mContext.sendBroadcast(intent); + + if (DebugConfig.isNeedUploadCoordinatesDurationInTime()) { + MoGoAiCloudRealTime.startRealTime(mContext, DebugConfig.getSocketAppId()); + } + } + + private void registerMogoReceiver(Context context) { + if (context == null) { + return; + } + List modules = MogoModulePaths.getModules(); + if (modules.isEmpty()) { + return; + } + MogoReceiver receiver = new MogoReceiver(context); + IntentFilter filter = new IntentFilter(); + if (!modules.isEmpty()) { + for (MogoModule module : modules) { + if (TextUtils.isEmpty(module.getBroadcastAction())) { + continue; + } + filter.addAction(module.getBroadcastAction()); + } + } + filter.addAction(MogoReceiver.VOICE_ACTION); + // 小智语音 + filter.addAction(MogoReceiver.ACTION_VOICE_UI); + filter.addAction(MogoReceiver.ACTION_VOICE_READY); + filter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS); + filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); + try { + context.getApplicationContext().registerReceiver(receiver, filter); + } catch (Exception e) { + CallerLogger.INSTANCE.e(M_OLD_OTHER + TAG, "registerMogoReceiver error : " + e); + } + } + + @Override + public void onIntentReceived(String command, Intent intent) { + if (TextUtils.equals(command, ConnectivityManager.CONNECTIVITY_ACTION) + && NetworkUtils.isConnected(mContext)) { + mIntentManager.unregisterIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, this); + } + IntentHandlerFactory.getInstance().handle(mContext, command, intent); + } + + public void destroy() { + CallerLogger.INSTANCE.d(M_OLD_OTHER + TAG, "MogoServices do nothings."); + if (DebugConfig.isNeedUploadCoordinatesDurationInTime()) { + MoGoAiCloudRealTime.stopRealTime(); + } + } + +} diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/ServiceConst.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/ServiceConst.java similarity index 63% rename from modules/mogo-module-service/src/main/java/com/mogo/module/service/ServiceConst.java rename to foudations/mogo-commons/src/main/java/com/mogo/commons/module/ServiceConst.java index e5d25dd1d8..9a3ce9b413 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/ServiceConst.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/ServiceConst.java @@ -1,4 +1,4 @@ -package com.mogo.module.service; +package com.mogo.commons.module; /** * @author congtaowang @@ -13,24 +13,20 @@ public class ServiceConst { */ public static final String TYPE = "STRATEGY_REFRESH"; - /** - * 刷新策略模块地址 - */ - public static final String PATH_REFRESH_STRATEGY = "/strategy/refresh"; /** * 卡片 用户数据 */ public static final String CARD_TYPE_USER_DATA = "CARD_TYPE_USER_DATA"; + /** + * 卡片 探路数据 + */ + public static final String CARD_TYPE_ROAD_CONDITION = "CARD_TYPE_ROAD_CONDITION"; + /** * 卡片 新鲜事 */ public static final String CARD_TYPE_NOVELTY = "CARD_TYPE_NOVELTY"; - - public static final int ONLINE_SEARCH_LIMIT = 20; - public static final int ONLINE_SEARCH_RADIUS = 2_000; - - } diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/AIAssistIntentHandler.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/intent/AIAssistIntentHandler.java similarity index 71% rename from modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/AIAssistIntentHandler.java rename to foudations/mogo-commons/src/main/java/com/mogo/commons/module/intent/AIAssistIntentHandler.java index 67d928a0c1..a01f8bcf1e 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/AIAssistIntentHandler.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/intent/AIAssistIntentHandler.java @@ -1,10 +1,10 @@ -package com.mogo.module.service.intent; +package com.mogo.commons.module.intent; import android.content.Context; import android.content.Intent; +import com.mogo.commons.module.status.MogoStatusManager; import com.mogo.commons.voice.AIAssist; -import com.mogo.module.service.MarkerServiceHandler; /** @@ -20,6 +20,6 @@ public class AIAssistIntentHandler implements IntentHandler { @Override public void handle( Context context, Intent intent ) { AIAssist.getInstance( context ).flush(); - MarkerServiceHandler.getMogoStatusManager().setAIAssistReady( TAG, true ); + MogoStatusManager.getInstance().setAIAssistReady( TAG, true ); } } diff --git a/foudations/mogo-commons/src/main/java/com/mogo/commons/module/intent/AccStatusIntentHandler.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/intent/AccStatusIntentHandler.java new file mode 100644 index 0000000000..baa219f0a9 --- /dev/null +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/intent/AccStatusIntentHandler.java @@ -0,0 +1,52 @@ +package com.mogo.commons.module.intent; + +import android.content.Context; +import android.content.Intent; + +import com.mogo.commons.module.ServiceConst; +import com.mogo.commons.module.status.MogoStatusManager; +import com.mogo.commons.utils.CarSeries; + + +/** + * @author congtaowang + * @since 2020/6/5 + * + * 描述 + */ +public class AccStatusIntentHandler implements IntentHandler { + + private static volatile AccStatusIntentHandler sInstance; + + private AccStatusIntentHandler() { + } + + public static AccStatusIntentHandler getInstance() { + if ( sInstance == null ) { + synchronized ( AccStatusIntentHandler.class ) { + if ( sInstance == null ) { + sInstance = new AccStatusIntentHandler(); + } + } + } + return sInstance; + } + + public synchronized void release() { + sInstance = null; + } + + @Override + public void handle( Context context, Intent intent ) { + String action = intent.getAction(); + if ( Intent.ACTION_POWER_CONNECTED.equals( action ) ) { + if ( CarSeries.isF8xxSeries() ) { + MogoStatusManager.getInstance().setAccStatus( ServiceConst.TYPE, true ); + } + } else if ( Intent.ACTION_POWER_DISCONNECTED.equals( action ) ) { + if ( CarSeries.isF8xxSeries() ) { + MogoStatusManager.getInstance().setAccStatus( ServiceConst.TYPE, false ); + } + } + } +} diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/EmptyIntentHandler.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/intent/EmptyIntentHandler.java similarity index 89% rename from modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/EmptyIntentHandler.java rename to foudations/mogo-commons/src/main/java/com/mogo/commons/module/intent/EmptyIntentHandler.java index 822017c54d..1597138519 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/EmptyIntentHandler.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/intent/EmptyIntentHandler.java @@ -1,4 +1,4 @@ -package com.mogo.module.service.intent; +package com.mogo.commons.module.intent; import android.content.Context; import android.content.Intent; diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/intent/IMogoIntentListener.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/intent/IMogoIntentListener.java similarity index 88% rename from services/mogo-service-api/src/main/java/com/mogo/service/intent/IMogoIntentListener.java rename to foudations/mogo-commons/src/main/java/com/mogo/commons/module/intent/IMogoIntentListener.java index 0767fcb4ed..f1acacee26 100644 --- a/services/mogo-service-api/src/main/java/com/mogo/service/intent/IMogoIntentListener.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/intent/IMogoIntentListener.java @@ -1,4 +1,4 @@ -package com.mogo.service.intent; +package com.mogo.commons.module.intent; import android.content.Intent; diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/intent/IMogoIntentManager.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/intent/IMogoIntentManager.java similarity index 94% rename from services/mogo-service-api/src/main/java/com/mogo/service/intent/IMogoIntentManager.java rename to foudations/mogo-commons/src/main/java/com/mogo/commons/module/intent/IMogoIntentManager.java index 9976066fef..510ca5ca32 100644 --- a/services/mogo-service-api/src/main/java/com/mogo/service/intent/IMogoIntentManager.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/intent/IMogoIntentManager.java @@ -1,4 +1,4 @@ -package com.mogo.service.intent; +package com.mogo.commons.module.intent; import android.content.Intent; diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/IntentHandler.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/intent/IntentHandler.java similarity index 84% rename from modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/IntentHandler.java rename to foudations/mogo-commons/src/main/java/com/mogo/commons/module/intent/IntentHandler.java index cf040875d5..526d235685 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/IntentHandler.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/intent/IntentHandler.java @@ -1,4 +1,4 @@ -package com.mogo.module.service.intent; +package com.mogo.commons.module.intent; import android.content.Context; import android.content.Intent; diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/IntentHandlerFactory.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/intent/IntentHandlerFactory.java similarity index 76% rename from modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/IntentHandlerFactory.java rename to foudations/mogo-commons/src/main/java/com/mogo/commons/module/intent/IntentHandlerFactory.java index d7d7f9102d..93ccf07129 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/IntentHandlerFactory.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/intent/IntentHandlerFactory.java @@ -1,10 +1,10 @@ -package com.mogo.module.service.intent; +package com.mogo.commons.module.intent; import android.content.Context; import android.content.Intent; -import com.mogo.module.service.receiver.AccStatusReceiver; -import com.mogo.module.service.receiver.MogoReceiver; + +import com.mogo.commons.module.receiver.MogoReceiver; import java.util.HashMap; import java.util.Map; @@ -19,11 +19,9 @@ public class IntentHandlerFactory { private IntentHandlerFactory() { // private constructor - mHandlers.put( MogoReceiver.ACTION_MOCK, new MockIntentHandler() ); mHandlers.put( MogoReceiver.ACTION_VOICE_UI, new VoiceUiIntentHandler() ); mHandlers.put( Intent.ACTION_POWER_CONNECTED, AccStatusIntentHandler.getInstance() ); mHandlers.put( Intent.ACTION_POWER_DISCONNECTED, AccStatusIntentHandler.getInstance() ); - mHandlers.put( AccStatusReceiver.ACTION_NWD_ACC, AccStatusIntentHandler.getInstance() ); mHandlers.put( MogoReceiver.ACTION_VOICE_READY, new AIAssistIntentHandler() ); } @@ -40,9 +38,9 @@ public class IntentHandlerFactory { return InstanceHolder.INSTANCE; } - private Map< String, IntentHandler > mHandlers = new HashMap<>(); + private final Map< String, IntentHandler > mHandlers = new HashMap<>(); - private IntentHandler DEFAULT = new EmptyIntentHandler(); + private final IntentHandler DEFAULT = new EmptyIntentHandler(); private IntentHandler getIntentHandler( String intent ) { if ( mHandlers.containsKey( intent ) && mHandlers.get( intent ) != null ) { diff --git a/services/mogo-service/src/main/java/com/mogo/service/impl/intent/IntentManager.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/intent/IntentManager.java similarity index 82% rename from services/mogo-service/src/main/java/com/mogo/service/impl/intent/IntentManager.java rename to foudations/mogo-commons/src/main/java/com/mogo/commons/module/intent/IntentManager.java index db2d0c4332..497990d942 100644 --- a/services/mogo-service/src/main/java/com/mogo/service/impl/intent/IntentManager.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/intent/IntentManager.java @@ -1,19 +1,9 @@ -package com.mogo.service.impl.intent; +package com.mogo.commons.module.intent; import android.content.Context; import android.content.Intent; -import android.os.Handler; -import android.os.Looper; -import android.os.Message; -import androidx.annotation.NonNull; - -import com.mogo.service.intent.IMogoIntentListener; -import com.mogo.service.intent.IMogoIntentManager; - -import java.util.ArrayList; import java.util.Iterator; -import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CopyOnWriteArrayList; @@ -24,16 +14,17 @@ import java.util.concurrent.CopyOnWriteArrayList; *

* 描述 */ -public class IntentManager implements IMogoIntentManager { +public class IntentManager implements IMogoIntentManager{ private static volatile IntentManager sInstance; + private static final byte[] obj = new byte[0]; private IntentManager() { } public static IntentManager getInstance() { if ( sInstance == null ) { - synchronized ( IntentManager.class ) { + synchronized ( obj ) { if ( sInstance == null ) { sInstance = new IntentManager(); } diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/VoiceUiIntentHandler.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/intent/VoiceUiIntentHandler.java similarity index 51% rename from modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/VoiceUiIntentHandler.java rename to foudations/mogo-commons/src/main/java/com/mogo/commons/module/intent/VoiceUiIntentHandler.java index f8aea1e8b7..7021e5915d 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/VoiceUiIntentHandler.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/intent/VoiceUiIntentHandler.java @@ -1,20 +1,14 @@ -package com.mogo.module.service.intent; +package com.mogo.commons.module.intent; import android.content.Context; import android.content.Intent; import android.text.TextUtils; -import com.mogo.module.service.MarkerServiceHandler; -import com.mogo.module.service.receiver.MogoReceiver; +import com.mogo.commons.module.status.MogoStatusManager; +import com.mogo.commons.module.receiver.MogoReceiver; -public -/** - * @author congtaowang - * @since 2020/6/5 - * - * 描述 - */ -class VoiceUiIntentHandler implements IntentHandler { + +public class VoiceUiIntentHandler implements IntentHandler { private static final String TAG = "VoiceUiIntentHandler"; @@ -22,9 +16,9 @@ class VoiceUiIntentHandler implements IntentHandler { public void handle( Context context, Intent intent ) { String val = intent.getStringExtra( MogoReceiver.PARRAM_WAKE_STATUS ); if ( TextUtils.equals( val, MogoReceiver.VALUE_DISMISS ) ) { - MarkerServiceHandler.getMogoStatusManager().setVoiceUIShow( TAG, false ); + MogoStatusManager.getInstance().setVoiceUIShow( TAG, false ); } else if ( TextUtils.equals( val, MogoReceiver.VALUE_SHOW ) ) { - MarkerServiceHandler.getMogoStatusManager().setVoiceUIShow( TAG, true ); + MogoStatusManager.getInstance().setVoiceUIShow( TAG, true ); } } } diff --git a/foudations/mogo-commons/src/main/java/com/mogo/commons/module/receiver/AccStatusReceiver.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/receiver/AccStatusReceiver.java new file mode 100644 index 0000000000..ba12e69d9c --- /dev/null +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/receiver/AccStatusReceiver.java @@ -0,0 +1,16 @@ +package com.mogo.commons.module.receiver; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; + +import com.mogo.commons.module.intent.IntentHandlerFactory; + + +public class AccStatusReceiver extends BroadcastReceiver { + + @Override + public void onReceive( Context context, Intent intent ) { + IntentHandlerFactory.getInstance().handle( context, intent.getAction(), intent ); + } +} diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/receiver/MogoReceiver.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/receiver/MogoReceiver.java similarity index 80% rename from modules/mogo-module-service/src/main/java/com/mogo/module/service/receiver/MogoReceiver.java rename to foudations/mogo-commons/src/main/java/com/mogo/commons/module/receiver/MogoReceiver.java index 8cec63deca..96670ceb43 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/receiver/MogoReceiver.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/receiver/MogoReceiver.java @@ -1,12 +1,12 @@ -package com.mogo.module.service.receiver; +package com.mogo.commons.module.receiver; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.text.TextUtils; -import com.mogo.module.service.MarkerServiceHandler; -import com.mogo.service.intent.IMogoIntentManager; +import com.mogo.commons.module.intent.IntentManager; + /** * @author congtaowang @@ -33,12 +33,10 @@ public class MogoReceiver extends BroadcastReceiver { */ public static final String ACTION_VOICE_READY = "com.zhidao.auto.AIAssist.ready"; - public static final String ACTION_MOCK = "com.mogo.mock"; - - private final IMogoIntentManager mMogoIntentManager; + private final IntentManager mMogoIntentManager; public MogoReceiver(Context context) { - mMogoIntentManager = MarkerServiceHandler.getIntentManager(); + mMogoIntentManager = IntentManager.getInstance(); } @Override diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/statusmanager/IMogoStatusChangedListener.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/status/IMogoStatusChangedListener.java similarity index 71% rename from services/mogo-service-api/src/main/java/com/mogo/service/statusmanager/IMogoStatusChangedListener.java rename to foudations/mogo-commons/src/main/java/com/mogo/commons/module/status/IMogoStatusChangedListener.java index f2cab0e570..168041de85 100644 --- a/services/mogo-service-api/src/main/java/com/mogo/service/statusmanager/IMogoStatusChangedListener.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/status/IMogoStatusChangedListener.java @@ -1,4 +1,4 @@ -package com.mogo.service.statusmanager; +package com.mogo.commons.module.status; /** * @author congtaowang @@ -12,6 +12,6 @@ public interface IMogoStatusChangedListener { * @param descriptor 状态类型 * @param isTrue true - accOn、adas ui show、voice ui show、push ui show、v2x ui show */ - void onStatusChanged( StatusDescriptor descriptor, boolean isTrue ); + void onStatusChanged(StatusDescriptor descriptor, boolean isTrue ); } diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/statusmanager/IMogoStatusManager.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/status/IMogoStatusManager.java similarity index 95% rename from services/mogo-service-api/src/main/java/com/mogo/service/statusmanager/IMogoStatusManager.java rename to foudations/mogo-commons/src/main/java/com/mogo/commons/module/status/IMogoStatusManager.java index aaa92d81eb..5db99e5f23 100644 --- a/services/mogo-service-api/src/main/java/com/mogo/service/statusmanager/IMogoStatusManager.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/status/IMogoStatusManager.java @@ -1,4 +1,4 @@ -package com.mogo.service.statusmanager; +package com.mogo.commons.module.status; import com.alibaba.android.arouter.facade.template.IProvider; @@ -137,7 +137,7 @@ public interface IMogoStatusManager extends IProvider { * @param descriptor 监听类型 * @param listener 监听回调 */ - void registerStatusChangedListener( String tag, StatusDescriptor descriptor, IMogoStatusChangedListener listener ); + void registerStatusChangedListener(String tag, StatusDescriptor descriptor, IMogoStatusChangedListener listener ); /** * 注销 diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/statusmanager/IMogoStickyStatusChangedListener.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/status/IMogoStickyStatusChangedListener.java similarity index 90% rename from services/mogo-service-api/src/main/java/com/mogo/service/statusmanager/IMogoStickyStatusChangedListener.java rename to foudations/mogo-commons/src/main/java/com/mogo/commons/module/status/IMogoStickyStatusChangedListener.java index 60a79be75f..0a7c420a98 100644 --- a/services/mogo-service-api/src/main/java/com/mogo/service/statusmanager/IMogoStickyStatusChangedListener.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/status/IMogoStickyStatusChangedListener.java @@ -1,4 +1,4 @@ -package com.mogo.service.statusmanager; +package com.mogo.commons.module.status; /** * @author congtaowang diff --git a/foudations/mogo-commons/src/main/java/com/mogo/commons/module/status/MogoStatusManager.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/status/MogoStatusManager.java new file mode 100644 index 0000000000..078bdb09a3 --- /dev/null +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/status/MogoStatusManager.java @@ -0,0 +1,187 @@ +package com.mogo.commons.module.status; + + +import android.content.Context; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author congtaowang + * @since 2020-01-02 + *

+ * 状态控制器 + */ +public class MogoStatusManager implements IMogoStatusManager { + + private static volatile MogoStatusManager sInstance; + private static final byte[] obj = new byte[0]; + + private MogoStatusManager() { + } + + public static MogoStatusManager getInstance() { + if (sInstance == null) { + synchronized (obj) { + if (sInstance == null) { + sInstance = new MogoStatusManager(); + } + } + } + return sInstance; + } + + /** + * 状态记录 + */ + private static final Map mStatus = new ConcurrentHashMap<>(); + + /** + * 回调集合 + */ + private static final Map> mListeners = new ConcurrentHashMap<>(); + + /** + * 状态类型修改记录 + */ + private static final Map mModifier = new ConcurrentHashMap<>(); + + @Override + public boolean isVoiceShow() { + return get_bool_val(StatusDescriptor.VOICE_UI); + } + + @Override + public boolean isVrMode() { + return get_bool_val(StatusDescriptor.VR_MODE); + } + + @Override + public boolean isV2XShow() { + return get_bool_val(StatusDescriptor.V2X_UI); + } + + @Override + public boolean isAccOn() { + return get_bool_val(StatusDescriptor.ACC_STATUS); + } + + @Override + public boolean isMainPageOnResume() { + return get_bool_val(StatusDescriptor.MAIN_PAGE_RESUME); + } + + @Override + public boolean isMainPageIsBackground() { + return get_bool_val(StatusDescriptor.MAIN_PAGE_IS_BACKGROUND); + } + + @Override + public boolean isMainPageLaunched() { + return get_bool_val(StatusDescriptor.MAIN_PAGE_CREATED); + } + + private boolean get_bool_val(StatusDescriptor descriptor) { + Boolean val = mStatus.get(descriptor); + return val != null && val; + } + + @Override + public void setVrMode(String tag, boolean vrMode) { + doSetStatus(tag, StatusDescriptor.VR_MODE, vrMode); + } + + @Override + public void setVoiceUIShow(String tag, boolean show) { + doSetStatus(tag, StatusDescriptor.VOICE_UI, show); + } + + @Override + public void setV2XUIShow(String tag, boolean show) { + doSetStatus(tag, StatusDescriptor.V2X_UI, show); + } + + @Override + public void setAccStatus(String tag, boolean isOn) { + doSetStatus(tag, StatusDescriptor.ACC_STATUS, isOn); + } + + @Override + public void setMainPageResumeStatus(String tag, boolean resume) { + doSetStatus(tag, StatusDescriptor.MAIN_PAGE_RESUME, resume); + } + + @Override + public void setMainPageIsBackgroundStatus(String tag, boolean isBackground) { + doSetStatus(tag, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, isBackground); + } + + @Override + public void setAIAssistReady(String tag, boolean ready) { + doSetStatus(tag, StatusDescriptor.AI_ASSIST_READY, ready); + } + + @Override + public void setSeekHelping(String tag, boolean seekHelping) { + doSetStatus(tag, StatusDescriptor.SEEK_HELPING, seekHelping); + } + + @Override + public void setMainPageLaunchedStatus(String tag, boolean launched) { + doSetStatus(tag, StatusDescriptor.MAIN_PAGE_CREATED, launched); + } + + private void doSetStatus(String tag, StatusDescriptor target, boolean value) { + mStatus.put(target, value); + invokeStatusChangedListener(target, value); + recordStatusModifier(tag, target); + } + + private void invokeStatusChangedListener(StatusDescriptor descriptor, boolean status) { + List listenerList = mListeners.get(descriptor); + if (listenerList != null && listenerList.size() > 0) { + IMogoStatusChangedListener[] listeners = new IMogoStatusChangedListener[listenerList.size()]; + listenerList.toArray(listeners); + for (IMogoStatusChangedListener listener : listeners) { + if (listener != null) { + listener.onStatusChanged(descriptor, status); + } + } + } + } + + private void recordStatusModifier(String tag, StatusDescriptor descriptor) { + mModifier.put(descriptor, tag); + } + + @Override + public void registerStatusChangedListener(String tag, StatusDescriptor descriptor, IMogoStatusChangedListener listener) { + if (listener == null || descriptor == null) { + return; + } + if (!mListeners.containsKey(descriptor)) { + mListeners.put(descriptor, new ArrayList<>()); + } + mListeners.get(descriptor).add(listener); + + if (listener instanceof IMogoStickyStatusChangedListener && ((IMogoStickyStatusChangedListener) listener).requestStickyStatus(descriptor)) { + Boolean val = mStatus.get(descriptor); + if (val != null) { + listener.onStatusChanged(descriptor, get_bool_val(descriptor)); + } + } + } + + @Override + public void unregisterStatusChangedListener(String tag, StatusDescriptor descriptor, IMogoStatusChangedListener listener) { + if (mListeners.get(descriptor) != null) { + mListeners.get(descriptor).remove(listener); + } + } + + @Override + public void init(Context context) { + } +} diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/statusmanager/StatusDescriptor.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/status/StatusDescriptor.java similarity index 94% rename from services/mogo-service-api/src/main/java/com/mogo/service/statusmanager/StatusDescriptor.java rename to foudations/mogo-commons/src/main/java/com/mogo/commons/module/status/StatusDescriptor.java index 93f010345d..3a7de76c96 100644 --- a/services/mogo-service-api/src/main/java/com/mogo/service/statusmanager/StatusDescriptor.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/status/StatusDescriptor.java @@ -1,4 +1,4 @@ -package com.mogo.service.statusmanager; +package com.mogo.commons.module.status; /** * @author congtaowang diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/utils/CarSeries.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/utils/CarSeries.java similarity index 99% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/utils/CarSeries.java rename to foudations/mogo-commons/src/main/java/com/mogo/commons/utils/CarSeries.java index 90e1e2122c..2b32ca441e 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/utils/CarSeries.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/utils/CarSeries.java @@ -1,4 +1,4 @@ -package com.mogo.module.common.utils; +package com.mogo.commons.utils; import android.text.TextUtils; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/utils/DrivingDirectionUtils.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/utils/DrivingDirectionUtils.java similarity index 99% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/utils/DrivingDirectionUtils.java rename to foudations/mogo-commons/src/main/java/com/mogo/commons/utils/DrivingDirectionUtils.java index bf5d562033..8db25de638 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/utils/DrivingDirectionUtils.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/utils/DrivingDirectionUtils.java @@ -1,4 +1,4 @@ -package com.mogo.module.common.utils; +package com.mogo.commons.utils; import static java.lang.Math.PI; diff --git a/foudations/mogo-commons/src/main/java/com/mogo/commons/utils/MortonCode.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/utils/MortonCode.java deleted file mode 100644 index 14e771b73a..0000000000 --- a/foudations/mogo-commons/src/main/java/com/mogo/commons/utils/MortonCode.java +++ /dev/null @@ -1,149 +0,0 @@ -package com.mogo.commons.utils; - -import java.text.DecimalFormat; - -/** - * 莫顿编码 - * - * @author linyang - * @since 2020.07.09 - */ -public class MortonCode { - - /** - * morton 转 经纬度 时的中间常量 - */ - private static final long NDS_180_DEGREES = 0x7fffffff; - - /** - * morton 转 经纬度 时的中间常量 - */ - private static final long NDS_360_DEGREES = 4294967295L; - - /** - * morton 转 经纬度 时的中间常量 - */ - private static final long NDS_90_DEGREES = 0x3fffffff; - - /** - * 经纬度转 morton 时的中间常量 - */ - private static final double RULE_MORTON = Math.pow( 2, 32 ) / 360; - - /** - * morton 转 经纬度 时的中间常量 - */ - private static final double RULE_MORTON_TO_LONLAT = 360.0 / Math.pow( 2, 32 ); - - /** - * @param lon - * @param lat - * @return - */ - public static long wrapEncodeMorton( Double lon, Double lat ) { - DecimalFormat decimalFormat = new DecimalFormat( "#.######" ); - return encodeMorton( Double.valueOf( decimalFormat.format( lon ) ), - Double.valueOf( decimalFormat.format( lat ) ) ); - } - - /** - * 编码 morton code - * - * @param lon - * @param lat - * @return - */ - public static long encodeMorton( Double lon, Double lat ) { - - Long bit = 1L; - long mortonCode = 0L; - long x = ( long ) ( lon * RULE_MORTON ); - long y = ( long ) ( lat * RULE_MORTON ); - - if ( y < 0 ) { - y += 0x7FFFFFFF; - } - y = y << 1; - for ( int i = 0; i < 32; i++ ) { - // x-part - mortonCode = mortonCode | ( x & bit ); - x = x << 1; - bit = bit << 1; - // y-part - mortonCode = mortonCode | ( y & bit ); - y = y << 1; - bit = bit << 1; - } - - return mortonCode; - } - - /** - * 将莫顿码解码为坐标 - * - * @param mortonCode - * @return - */ - public static double[] decodeMorton( long mortonCode ) { - long[] midPoint = mortonCodeToCoord( mortonCode ); - normalizeCoord( midPoint ); - double[] point = new double[2]; - - // 将经纬度长整数转化为 浮点类型 - point[0] = midPoint[0] * RULE_MORTON_TO_LONLAT; - point[1] = midPoint[1] * RULE_MORTON_TO_LONLAT; - return point; - } - - /** - * 莫顿码分别拆解为 编码后的经纬度长整数 - * - * @param mortonCode - * @return - */ - private static long[] mortonCodeToCoord( long mortonCode ) { - long bit = 1L; - long[] longPoint = new long[2]; - - for ( int i = 0; i < 32; i++ ) { - longPoint[0] |= mortonCode & bit; - mortonCode >>= 1; - longPoint[1] |= mortonCode & bit; - bit <<= 1; - } - return longPoint; - } - - /** - * 对编码后的经纬度长整数进行解码 - * - * @param midPoint - */ - private static void normalizeCoord( long[] midPoint ) { - // if x > 180 degrees, then subtract 360 degrees - if ( midPoint[0] > NDS_180_DEGREES ) { - midPoint[0] -= - NDS_360_DEGREES + 1; // add 1 because 0 must be counted as well - } else if ( midPoint[0] < -NDS_180_DEGREES ) // if x < 180 , x += 360 - { - midPoint[0] += - NDS_360_DEGREES + 1; // add 1 because 0 must be counted as well - } - - // if y > 90 degrees, then subtract 180 degrees - if ( midPoint[1] > NDS_90_DEGREES ) { - midPoint[1] -= - NDS_180_DEGREES + 1; // add 1 because 0 must be counted as well - } else if ( midPoint[1] < -NDS_90_DEGREES ) // if y < 90, y += 180 - { - midPoint[1] += - NDS_180_DEGREES + 1; // add 1 because 0 must be counted as well - } - return; - } - - - public static void main( String[] args ) { - System.out.println( encodeMorton( 116.39584, 39.98152 ) ); - } -} diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/utils/Trigonometric.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/utils/Trigonometric.java similarity index 97% rename from modules/mogo-module-common/src/main/java/com/mogo/module/common/utils/Trigonometric.java rename to foudations/mogo-commons/src/main/java/com/mogo/commons/utils/Trigonometric.java index c7d6be65d5..42a0ef16b5 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/utils/Trigonometric.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/utils/Trigonometric.java @@ -1,4 +1,4 @@ -package com.mogo.module.common.utils; +package com.mogo.commons.utils; import com.mogo.eagle.core.data.map.MogoLatLng; diff --git a/foudations/mogo-commons/src/main/java/com/mogo/commons/utils/ViewPagerSpeedScroller.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/utils/ViewPagerSpeedScroller.java deleted file mode 100644 index 2cf240da9a..0000000000 --- a/foudations/mogo-commons/src/main/java/com/mogo/commons/utils/ViewPagerSpeedScroller.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.mogo.commons.utils; - -import android.content.Context; -import android.view.animation.DecelerateInterpolator; -import android.view.animation.Interpolator; -import android.widget.Scroller; - -import java.lang.reflect.Field; - -public -/** - * @author congtaowang - * @since 2020/10/19 - * - * 描述 - */ -class ViewPagerSpeedScroller extends Scroller { - - private int mFixedDuration = 1500; - - public ViewPagerSpeedScroller( Context context ) { - super( context ); - } - - public ViewPagerSpeedScroller( Context context, Interpolator interpolator ) { - super( context, interpolator ); - } - - public ViewPagerSpeedScroller( Context context, Interpolator interpolator, boolean flywheel ) { - super( context, interpolator, flywheel ); - } - - @Override - public void startScroll( int startX, int startY, int dx, int dy ) { - startScroll( startX, startY, dx, dy, mFixedDuration ); - } - - @Override - public void startScroll( int startX, int startY, int dx, int dy, int duration ) { - super.startScroll( startX, startY, dx, dy, mFixedDuration ); - } - - public void setFixedDuration( int duration ) { - this.mFixedDuration = duration; - } - - public static void attach( Context context, Object pager, int duration ) { - try { - Field filed = pager.getClass().getDeclaredField( "mScroller" ); - filed.setAccessible( true ); - ViewPagerSpeedScroller scroller = new ViewPagerSpeedScroller( context, new DecelerateInterpolator() ); - scroller.setFixedDuration( duration ); - filed.set( pager, scroller ); - - Field field = pager.getClass().getDeclaredField( "mTouchSlop" ); - field.setAccessible( true ); - field.setInt( pager, 4 ); - } catch ( Exception e ) { - e.printStackTrace(); - } - - } -} diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/IMogoMarkerManager.java b/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/IMogoMarkerManager.java index 27472b1430..626bfd6b4f 100644 --- a/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/IMogoMarkerManager.java +++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/IMogoMarkerManager.java @@ -3,7 +3,6 @@ package com.mogo.map.marker; import android.content.Context; import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.eagle.core.data.traffic.TrafficData; import java.util.ArrayList; import java.util.HashMap; @@ -27,7 +26,7 @@ public interface IMogoMarkerManager { * @param options * @return */ - IMogoMarker addMarker( String tag, MogoMarkerOptions options ); + IMogoMarker addMarker(String tag, MogoMarkerOptions options); /** * 添加多个marker @@ -36,20 +35,22 @@ public interface IMogoMarkerManager { * @param options * @return */ - List< IMogoMarker > addMarkers( String tag, ArrayList< MogoMarkerOptions > options, boolean moveToCenter ); + List addMarkers(String tag, ArrayList options, boolean moveToCenter); /** * 批量更新锚点位置 + * * @param optionsArrayList 锚点集合 */ - void updateBatchMarkerPosition(HashMap optionsArrayList); + void updateBatchMarkerPosition(HashMap optionsArrayList); /** * 添加感知使用到的3d模型 + * * @param type * @param modelRes */ - String addPreVehicleModel(int type,int modelRes); + String addPreVehicleModel(int type, int modelRes); /** * 要移除的感知数据uuid @@ -63,7 +64,7 @@ public interface IMogoMarkerManager { * * @param tag */ - void removeMarkers( String tag ); + void removeMarkers(String tag); /** * 移除地图上添加的所有markers @@ -82,9 +83,10 @@ public interface IMogoMarkerManager { /** * 隐藏除了某些类别的所有marker {@link MogoMarkerOptions Owner} + * * @param owner */ - void inVisibleWithoutMarkers(String ...owner); //todo 后续需要把Owner类别统一起来,基类下沉,此接口为临时方案,应该设计为隐藏某一类元素 + void inVisibleWithoutMarkers(String... owner); //todo 后续需要把Owner类别统一起来,基类下沉,此接口为临时方案,应该设计为隐藏某一类元素 /** * 获取某种类型的全部marker。 @@ -92,21 +94,21 @@ public interface IMogoMarkerManager { * @param tag 业务类型 * @return */ - List< IMogoMarker > getMarkers( String tag ); + List getMarkers(String tag); /** * 获取所有类型的marker。 * * @return */ - Map< String, List< IMogoMarker > > getAllMarkers( ); + Map> getAllMarkers(); /** * 仅保留指定类型的tag * * @param tag 需要保留的类型 */ - void removeMarkersExcept( String tag ); + void removeMarkersExcept(String tag); /** * 添加搜索路线 @@ -116,7 +118,7 @@ public interface IMogoMarkerManager { * @param endPoint 终点 * @param wayPoints 途经点 */ - void addRouteWay( Context context, MogoLatLng startPoint, MogoLatLng endPoint, List< MogoLatLng > wayPoints ); + void addRouteWay(Context context, MogoLatLng startPoint, MogoLatLng endPoint, List wayPoints); /** * 移除添加的导航预测路线 diff --git a/modules.txt b/modules.txt index cb16026052..b952d62967 100644 --- a/modules.txt +++ b/modules.txt @@ -21,7 +21,6 @@ :test:crashreport-noop :test:crashreport-upgrade :core:function-impl:mogo-core-function-obu-mogo -:modules:mogo-module-service :core:function-impl:mogo-core-function-check :services:mogo-service :core:function-impl:mogo-core-function-autopilot diff --git a/modules/mogo-module-common/README.md b/modules/mogo-module-common/README.md deleted file mode 100644 index 1552f28128..0000000000 --- a/modules/mogo-module-common/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# 基础框架 - -## 基于 WindowManger.addView 方式实现的弹窗 - -## 大而全数据定义 - -## 地图中心点控制策略 - -## 自研车机类型判断 - -## 模块加载类 \ No newline at end of file diff --git a/modules/mogo-module-common/build.gradle b/modules/mogo-module-common/build.gradle index a590a395cd..6406ea586a 100644 --- a/modules/mogo-module-common/build.gradle +++ b/modules/mogo-module-common/build.gradle @@ -16,7 +16,6 @@ android { versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION") testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles 'consumer-rules.pro' //ARouter apt 参数 kapt { @@ -30,7 +29,6 @@ android { buildTypes { release { minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } @@ -51,10 +49,6 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation rootProject.ext.dependencies.kotlinstdlibjdk7 - implementation rootProject.ext.dependencies.androidxccorektx - implementation rootProject.ext.dependencies.androidxappcompat - implementation rootProject.ext.dependencies.androidxrecyclerview - implementation rootProject.ext.dependencies.androidxconstraintlayout implementation rootProject.ext.dependencies.arouter kapt rootProject.ext.dependencies.aroutercompiler @@ -89,4 +83,3 @@ dependencies { } -apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString() diff --git a/modules/mogo-module-common/consumer-rules.pro b/modules/mogo-module-common/consumer-rules.pro deleted file mode 100644 index 4b4c8f6b97..0000000000 --- a/modules/mogo-module-common/consumer-rules.pro +++ /dev/null @@ -1,10 +0,0 @@ -#-----CommonModule----- --keep class com.mogo.module.common.machinevision.*{*;} --keep class com.mogo.module.common.constants.*{*;} --keep class com.mogo.module.common.drawer.marker.*{*;} --keep class com.mogo.module.common.entity.*{*;} --keep class com.mogo.module.common.view.*{*;} --keep class com.mogo.module.common.widget.*{*;} --keep class com.mogo.module.common.wm.* {*;} --keep class com.mogo.module.common.MogoModulePaths{*;} --keep class com.mogo.hook.*{*;} \ No newline at end of file diff --git a/modules/mogo-module-common/proguard-rules.pro b/modules/mogo-module-common/proguard-rules.pro deleted file mode 100644 index 7c855f7ca0..0000000000 --- a/modules/mogo-module-common/proguard-rules.pro +++ /dev/null @@ -1,26 +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 - -#-----CommonModule----- --keep class com.mogo.module.common.entity.** {*;} --keep class com.mogo.module.common.wm.** {*;} --keep class com.mogo.module.common.MogoModulePaths diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/ModuleNames.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/ModuleNames.java deleted file mode 100644 index 15a9789a7d..0000000000 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/ModuleNames.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.mogo.module.common; - -/** - * @author congtaowang - * @since 2020-03-13 - *

- * 各个卡片模块类型 - */ -public class ModuleNames { - /** - * 卡片 探路数据 - */ - public static final String CARD_TYPE_ROAD_CONDITION = "CARD_TYPE_ROAD_CONDITION"; - - /** - * 卡片 用户数据 - */ - public static final String CARD_TYPE_USER_DATA = "CARD_TYPE_USER_DATA"; -} diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/animation/Animation.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/animation/Animation.java deleted file mode 100644 index 3c0981fe05..0000000000 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/animation/Animation.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.mogo.module.common.animation; - -interface Animation { - - void start(); - - void stop(); - -} diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/animation/AnimationManager.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/animation/AnimationManager.java deleted file mode 100644 index b0732a7d97..0000000000 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/animation/AnimationManager.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.mogo.module.common.animation; - -import android.os.Handler; -import android.os.Looper; -import android.os.Message; -import android.view.View; -import android.widget.ProgressBar; - -public class AnimationManager implements Animation { - - private static final String TAG = "V2XAnimationManager"; - private ProgressBar targetImageView; - private boolean isStarted = false; - - private int mStartIndex = 0; - - private final static int MSG_LOOP = 3004; - private long INTERVAL = 100L; - - private Handler mHandler = new Handler(Looper.getMainLooper()) { - @Override - public void handleMessage(Message msg) { - super.handleMessage(msg); - switch (msg.what) { - case MSG_LOOP: - if (isStarted) { -// targetImageView.setImageResource( AnimationResources.loadingRes[mStartIndex++ % AnimationResources.loadingRes.length] ); - mHandler.sendEmptyMessageDelayed(MSG_LOOP, INTERVAL); - } - break; - } - } - }; - - public void animationWithTarget(ProgressBar imageView, int[] resources, int duration) { - targetImageView = imageView; - INTERVAL = duration; - start(); - - } - - @Override - synchronized public void start() { - isStarted = true; - mHandler.sendEmptyMessage(MSG_LOOP); - if (targetImageView != null) { - targetImageView.setVisibility(View.VISIBLE); - } - } - - @Override - synchronized public void stop() { - isStarted = false; - mHandler.removeMessages(MSG_LOOP); - if (targetImageView != null) { - targetImageView.setVisibility(View.INVISIBLE); - } - } - - public void soptWithError() { - stop(); - if (targetImageView != null) { - targetImageView.setVisibility(View.VISIBLE); - } - } - - public void release() { - stop(); - } -} diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/animation/AnimationResources.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/animation/AnimationResources.java deleted file mode 100644 index 8919d777e6..0000000000 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/animation/AnimationResources.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.mogo.module.common.animation; - - -import com.mogo.module.common.R; - -public class AnimationResources { - public static final int loadingRes[] = { -// R.drawable.v_to_x_loading_car0000, -// R.drawable.v_to_x_loading_car0002, -// R.drawable.v_to_x_loading_car0004, -// R.drawable.v_to_x_loading_car0006, -// R.drawable.v_to_x_loading_car0008, -// R.drawable.v_to_x_loading_car0010, -// R.drawable.v_to_x_loading_car0012, -// R.drawable.v_to_x_loading_car0014, -// R.drawable.v_to_x_loading_car0016, -// R.drawable.v_to_x_loading_car0018, -// R.drawable.v_to_x_loading_car0020, -// R.drawable.v_to_x_loading_car0022, -// R.drawable.v_to_x_loading_car0024, -// R.drawable.v_to_x_loading_car0025, -// R.drawable.v_to_x_loading_car0027, -// R.drawable.v_to_x_loading_car0029, -// R.drawable.v_to_x_loading_car0031, -// R.drawable.v_to_x_loading_car0033, -// R.drawable.v_to_x_loading_car0035, -// R.drawable.v_to_x_loading_car0037, -// R.drawable.v_to_x_loading_car0039, -// R.drawable.v_to_x_loading_car0041, -// R.drawable.v_to_x_loading_car0043, -// R.drawable.v_to_x_loading_car0045, -// R.drawable.v_to_x_loading_car0047, -// R.drawable.v_to_x_loading_car0048, - }; - -} diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/animation/BezierEvaluator.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/animation/BezierEvaluator.java deleted file mode 100644 index b7be514fa9..0000000000 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/animation/BezierEvaluator.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.mogo.module.common.animation; - -import android.animation.TypeEvaluator; -import android.graphics.PointF; - -/** - * 贝塞尔曲线估值器:计算动画的执行轨迹 - * - * @params 传入贝塞尔曲线需要的四个点 - * @return 通过计算返回贝塞尔曲线的坐标 - */ -public class BezierEvaluator implements TypeEvaluator { - - private PointF point1; - private PointF point2; - - public BezierEvaluator(PointF point1, PointF point2) { - this.point1 = point1; - this.point2 = point2; - } - - @Override - public PointF evaluate(float t, PointF point0, PointF point3) { - PointF point = new PointF(); - //t 取值为 [0,1] - - /** - * 三阶贝塞尔公式 - * - * B(t)=(1 - t)^3 P0 - * + 3 t (1 - t)^2 P1 - * + 3 t^2 (1 - t) P2 - * + t^3 P3 - */ - point.x = point0.x * (1 - t) * (1 - t) * (1 - t) - + 3 * point1.x * t * (1 - t) * (1 - t) - + 3 * point2.x * t * t * (1 - t) - + point3.x * t * t * t; - - /** - * 三阶贝塞尔公式 - * - * B(t)=(1 - t)^3 P0 - * + 3 t (1 - t)^2 P1 - * + 3 t^2 (1 - t) P2 - * + t^3 P3 - */ - point.y = point0.y * (1 - t) * (1 - t) * (1 - t) - + 3 * point1.y * t * (1 - t) * (1 - t) - + 3 * point2.y * t * t * (1 - t) - + point3.y * t * t * t; - - return point; - } -} \ No newline at end of file diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/animation/BezierListener.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/animation/BezierListener.java deleted file mode 100644 index 04ab1129c2..0000000000 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/animation/BezierListener.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.mogo.module.common.animation; - -import android.animation.ValueAnimator; -import android.graphics.PointF; -import android.view.View; - -public class BezierListener implements ValueAnimator.AnimatorUpdateListener { - - private View target; - - public BezierListener(View target) { - this.target = target; - } - - @Override - public void onAnimationUpdate(ValueAnimator animation) { - //这里获取到贝塞尔曲线计算出来的的x y值 赋值给view 这样就能让爱心随着曲线走啦 - PointF pointF = (PointF) animation.getAnimatedValue(); - target.setX(pointF.x); - target.setY(pointF.y); - // 这里偷个懒,顺便做一个alpha动画,这样alpha渐变也完成啦 - target.setAlpha(1 - animation.getAnimatedFraction()); - } -} \ No newline at end of file diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/BaseDrawer.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/BaseDrawer.java deleted file mode 100644 index f9bfce7e26..0000000000 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/BaseDrawer.java +++ /dev/null @@ -1,232 +0,0 @@ -package com.mogo.module.common.drawer; - -import static com.mogo.cloud.socket.entity.SocketDownDataHelper.FROM_ADAS; - -import android.content.Context; -import android.text.TextUtils; - -import com.mogo.commons.AbsMogoApplication; -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; -import com.mogo.map.marker.IMogoMarker; -import com.mogo.module.common.R; -import com.mogo.module.common.constants.AdasRecognizedType; - -import java.util.Collection; -import java.util.Iterator; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -/** - * @author congtaowang - * @since 2020/10/30 - *

- * 描述 - */ -public class BaseDrawer { - - /** - * 移除过期的 marker - */ - public static final int MSG_REMOVE_DIRTY_MARKERS = 9990; - - /** - * 地图内部资源md5缓存,便于资源复用 - */ - protected static final ConcurrentHashMap mMarkerCachesResMd5Values = new ConcurrentHashMap<>(); - - protected final Context mContext; - - public BaseDrawer() { - mContext = AbsMogoApplication.getApp(); - } - - /** - * 清除无效[为 null 或者 已被销毁]的 marker - */ - protected void removeUselessMarker(Map mMarkersCaches) { - if (mMarkersCaches == null || mMarkersCaches.isEmpty()) { - return; - } - Iterator iterator = mMarkersCaches.values().iterator(); - while (iterator.hasNext()) { - IMogoMarker marker = iterator.next(); - if (marker != null) { - iterator.remove(); - marker.remove(); - marker.destroy(); - } - } - } - - /** - * 发送消息 - * - * @param msg 消息类型 - * @param data 数据体 - */ - public void sendMessage(int msg, Object data) { - - } - - /** - * 判断是否是绘制内容 - * - * @param type {@link AdasRecognizedType} - * @return render - */ - public boolean nonRenderType(int type) { - AdasRecognizedType recognizedType = AdasRecognizedType.valueFrom(type); - return recognizedType != AdasRecognizedType.classIdCar - && recognizedType != AdasRecognizedType.classIdMoto - && recognizedType != AdasRecognizedType.classIdBicycle - && recognizedType != AdasRecognizedType.classIdPerson - && recognizedType != AdasRecognizedType.classIdTrafficBus - && recognizedType != AdasRecognizedType.classIdTrafficTruck - && recognizedType != AdasRecognizedType.classIdUnKnow; - } - - /** - * 获取3D锚点模型资源 - * - * @param type {@link AdasRecognizedType} - * @return modelRes - */ - public int getModelRes(int type) { - AdasRecognizedType recognizedType = AdasRecognizedType.valueFrom(type); - if (recognizedType == AdasRecognizedType.classIdCar) { - return R.raw.traffic_tachexiaoche; - } else if (recognizedType == AdasRecognizedType.classIdTrafficBus) { - return R.raw.traffic_daba; - } else if (recognizedType == AdasRecognizedType.classIdMoto) { - return R.raw.traffic_motuoche; - } else if (recognizedType == AdasRecognizedType.classIdStopLine) { - return R.raw.stopline; - } else if (recognizedType == AdasRecognizedType.classIdWarningArrows) { - return R.raw.jiantou; - } else if (recognizedType == AdasRecognizedType.classIdUnKnow) { - return R.raw.special_vehicle; - } else if (recognizedType == AdasRecognizedType.classIdBicycle) { - return R.raw.traffic_zixingche; - } else if (recognizedType == AdasRecognizedType.classIdTrafficTruck) { - return R.raw.traffic_daba; - } else if (recognizedType == AdasRecognizedType.classIdPerson) { - return R.raw.traffic_people; - } - return R.raw.special_vehicle; - } - - /** - * 根据数据源判断车辆预警颜色 - * - * @param type 车辆类型 - * @param fromType 数据来源 - * @param drawLevel 危险等级 - * @return 实际车辆颜色 - */ - protected String getModelRenderColor(int type, int fromType, int drawLevel) { - AdasRecognizedType recognizedType = AdasRecognizedType.valueFrom(type); - if (recognizedType == AdasRecognizedType.classIdUnKnow) { - return Car3DModelColor.Normal.color; - } - if (fromType == FROM_ADAS) { - switch (drawLevel) { - case 0: - case 1: - return Car3DModelColor.Normal.color; - case 2: - return Car3DModelColor.Warming.color; - case 3: - return Car3DModelColor.Dangerous.color; - default: - return Car3DModelColor.Error.color; - } - } - return Car3DModelColor.Normal.color; - } - - /** - * 返回当前自车经纬度 - * - * @return 0:lon 1:lat - */ - protected double[] getCurCoordinates() { - return new double[]{ - CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon(), - CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat() - }; - } - - /** - * 模型颜色 - */ - public enum Car3DModelColor { - Normal("#D8D8D8FF"), - Warming("#FFD53EFF"), - Dangerous("#FF3C45FF"), - Error("#7fb80e"); - private final String color; - - Car3DModelColor(String color) { - this.color = color; - } - } - - /** - * 移除markers - * - * @param dirtyMarkers 缓存marker数据 - */ - protected static void removeDirtyMarkers(Map dirtyMarkers) { - if (dirtyMarkers == null || dirtyMarkers.isEmpty()) { - return; - } - final Collection dirSet = dirtyMarkers.values(); - for (IMogoMarker value : dirSet) { - if (value == null || value.isDestroyed()) { - continue; - } - try { - value.destroy(); - } catch (Exception e) { - e.printStackTrace(); - } - } - dirtyMarkers.clear(); - } - - /** - * 缓存绘制 marker 的 id 和 marker 资源缓存的 md5 的关系 - * - * @param id 缓存资源ID - * @param marker {@link IMogoMarker} - */ - protected static void cacheMarkerIconResMd5Val(String id, IMogoMarker marker) { - if (marker == null || marker.isDestroyed()) { - return; - } - String md5 = marker.getMarkerResName(); - if (TextUtils.isEmpty(md5) || TextUtils.isEmpty(id)) { - return; - } - mMarkerCachesResMd5Values.put(id, md5); - } - - /** - * 使用系统时间或卫星时间计算出动画的运动时间,最小值45,防止两个点距离过近设置的最小动画执行时间 - * - * @param lastSatelliteTime 上一个点SNTP时间,精确值 - * @param curSatelliteTime 当前点SNTP时间,精确值 - * @return 动画运动时间 - */ - public long computeAnimDuration(long lastSatelliteTime, long curSatelliteTime) { - if (lastSatelliteTime == 0 || curSatelliteTime == 0) { - return 45; - } - long interval = curSatelliteTime - lastSatelliteTime; - if (interval < 45) { - interval = 45; - } - return interval; - } - -} diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerAdapter.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerAdapter.java deleted file mode 100644 index 9316277041..0000000000 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerAdapter.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.mogo.module.common.drawer.marker; - -import android.content.Context; -import android.text.TextUtils; - -import com.mogo.map.marker.MogoMarkerOptions; -import com.mogo.module.common.ModuleNames; -import com.mogo.module.common.MogoApisHandler; -import com.mogo.module.common.entity.MarkerShowEntity; - -/** - * author : donghongyu - * e-mail : 1358506549@qq.com - * date : 2020-01-1015:55 - * desc : 地图Marker的适配器 - * version: 1.0 - */ -public class MapMarkerAdapter { - - /** - * 获取 MarkerShowEntity 填充好的 MarkerView - * - * @param context 上下文 - * @param markerShowEntity 要填充的数据 - * @return MarkerView - */ - public static IMarkerView getMarkerView( Context context, MarkerShowEntity markerShowEntity, MogoMarkerOptions options ) { - - if ( TextUtils.equals( markerShowEntity.getMarkerType(), ModuleNames.CARD_TYPE_USER_DATA ) ) { - return OnlineCarMarkerView.getInstance(); - } else { - if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) { - return new EmptyMarkerView( context ); - } else { - if ( markerShowEntity.isChecked() ) { - return new MapMarkerInfoView( context, markerShowEntity, options ); - } else { - return new MapMarkerView( context, markerShowEntity, options ); - } - } - } - - } - -} diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerInfoView.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerInfoView.java deleted file mode 100644 index 508ff1e2ad..0000000000 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerInfoView.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.mogo.module.common.drawer.marker; - -import android.content.Context; -import android.text.TextUtils; -import android.util.AttributeSet; -import android.view.LayoutInflater; -import android.view.View; -import android.widget.ImageView; -import android.widget.LinearLayout; -import android.widget.TextView; - -import androidx.annotation.Nullable; - -import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; -import com.mogo.map.marker.MogoMarkerOptions; -import com.mogo.module.common.ModuleNames; -import com.mogo.module.common.MogoApisHandler; -import com.mogo.module.common.R; -import com.mogo.module.common.entity.MarkerExploreWay; -import com.mogo.module.common.entity.MarkerShowEntity; -import com.mogo.module.common.marker.PoiWrapper; -import com.mogo.module.common.utils.CloudPoiManager; - -/** - * author : donghongyu - * e-mail : 1358506549@qq.com - * date : 2020-01-0619:55 - * desc : 地图Marker图标带文本信息 - * version: 1.0 - */ -public class MapMarkerInfoView extends MapMarkerBaseView { - private String TAG = "MapMarkerInfoView"; - - private TextView tvMarkerContent; - private LinearLayout clMarkerContent; - private ImageView ivReverseTriangle; - - public MapMarkerInfoView(Context context) { - super(context); - } - - public MapMarkerInfoView(Context context, @Nullable AttributeSet attrs) { - super(context, attrs); - } - - public MapMarkerInfoView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { - super(context, attrs, defStyleAttr); - } - - public MapMarkerInfoView(Context context, MarkerShowEntity markerShowEntity, MogoMarkerOptions options) { - super(context); - mOptions = options; - try { - updateView(markerShowEntity); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - protected void initView(Context context) { - LayoutInflater.from(context).inflate(R.layout.modudle_services_marker_layout_info, this); - ivUserHead = findViewById(R.id.ivUserHead); -// ivIcon = findViewById( R.id.ivIcon ); - ivIcon = findViewById(R.id.ivIcon); - clMarkerContent = findViewById(R.id.clMarkerContent); - ivReverseTriangle = findViewById(R.id.ivReverseTriangle); - ivCar = findViewById(R.id.ivCar); - tvMarkerContent = findViewById(R.id.tvMarkerContent); - } - - @Override - public void updateView(MarkerShowEntity markerShowEntity) { - - Object bindObj = markerShowEntity.getBindObj(); - - if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) { - ivCar.setImageResource(R.drawable.icon_map_marker_location_yellow_vr); - } else { - ivCar.setImageResource(R.drawable.icon_map_marker_location_yellow); - } - clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_yellow_info); - ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_yellow); - switch (markerShowEntity.getMarkerType()) { - case ModuleNames.CARD_TYPE_USER_DATA: - ivUserHead.setVisibility(View.VISIBLE); - ivIcon.setVisibility(View.INVISIBLE); - loadImageWithMarker(markerShowEntity); - ivCar.setImageResource(R.drawable.icon_map_marker_car_gray); - //ivCar.setRotation(new Random().nextInt(360)); - ivCar.setRotation((float) markerShowEntity.getMarkerLocation().getAngle()); - break; - case ModuleNames.CARD_TYPE_ROAD_CONDITION: - ivUserHead.setVisibility(View.INVISIBLE); - ivIcon.setVisibility(View.VISIBLE); - - if (bindObj instanceof MarkerExploreWay && ((MarkerExploreWay) bindObj).getPoiType() != null) { - // 根据poiType获取对应的图片 - String poiType = ((MarkerExploreWay) bindObj).getPoiType(); - PoiWrapper poiWrapper = - CloudPoiManager.getInstance().getWrapperByPoiType(poiType); - if (poiWrapper != null) { - // 加载图片 - loadPoiTypeIcon(poiWrapper.getIconInfoUrl(), poiWrapper.getIconInfoRes()); - } else { - CallerLogger.INSTANCE.e(TAG, "未能根据poiType获取对应poi信息,无法渲染info marker====" + poiType); - } - } - break; - default: - break; - } - if (!TextUtils.isEmpty(markerShowEntity.getTextContent())) { - String content; - if (markerShowEntity.getTextContent().length() > 8) { - content = markerShowEntity.getTextContent().substring(0, 7) + "..."; - } else { - content = markerShowEntity.getTextContent(); - } - tvMarkerContent.setText(content); - } - - } - -} diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/view/CustomRatingBar.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/view/CustomRatingBar.java deleted file mode 100644 index b38917966c..0000000000 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/view/CustomRatingBar.java +++ /dev/null @@ -1,310 +0,0 @@ -package com.mogo.module.common.view; - -import android.content.Context; -import android.content.res.TypedArray; -import android.graphics.drawable.Drawable; -import android.util.AttributeSet; -import android.view.View; -import android.widget.ImageView; -import android.widget.LinearLayout; - -import androidx.annotation.Nullable; -import androidx.core.content.ContextCompat; - -import com.mogo.module.common.R; - -import java.math.BigDecimal; - -public class CustomRatingBar extends LinearLayout { - private Context mContext; - /* - 是否可点击 - * */ - private boolean mClickable; - /* - * 单元总数(心形/星星) - * */ - private int elementCount; - /* - * 单元点击事件 - * */ - private OnRatingChangeListener mOnRatingBarChangeListener; - /* - * 每个单元的大小 - * */ - private float elementWidth; - - private float elementHeight; - - public float getElementWidth() { - return elementWidth; - } - - public void setElementWidth(float elementWidth) { - this.elementWidth = elementWidth; - } - - public float getElementHeight() { - return elementHeight; - } - - public void setElementHeight(float elementHeight) { - this.elementHeight = elementHeight; - } - - /* - * 每个单元间的距离 - * */ - private float elementPadding; - /* - *单元的显示数量,支持小数点 - * */ - private float elementStep; - /* - * 空白的默认单元图片 - * */ - private Drawable elementEmptyDrawable; - /* - * 选中后的单元图片 - * */ - private Drawable elementFillDrawable; - /* - * 半颗单元图片 - * */ - private Drawable elementHarfDrawable; - /* - * 每次点击单元所增加的量是半个还是整个 - * */ - private StepSize stepSize; - - /* - *添加资源(空白心是白色还是灰色自定义属性) - * */ - private boolean otherHeartImg; - - @Override - public boolean isClickable() { - return mClickable; - } - - @Override - public void setClickable(boolean clickable) { - mClickable = clickable; - } - - public int getElementCount() { - return elementCount; - } - - public void setElementCount(int elementCount) { - this.elementCount = elementCount; - } - - public OnRatingChangeListener getOnRatingBarChangeListener() { - return mOnRatingBarChangeListener; - } - - public void setOnRatingChangeListener(OnRatingChangeListener onRatingBarChangeListener) { - mOnRatingBarChangeListener = onRatingBarChangeListener; - } - - public float getElementPadding() { - return elementPadding; - } - - public void setElementPadding(float elementPadding) { - this.elementPadding = elementPadding; - } - - public float getElementStep() { - return elementStep; - } - - public void setElementStep(float elementStep) { - this.elementStep = elementStep; - } - - public Drawable getElementEmptyDrawable() { - return elementEmptyDrawable; - } - - public void setElementEmptyDrawable(Drawable elementEmptyDrawable) { - this.elementEmptyDrawable = elementEmptyDrawable; - } - - public Drawable getElementFillDrawable() { - return elementFillDrawable; - } - - public void setElementFillDrawable(Drawable elementFillDrawable) { - this.elementFillDrawable = elementFillDrawable; - } - - public Drawable getElementHarfDrawable() { - return elementHarfDrawable; - } - - public void setElementHarfDrawable(Drawable elementHarfDrawable) { - this.elementHarfDrawable = elementHarfDrawable; - } - - - public void setStepSize(StepSize stepSize) { - this.stepSize = stepSize; - } - - public CustomRatingBar(Context context, @Nullable AttributeSet attrs) { - super(context, attrs); - mContext = context; - setOrientation(LinearLayout.HORIZONTAL); - TypedArray mTypedArray = context.obtainStyledAttributes(attrs, R.styleable.CustomRatingBar); - elementWidth = mTypedArray.getDimension(R.styleable.CustomRatingBar_elenmentWidth, - context.getResources().getDimension(R.dimen.heart_ratingbar_width)); - elementHeight = mTypedArray.getDimension(R.styleable.CustomRatingBar_elenmentHeight, - context.getResources().getDimension(R.dimen.heart_ratingbar_height)); - elementPadding = mTypedArray.getDimension(R.styleable.CustomRatingBar_elenmentPadding, - context.getResources().getDimension(R.dimen.ratingbar_padding)); - /* - * 白天模式下 热心指数(白色)和个人中心(灰色)使用不同的资源 - * 默认灰色 - * */ - otherHeartImg = mTypedArray.getBoolean(R.styleable.CustomRatingBar_OtherHeartImg, true); - - elementStep = mTypedArray.getFloat(R.styleable.CustomRatingBar_elenmentStep, 1.0f); - stepSize = StepSize.fromStep(mTypedArray.getInt(R.styleable.CustomRatingBar_stepSize, 1)); - elementCount = mTypedArray.getInteger(R.styleable.CustomRatingBar_elenmentCount, 5); - stepSize = StepSize.Half; - - Drawable drawable_empty_default = ContextCompat.getDrawable(context, - otherHeartImg == false ? R.drawable.icon_heart_unchoose : R.drawable.icon_heart_unchoose_other); - Drawable drawable_half_default = ContextCompat.getDrawable(context, - otherHeartImg == false ? R.drawable.icon_heart_second : R.drawable.icon_heart_second_other); - Drawable drawable_fill_default = ContextCompat.getDrawable(context, R.drawable.icon_heart_choose); - - Drawable drawable_empty = mTypedArray.getDrawable(R.styleable.CustomRatingBar_elenmentEmpty); - Drawable drawable_half = mTypedArray.getDrawable(R.styleable.CustomRatingBar_elenmentHarf); - Drawable drawable_fill = mTypedArray.getDrawable(R.styleable.CustomRatingBar_elenmentFill); - - elementEmptyDrawable = drawable_empty != null ? drawable_empty : drawable_empty_default; - elementFillDrawable = drawable_half != null ? drawable_half : drawable_fill_default; - elementHarfDrawable = drawable_fill != null ? drawable_fill : drawable_half_default; - mClickable = mTypedArray.getBoolean(R.styleable.CustomRatingBar_clickable, false); - mTypedArray.recycle(); - for (int i = 0; i < elementCount; ++i) { - final ImageView imageView = getElenmentImageView(); - imageView.setImageDrawable(elementEmptyDrawable); - imageView.setOnClickListener( - new OnClickListener() { - @Override - public void onClick(View v) { - if (mClickable) { - //浮点数的整数部分 - int fint = (int) elementStep; - BigDecimal b1 = new BigDecimal(Float.toString(elementStep)); - BigDecimal b2 = new BigDecimal(Integer.toString(fint)); - //浮点数的小数部分 - float fPoint = b1.subtract(b2).floatValue(); - if (fPoint == 0) { - fint -= 1; - } - - if (indexOfChild(v) > fint) { - setRating(indexOfChild(v) + 1); - } else if (indexOfChild(v) == fint) { - if (stepSize == StepSize.Full) {//如果是满星 就不考虑半颗星了 - return; - } - //点击之后默认每次先增加一颗星,再次点击变为半颗星 - if (imageView.getDrawable().getCurrent().getConstantState(). - equals(elementHarfDrawable.getConstantState())) { - setRating(indexOfChild(v) + 1); - } else { - setRating(indexOfChild(v) + 0.5f); - } - } else { - setRating(indexOfChild(v) + 1f); - } - - } - } - } - ); - addView(imageView); - } - setRating(elementStep); - } - - private ImageView getElenmentImageView() { - ImageView imageView = new ImageView(getContext()); - LayoutParams layout = new LayoutParams( - Math.round(mContext.getResources().getDimension(R.dimen.heart_ratingbar_width)), - Math.round(mContext.getResources().getDimension(R.dimen.heart_ratingbar_width)));//设置每个单元格在线性布局的大小 - layout.setMargins(0, 0, Math.round(elementPadding), 0);//设置每颗星星在线性布局的间距 - imageView.setLayoutParams(layout); - imageView.setAdjustViewBounds(true); - imageView.setImageDrawable(elementEmptyDrawable); - imageView.setMinimumWidth((int) elementWidth); - imageView.setMaxWidth((int) elementWidth); - imageView.setMinimumHeight((int) elementHeight); - imageView.setMaxHeight((int) elementHeight); - return imageView; - } - - public void setRating(float rating) { - if (rating > elementCount) - rating = elementCount; - - if (mOnRatingBarChangeListener != null) { - mOnRatingBarChangeListener.onRatingChange(rating); - } - this.elementStep = rating; - //浮点数的整数部分 - int fint = (int) rating; - BigDecimal b1 = new BigDecimal(Float.toString(rating)); - BigDecimal b2 = new BigDecimal(Integer.toString(fint)); - //浮点数的小数部分 - float fPoint = b1.subtract(b2).floatValue(); - - //设置选中的单元 - for (int i = 0; i < fint; ++i) { - ((ImageView) getChildAt(i)).setImageDrawable(elementFillDrawable); - } - //设置没有选中的单元 - for (int i = fint; i < elementCount; i++) { - ((ImageView) getChildAt(i)).setImageDrawable(elementEmptyDrawable); - } - //小数点默认增加半个 - if (fPoint > 0) { - ((ImageView) getChildAt(fint)).setImageDrawable(elementHarfDrawable); - } - - - } - - public interface OnRatingChangeListener { - void onRatingChange(float ratingCount); - } - - /** - * 每次增加的方式整颗还是半颗,枚举类型 - * 类似于View.GONE - */ - public enum StepSize { - Half(0), Full(1); - int step; - - StepSize(int step) { - this.step = step; - } - - public static StepSize fromStep(int step) { - for (StepSize f : values()) { - if (f.step == step) { - return f; - } - } - throw new IllegalArgumentException(); - } - } - -} diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/view/NetworkLoadingView.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/view/NetworkLoadingView.java deleted file mode 100644 index 7a8fad2cf0..0000000000 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/view/NetworkLoadingView.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.mogo.module.common.view; - -import android.content.Context; -import android.util.AttributeSet; -import android.view.LayoutInflater; -import android.view.View; -import android.widget.Button; -import android.widget.ProgressBar; -import android.widget.RelativeLayout; -import android.widget.TextView; - -import androidx.annotation.Nullable; - -import com.mogo.module.common.R; -import com.mogo.module.common.animation.AnimationResources; -import com.mogo.module.common.animation.AnimationManager; - -public class NetworkLoadingView extends RelativeLayout { - - private ProgressBar loadView; - private TextView textView; - private AnimationManager mAnimationManager; - public Button refresButton; - private String loadingText = "正在获取信息…"; - - public NetworkLoadingView(Context context) { - - super(context); - } - - public NetworkLoadingView(Context context, @Nullable AttributeSet attrs) { - super(context, attrs); - LayoutInflater.from(context).inflate(R.layout.network_loading_item, this); - initView(); - /* - 添加动画图片资源 - * */ - setLoadingImage(AnimationResources.loadingRes); - } - - public NetworkLoadingView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { - super(context, attrs, defStyleAttr); - } - - public void initView() { - mAnimationManager = new AnimationManager(); - loadView = findViewById(R.id.loading_imageview); - textView = findViewById(R.id.loading_text); - refresButton = findViewById(R.id.refresh_button); - } - - public void setLoadingText(String text) { - if (textView != null) { - textView.setText(text); - } - } - - public void setLoadingImage(int[] resources) { - mAnimationManager.animationWithTarget(loadView, resources, 100); - } - - public void start() { - if (mAnimationManager != null) { - mAnimationManager.start(); - this.setVisibility(View.VISIBLE); - } - if (refresButton != null) { - refresButton.setVisibility(GONE); - } - if (textView != null) { - textView.setText(loadingText); - } - } - - public void stop() { - if (mAnimationManager != null) { - mAnimationManager.stop(); - this.setVisibility(GONE); - } - } - - public void stopWithError(String errormsg, int showRefreshButton) { - if (mAnimationManager != null) { - mAnimationManager.soptWithError(); - } - if (textView != null) { - textView.setText(errormsg); - } - if (refresButton != null) { - refresButton.setVisibility(showRefreshButton); - } - - } - - -} diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/icon_car_red.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/icon_car_red.png deleted file mode 100644 index 86df8de9b4..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-ldpi/icon_car_red.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/module_common_default_user_head.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/module_common_default_user_head.png deleted file mode 100644 index 726124020a..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-ldpi/module_common_default_user_head.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/module_common_my_location_bg.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/module_common_my_location_bg.png deleted file mode 100644 index 27036dbe7c..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-ldpi/module_common_my_location_bg.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/module_map_amap_my_location_icon.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/module_map_amap_my_location_icon.png deleted file mode 100644 index 7538da98b2..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-ldpi/module_map_amap_my_location_icon.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/module_services_marker_bkg.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/module_services_marker_bkg.png deleted file mode 100644 index 79d163824d..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-ldpi/module_services_marker_bkg.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_accident_small.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_accident_small.png deleted file mode 100644 index 815dc5b40c..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_accident_small.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_daolushigong_small.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_daolushigong_small.png deleted file mode 100644 index 33e7d8873e..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_daolushigong_small.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_fenglu_small.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_fenglu_small.png deleted file mode 100644 index 28f0db939b..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_fenglu_small.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_jiaotongjiancha_small.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_jiaotongjiancha_small.png deleted file mode 100644 index 0efac11676..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_jiaotongjiancha_small.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_jiebing_small.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_jiebing_small.png deleted file mode 100644 index 37ed59c3b4..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_jiebing_small.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_jishui_small.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_jishui_small.png deleted file mode 100644 index c93bd218fb..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_jishui_small.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_nongwu_small.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_nongwu_small.png deleted file mode 100644 index 698b84ffbc..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_nongwu_small.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_shishilukuang_small.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_shishilukuang_small.png deleted file mode 100644 index 632d1e5ad3..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_shishilukuang_small.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_yongdu_small.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_yongdu_small.png deleted file mode 100644 index bdba45d7e0..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-ldpi/mogo_image_yongdu_small.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_1.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_1.png deleted file mode 100644 index 174477c2fc..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_1.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_11.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_11.png deleted file mode 100644 index 8738be70b0..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_11.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_16.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_16.png deleted file mode 100644 index 214f478744..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_16.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_2.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_2.png deleted file mode 100644 index 1f4a2feed3..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_2.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_5.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_5.png deleted file mode 100644 index d639a60d25..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_5.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_6.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_6.png deleted file mode 100644 index 897581cb7c..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_6.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_7.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_7.png deleted file mode 100644 index 70494e5cdb..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_7.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_8.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_8.png deleted file mode 100644 index 1dc21e8b40..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_8.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_9.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_9.png deleted file mode 100644 index 5d34a4cb45..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_9.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_express.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_express.png deleted file mode 100644 index 6d29d53b7c..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_express.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_taxi.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_taxi.png deleted file mode 100644 index 06c554c25c..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_marker_taxi.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_warning_car_red.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_warning_car_red.png deleted file mode 100644 index 51038d26f4..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-ldpi/v_to_x_warning_car_red.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-mdpi/icon_default_user_head.png b/modules/mogo-module-common/src/main/res/drawable-mdpi/icon_default_user_head.png deleted file mode 100644 index a1349fc088..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-mdpi/icon_default_user_head.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-mdpi/module_common_default_user_head.png b/modules/mogo-module-common/src/main/res/drawable-mdpi/module_common_default_user_head.png deleted file mode 100644 index 726124020a..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-mdpi/module_common_default_user_head.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-mdpi/module_common_my_location_bg.png b/modules/mogo-module-common/src/main/res/drawable-mdpi/module_common_my_location_bg.png deleted file mode 100644 index 27036dbe7c..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-mdpi/module_common_my_location_bg.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-mdpi/module_map_amap_my_location_icon.png b/modules/mogo-module-common/src/main/res/drawable-mdpi/module_map_amap_my_location_icon.png deleted file mode 100644 index 7538da98b2..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-mdpi/module_map_amap_my_location_icon.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-mdpi/module_services_marker_bkg.png b/modules/mogo-module-common/src/main/res/drawable-mdpi/module_services_marker_bkg.png deleted file mode 100644 index 79d163824d..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-mdpi/module_services_marker_bkg.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_3.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_3.png deleted file mode 100644 index 94af8b123e..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_3.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_express.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_express.png deleted file mode 100644 index 7e260c5693..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_express.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_taxi.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_taxi.png deleted file mode 100644 index c8ce535e58..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_taxi.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/common_marker_bottom_floor.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/common_marker_bottom_floor.png deleted file mode 100644 index a46f85caff..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/common_marker_bottom_floor.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_car_red.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_car_red.png deleted file mode 100644 index df3b80e92c..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_car_red.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_heart_choose.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_heart_choose.png deleted file mode 100644 index 2c7b60f98d..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_heart_choose.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_heart_second.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_heart_second.png deleted file mode 100644 index 128d8259b6..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_heart_second.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_heart_second_other.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_heart_second_other.png deleted file mode 100644 index 1c49555541..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_heart_second_other.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_heart_unchoose.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_heart_unchoose.png deleted file mode 100644 index c5965e9414..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_heart_unchoose.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_heart_unchoose_other.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_heart_unchoose_other.png deleted file mode 100644 index 09ab4af9e3..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_heart_unchoose_other.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_car_gray_selected.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_car_gray_selected.png deleted file mode 100644 index 725a560b4f..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_car_gray_selected.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_car_type2.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_car_type2.png deleted file mode 100644 index 10221fcb01..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_car_type2.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_road_block_off.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_road_block_off.png deleted file mode 100644 index 8c6b30842b..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_road_block_off.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_road_block_up.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_road_block_up.png deleted file mode 100644 index 29fd407dca..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_map_marker_road_block_up.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_camera_real_time_traffic.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_camera_real_time_traffic.png deleted file mode 100644 index 2f7b45558c..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_camera_real_time_traffic.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_default_user_head.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_default_user_head.png deleted file mode 100644 index baa717be4d..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_default_user_head.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_ic_rc_parking2.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_ic_rc_parking2.png deleted file mode 100644 index 8026654bdf..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_ic_rc_parking2.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_4s.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_4s.png deleted file mode 100644 index 11c5c6ea7b..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_4s.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_refuel.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_refuel.png deleted file mode 100644 index bac7ee2e40..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_refuel.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_shear_news.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_shear_news.png deleted file mode 100644 index f446cba155..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_shear_news.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_shop.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_shop.png deleted file mode 100644 index d8be56fd47..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_shop.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_shop_discount.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_shop_discount.png deleted file mode 100644 index 97e8a4967b..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_icon_map_marker_shop_discount.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_my_location_bg.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_my_location_bg.png deleted file mode 100644 index b74dde69b2..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_common_my_location_bg.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_call.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_call.png deleted file mode 100644 index 9a9321b3a6..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_call.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_accident.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_accident.png deleted file mode 100644 index 8dd43b20a7..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_accident.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_accident2.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_accident2.png deleted file mode 100644 index 1e61298d35..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_accident2.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_accident3.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_accident3.png deleted file mode 100755 index fe68bc7cba..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_accident3.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_accident3_white.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_accident3_white.png deleted file mode 100755 index 911bee2df4..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_accident3_white.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_dark_frog.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_dark_frog.png deleted file mode 100644 index 61296d59d2..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_dark_frog.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_dark_frog2.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_dark_frog2.png deleted file mode 100755 index 787101fbb1..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_dark_frog2.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_dark_frog2_white.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_dark_frog2_white.png deleted file mode 100755 index b6164bcfdd..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_dark_frog2_white.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_freeze.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_freeze.png deleted file mode 100644 index ea07251424..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_freeze.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_freeze2.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_freeze2.png deleted file mode 100755 index d34779845e..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_freeze2.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_freeze2_white.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_freeze2_white.png deleted file mode 100755 index 353cfefec6..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_freeze2_white.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_illegal_park.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_illegal_park.png deleted file mode 100644 index 5923d114f6..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_illegal_park.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_illegal_park_white.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_illegal_park_white.png deleted file mode 100644 index dbc420e8e6..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_illegal_park_white.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_parking.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_parking.png deleted file mode 100644 index 33cb8fd3ce..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_parking.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_parking2.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_parking2.png deleted file mode 100644 index 8026654bdf..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_parking2.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_road_slippery.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_road_slippery.png deleted file mode 100644 index f11b4a4178..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_road_slippery.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_road_slippery_light.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_road_slippery_light.png deleted file mode 100644 index e78307acd8..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_rc_road_slippery_light.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_seek_helping.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_seek_helping.png deleted file mode 100755 index aa6eb75043..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_service_ic_seek_helping.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_accident_small.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_accident_small.png deleted file mode 100644 index afb24a513b..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_accident_small.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_daolushigong_nor.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_daolushigong_nor.png deleted file mode 100644 index 658a74c2e4..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_daolushigong_nor.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_daolushigong_small.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_daolushigong_small.png deleted file mode 100644 index 0a9bd75fb4..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_daolushigong_small.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_fenglu_nor.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_fenglu_nor.png deleted file mode 100644 index d8c73a8404..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_fenglu_nor.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_fenglu_small.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_fenglu_small.png deleted file mode 100644 index 9ec480e6ad..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_fenglu_small.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_jiaotongjiancha_nor.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_jiaotongjiancha_nor.png deleted file mode 100644 index 7a1c124871..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_jiaotongjiancha_nor.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_jiaotongjiancha_small.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_jiaotongjiancha_small.png deleted file mode 100644 index e466283c43..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_jiaotongjiancha_small.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_jiaotongshigu_nor.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_jiaotongshigu_nor.png deleted file mode 100644 index 06163dda3f..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_jiaotongshigu_nor.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_jiebing_nor.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_jiebing_nor.png deleted file mode 100644 index dcef2a496c..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_jiebing_nor.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_jiebing_small.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_jiebing_small.png deleted file mode 100644 index aad0a13730..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_jiebing_small.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_jishui_nor.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_jishui_nor.png deleted file mode 100644 index 23aaf88e60..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_jishui_nor.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_jishui_small.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_jishui_small.png deleted file mode 100644 index aeaf6b9b67..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_jishui_small.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_nongwu_nor.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_nongwu_nor.png deleted file mode 100644 index 3901854251..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_nongwu_nor.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_nongwu_small.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_nongwu_small.png deleted file mode 100644 index 412c1eafa5..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_nongwu_small.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_shishilukuang_small.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_shishilukuang_small.png deleted file mode 100644 index ae021bc829..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_shishilukuang_small.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_shishlukuang_nor.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_shishlukuang_nor.png deleted file mode 100644 index 0a255cbe93..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_shishlukuang_nor.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_yongdu_nor.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_yongdu_nor.png deleted file mode 100644 index c25514506f..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_yongdu_nor.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_yongdu_small.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_yongdu_small.png deleted file mode 100644 index 6f6083dc10..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/mogo_image_yongdu_small.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/selector_call_btn_normal.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/selector_call_btn_normal.png deleted file mode 100644 index c597a3f1d0..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/selector_call_btn_normal.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_event_ugc_fenglu.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_event_ugc_fenglu.png deleted file mode 100644 index b3328eba18..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_event_ugc_fenglu.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_event_ugc_shigu.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_event_ugc_shigu.png deleted file mode 100644 index 91f9827041..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_event_ugc_shigu.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_1.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_1.png deleted file mode 100644 index 8ac13e867f..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_1.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_11.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_11.png deleted file mode 100644 index 6c74ff6d78..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_11.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_16.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_16.png deleted file mode 100644 index 2a1ca48c62..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_16.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_2.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_2.png deleted file mode 100644 index e6f2ee2d5c..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_2.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_3.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_3.png deleted file mode 100644 index 94af8b123e..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_3.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_5.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_5.png deleted file mode 100644 index f9f29cbe61..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_5.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_6.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_6.png deleted file mode 100644 index 28c6860a3c..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_6.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_7.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_7.png deleted file mode 100644 index 72fbb4359f..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_7.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_8.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_8.png deleted file mode 100644 index 148086c831..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_8.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_9.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_9.png deleted file mode 100644 index 7ad3b4abb5..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_9.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_express.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_express.png deleted file mode 100644 index 7e260c5693..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_express.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_taxi.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_taxi.png deleted file mode 100644 index c8ce535e58..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_marker_taxi.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_warning_car_red.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_warning_car_red.png deleted file mode 100644 index ed1542ea36..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable-xhdpi/v_to_x_warning_car_red.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable/bg_v2x_cancel_help.xml b/modules/mogo-module-common/src/main/res/drawable/bg_v2x_cancel_help.xml deleted file mode 100644 index 8882692332..0000000000 --- a/modules/mogo-module-common/src/main/res/drawable/bg_v2x_cancel_help.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/modules/mogo-module-common/src/main/res/drawable/icon_heart_choose.png b/modules/mogo-module-common/src/main/res/drawable/icon_heart_choose.png deleted file mode 100644 index a2d1364f83..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable/icon_heart_choose.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable/icon_heart_second.png b/modules/mogo-module-common/src/main/res/drawable/icon_heart_second.png deleted file mode 100644 index eff1afe5a3..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable/icon_heart_second.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable/icon_heart_second_other.png b/modules/mogo-module-common/src/main/res/drawable/icon_heart_second_other.png deleted file mode 100644 index e26dbe8a7b..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable/icon_heart_second_other.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable/icon_heart_unchoose.png b/modules/mogo-module-common/src/main/res/drawable/icon_heart_unchoose.png deleted file mode 100644 index 919c363a9d..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable/icon_heart_unchoose.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable/icon_heart_unchoose_other.png b/modules/mogo-module-common/src/main/res/drawable/icon_heart_unchoose_other.png deleted file mode 100644 index c1dbeacc1d..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable/icon_heart_unchoose_other.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable/module_common_default_user_head.png b/modules/mogo-module-common/src/main/res/drawable/module_common_default_user_head.png deleted file mode 100644 index 726124020a..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable/module_common_default_user_head.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable/module_commons_heart_ratingbar_drawable.xml b/modules/mogo-module-common/src/main/res/drawable/module_commons_heart_ratingbar_drawable.xml deleted file mode 100644 index ee83cb56c4..0000000000 --- a/modules/mogo-module-common/src/main/res/drawable/module_commons_heart_ratingbar_drawable.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/modules/mogo-module-common/src/main/res/drawable/sr.png b/modules/mogo-module-common/src/main/res/drawable/sr.png deleted file mode 100644 index 2836c8de09..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable/sr.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/drawable/sy.png b/modules/mogo-module-common/src/main/res/drawable/sy.png deleted file mode 100644 index 6ce0a5dbbc..0000000000 Binary files a/modules/mogo-module-common/src/main/res/drawable/sy.png and /dev/null differ diff --git a/modules/mogo-module-common/src/main/res/layout/modudle_services_marker_layout_info.xml b/modules/mogo-module-common/src/main/res/layout/modudle_services_marker_layout_info.xml index 66e4ee91dc..e69de29bb2 100644 --- a/modules/mogo-module-common/src/main/res/layout/modudle_services_marker_layout_info.xml +++ b/modules/mogo-module-common/src/main/res/layout/modudle_services_marker_layout_info.xml @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/modules/mogo-module-common/src/main/res/layout/module_common_my_location.xml b/modules/mogo-module-common/src/main/res/layout/module_common_my_location.xml deleted file mode 100644 index 41f7e8c7d0..0000000000 --- a/modules/mogo-module-common/src/main/res/layout/module_common_my_location.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - \ No newline at end of file diff --git a/modules/mogo-module-common/src/main/res/layout/network_loading_item.xml b/modules/mogo-module-common/src/main/res/layout/network_loading_item.xml deleted file mode 100644 index e16c269062..0000000000 --- a/modules/mogo-module-common/src/main/res/layout/network_loading_item.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - -