diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/callback/RefreshBusStationsCallback.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/callback/RefreshBusStationsCallback.java index c6f1ba330b..bc59a7ba79 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/callback/RefreshBusStationsCallback.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/callback/RefreshBusStationsCallback.java @@ -9,5 +9,5 @@ import java.util.List; * @date: 2021/10/22 */ public interface RefreshBusStationsCallback { - void refreshBusStations(List stationList, int currentStation, int nextStation); + void refreshBusStations(List stationList, int currentStation, int nextStation,boolean isArrived); } diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/constant/OchBusConst.kt b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/constant/OchBusConst.kt index fa6eb17bba..a85ea7ae3f 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/constant/OchBusConst.kt +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/constant/OchBusConst.kt @@ -40,5 +40,10 @@ class OchBusConst { const val LOOP_PERIOD_60S = 60 * 1000L const val LOOP_PERIOD_1S = 1 * 1000L const val LOOP_DELAY = 100L + + //起点UUID + const val BUS_START_MAP_MAKER = "bus_start_map_maker"; + //终点UUID + const val BUS_END_MAP_MAKER = "bus_end_map_maker"; } } \ No newline at end of file diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/OchBusFragment.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/OchBusFragment.java index 632a5c02e3..d9315ac934 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/OchBusFragment.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/OchBusFragment.java @@ -1,18 +1,24 @@ package com.mogo.och.bus.fragment; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.util.Log; import android.view.View; import android.widget.TextView; import androidx.annotation.NonNull; +import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.debug.DebugConfig; import com.mogo.commons.voice.AIAssist; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; import com.mogo.eagle.core.utilcode.mogo.logger.Logger; import com.mogo.eagle.core.utilcode.mogo.toast.TipToast; +import com.mogo.map.marker.MogoMarkerOptions; import com.mogo.module.common.MogoApisHandler; import com.mogo.och.bus.R; import com.mogo.och.bus.bean.OchBusStation; +import com.mogo.och.bus.constant.OchBusConst; import com.mogo.och.bus.presenter.OchBusPresenter; import com.mogo.och.bus.view.SlidePanelView; @@ -63,24 +69,24 @@ public class OchBusFragment extends BaseOchBusTabFragment< OchBusFragment, OchBu return true; } ); - mCurrentStationName.setOnLongClickListener(new View.OnLongClickListener() { - @Override - public boolean onLongClick(View v) { - if (DebugConfig.isDebug()){ - if (mDebugArrive.getVisibility() == View.VISIBLE){ - mDebugArrive.setVisibility(View.GONE); - }else { - mDebugArrive.setVisibility(View.VISIBLE); - } - } - return false; - } - }); - - findViewById(R.id.module_och_bus_arrive_station).setOnClickListener(view ->{ //到站 - mPresenter.onAutopilotArriveAtStation(null); - }); } + mCurrentStationName.setOnLongClickListener(new View.OnLongClickListener() { + @Override + public boolean onLongClick(View v) { +// if (DebugConfig.isDebug()){ + if (mDebugArrive.getVisibility() == View.VISIBLE){ + mDebugArrive.setVisibility(View.GONE); + }else { + mDebugArrive.setVisibility(View.VISIBLE); + } +// } + return false; + } + }); + + findViewById(R.id.module_och_bus_arrive_station).setOnClickListener(view ->{ //到站 + mPresenter.onAutopilotArriveAtStation(null); + }); Logger.d( TAG, "initView: " + MogoApisHandler.getInstance().getApis().getAdasControllerApi().getAutopilotStatus() ); // 初始化的时候设置 UI 按钮状态 @@ -124,7 +130,7 @@ public class OchBusFragment extends BaseOchBusTabFragment< OchBusFragment, OchBu * @param currentStation 当前站点 * @param nextStation 下个站点 */ - public void refreshBusStations( List< OchBusStation > stationList, int currentStation, int nextStation ) { + public void refreshBusStations( List< OchBusStation > stationList, int currentStation, int nextStation ,boolean isArrived) { if ( getActivity() == null ) { return; } @@ -135,14 +141,15 @@ public class OchBusFragment extends BaseOchBusTabFragment< OchBusFragment, OchBu } // 渲染小巴路线数据 - renderCurrentStationStatus( stationList, currentStation, nextStation ); + renderCurrentStationStatus( stationList, currentStation, nextStation ,isArrived); } ); } /** * 重新刷新站点信息 */ - private void renderCurrentStationStatus( List< OchBusStation > stationList, int currentStation, int nextStation ) { + private void renderCurrentStationStatus( List< OchBusStation > stationList, int currentStation, int nextStation ,boolean isArrived) { + Log.d("MapMaker= ","currentStation="+currentStation+",nextStation="+nextStation+"isArrived="+isArrived); String currentStationName = null; String nextStationName = null; int startStationFlagVisibility = View.INVISIBLE; @@ -155,19 +162,35 @@ public class OchBusFragment extends BaseOchBusTabFragment< OchBusFragment, OchBu // 获取当前站点的名称 currentStationName = stationList.get( currentStation ).getName(); + OchBusStation startStation = stationList.get(0); + OchBusStation endStation = stationList.get(stationList.size() - 1); + // 是否到达起点 if ( currentStation == 0 ) { startStationFlagVisibility = View.VISIBLE; isArriveAtStartStation = true; mStartStationFlag.setText( "始" ); + Log.d("MapMaker= ","起点="); + setOrRemoveMapMaker(true, OchBusConst.BUS_START_MAP_MAKER,startStation.getLat(),startStation.getLon(),R.drawable.icon_station_start_end); + setOrRemoveMapMaker(true, OchBusConst.BUS_END_MAP_MAKER,endStation.getLat(),endStation.getLon(),R.drawable.icon_station_start_end); } else if ( currentStation > 0 && currentStation < stationList.size() - 1 ) {// 是否到达站点 + Log.d("MapMaker= ","中间="); isArriveAtStation = true; + setOrRemoveMapMaker(false, OchBusConst.BUS_START_MAP_MAKER,startStation.getLat(),startStation.getLon(),R.drawable.icon_station_start_end); + setOrRemoveMapMaker(true, OchBusConst.BUS_END_MAP_MAKER,endStation.getLat(),endStation.getLon(),R.drawable.icon_station_start_end); } else if ( currentStation == stationList.size() - 1 ) {// 是否到达终点 + Log.d("MapMaker= ","终点="); isArriveEndStation = true; nextStationName = "--"; mStartStationFlag.setText( "终" ); startStationFlagVisibility = View.VISIBLE; endStationFlagVisibility = View.INVISIBLE; + setOrRemoveMapMaker(false, OchBusConst.BUS_START_MAP_MAKER,startStation.getLat(),startStation.getLon(),R.drawable.icon_station_start_end); + if (isArrived){ + setOrRemoveMapMaker(false, OchBusConst.BUS_END_MAP_MAKER,endStation.getLat(),endStation.getLon(),R.drawable.icon_station_start_end); + }else { + setOrRemoveMapMaker(true, OchBusConst.BUS_END_MAP_MAKER,endStation.getLat(),endStation.getLon(),R.drawable.icon_station_start_end); + } } // 获取下一站点名称 @@ -195,7 +218,6 @@ public class OchBusFragment extends BaseOchBusTabFragment< OchBusFragment, OchBu mEndStationFlag.setVisibility( endStationFlagVisibility ); } - public void hideOchBus() { // tvNotice.setVisibility(View.GONE); } @@ -267,6 +289,29 @@ public class OchBusFragment extends BaseOchBusTabFragment< OchBusFragment, OchBu mRootView.setVisibility(isVRMode ? View.VISIBLE : View.GONE); } } + /** + * 绘制地图起点终点 + * @param isAdd + * @param uuid + * @param iconId + */ + private void setOrRemoveMapMaker(boolean isAdd, String uuid,double lat,double longi, int iconId){ + if (isAdd){ + Log.d("setMapMaker= ",uuid+"=latitude="+lat+",longitude="+longi); + MogoMarkerOptions options = new MogoMarkerOptions(); + options.anchorColor("#000000");//不设置报错,暂时随便设置个 + options.setGps(true);//使用wgs 必须设置true + options.scale(0.2f); + Bitmap bitmap = BitmapFactory.decodeResource(AbsMogoApplication.getApp().getResources(), iconId, null); + options.icon(bitmap); + options.latitude(lat); + options.longitude(longi); + MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(AbsMogoApplication.getApp()).addMarker(uuid, options); + }else { + Log.d("RemoveMapMaker=",uuid+"=latitude="+lat+",longitude="+longi); + MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(AbsMogoApplication.getApp()).removeMarkers(uuid); + } + } public void debugAutoPilotStatus(int status){ mPresenter.debugAutoPilotStatus(status); } diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusOrderModel.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusOrderModel.java index 25fa007add..bc510d0aad 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusOrderModel.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusOrderModel.java @@ -419,7 +419,7 @@ public class OchBusOrderModel { if (site != null && site.size() > 0){ backgroundCurrentStationIndex = currentStationIndex; if (refreshBusStationsCallback != null){ - refreshBusStationsCallback.refreshBusStations(stationList, currentStationIndex, getNextStopStation()); + refreshBusStationsCallback.refreshBusStations(stationList, currentStationIndex, getNextStopStation(),true); } } } @@ -561,8 +561,10 @@ public class OchBusOrderModel { if (refreshBusStationsCallback != null){ if (currentStation.isLeaving()){//如果服务端的当前站是leaving状态,展示当前站需要+1 currentStationIndex ++; + refreshBusStationsCallback.refreshBusStations(stationList, currentStationIndex, getNextStopStation(),false); + }else{ + refreshBusStationsCallback.refreshBusStations(stationList, currentStationIndex, getNextStopStation(),true); } - refreshBusStationsCallback.refreshBusStations(stationList, currentStationIndex, getNextStopStation()); } if ( currentStation.isLeaving() && slidePannelHideCallback != null) { slidePannelHideCallback.hideSlidePanel(); diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusPresenter.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusPresenter.java index dfe8d9b8c5..fc0868756a 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusPresenter.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusPresenter.java @@ -93,9 +93,9 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements CarO } @Override - public void refreshBusStations(List stationList, int currentStation, int nextStation) { + public void refreshBusStations(List stationList, int currentStation, int nextStation, boolean isArrived) { if ( mView != null ) { - mView.refreshBusStations( stationList, currentStation, nextStation ); + mView.refreshBusStations( stationList, currentStation, nextStation ,isArrived); } } diff --git a/OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/end_maker_icon.png b/OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/end_maker_icon.png new file mode 100755 index 0000000000..8acf113151 Binary files /dev/null and b/OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/end_maker_icon.png differ diff --git a/OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/icon_station_start_end.png b/OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/icon_station_start_end.png new file mode 100644 index 0000000000..04580a8f0d Binary files /dev/null and b/OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/icon_station_start_end.png differ diff --git a/OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/start_maker_icon.png b/OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/start_maker_icon.png new file mode 100644 index 0000000000..9eca61e199 Binary files /dev/null and b/OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/start_maker_icon.png differ diff --git a/OCH/mogo-och-bus/src/main/res/layout/bus_base_fragment.xml b/OCH/mogo-och-bus/src/main/res/layout/bus_base_fragment.xml index c5747f3c5a..537a3d2dc9 100644 --- a/OCH/mogo-och-bus/src/main/res/layout/bus_base_fragment.xml +++ b/OCH/mogo-och-bus/src/main/res/layout/bus_base_fragment.xml @@ -112,7 +112,7 @@ android:id="@+id/module_mogo_och_operation_status" android:layout_width="@dimen/module_mogo_och_operation_status_bg_width" android:layout_height="@dimen/module_mogo_och_operation_status_bg_height" - android:layout_marginLeft="@dimen/module_och_bus_order_status_stationInfo_paddingRight" + android:layout_marginLeft="@dimen/module_mogo_och_margin_left" android:background="@drawable/bus_operation_status_bg" android:elevation="@dimen/dp_10" android:gravity="center" @@ -128,7 +128,7 @@ android:id="@+id/module_mogo_och_setting_layout" android:layout_width="@dimen/module_mogo_och_operation_status_bg_width" android:layout_height="@dimen/module_mogo_och_operation_status_bg_height" - android:layout_marginLeft="20dp" + android:layout_marginLeft="@dimen/module_mogo_och_margin_left" android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom" android:background="@drawable/bus_operation_status_bg" android:elevation="@dimen/dp_10" diff --git a/OCH/mogo-och-bus/src/main/res/values-xhdpi-2560x1600/dimens.xml b/OCH/mogo-och-bus/src/main/res/values-xhdpi-2560x1600/dimens.xml new file mode 100644 index 0000000000..b4b6ec1da2 --- /dev/null +++ b/OCH/mogo-och-bus/src/main/res/values-xhdpi-2560x1600/dimens.xml @@ -0,0 +1,119 @@ + + + + 300px + 348px + 211px + 276px + + + 220px + 98px + 159px + + 32px + 20px + 42px + 32px + + 15px + + 20px + 36px + 28px + 36px + + 3px + 3px + 17px + 17px + + + 300px + 270px + 30px + 24px + 24px + 1px + 30px + 23px + 30px + 146px + 20px + 23px + 30px + 23px + 26px + 32px + 20px + 80px + 3px + 44.5px + 20px + 28px + 27px + + + 25.6px + 20px + 20px + 16px + 16px + + 40px + 40px + 46px + 24px + + 530px + 492px + + 20px + 20px + 70px + 130px + 93px + 150px + 70px + + 24px + 460px + 140px + + 112px + 112px + + 92px + + 30px + 466px + 414px + + + 36px + 13px + 12px + 350px + + 460px + 30px + + 110px + 40px + 320px + 20px + 40px + 320px + 460px + 70px + 460px + 130px + 30px + 276px + 112px + 22px + 36px + 50px + 60px + + \ No newline at end of file diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/constant/OCHTaxiConst.kt b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/constant/OCHTaxiConst.kt index 43d79286b2..4c96592023 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/constant/OCHTaxiConst.kt +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/constant/OCHTaxiConst.kt @@ -39,5 +39,10 @@ class OCHTaxiConst { // 订单信息 const val SP_KEY_OCH_TAXI_ORDER = "SP_KEY_OCH_TAXI_ORDER" + + //起点UUID + const val TAXI_START_MAP_MAKER = "taxi_start_map_maker"; + //终点UUID + const val TAXI_END_MAP_MAKER = "taxi_end_map_maker"; } } \ No newline at end of file diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/MogoOCHTaxiModelNew.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/MogoOCHTaxiModelNew.java index 18d4ecd99d..b5459bd818 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/MogoOCHTaxiModelNew.java +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/MogoOCHTaxiModelNew.java @@ -139,7 +139,9 @@ public class MogoOCHTaxiModelNew { } public void startOrStopOrderLoop(){ - startOrStopOrderLoop(mOCHCarStatus == 1); + if (NetworkUtils.isConnected(mContext)) { + startOrStopOrderLoop(mOCHCarStatus == 1); + } } public void release() { diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/OCHTaxiBeingServerdOrdersFragment.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/OCHTaxiBeingServerdOrdersFragment.java index 28a0004ed0..57bf098442 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/OCHTaxiBeingServerdOrdersFragment.java +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/OCHTaxiBeingServerdOrdersFragment.java @@ -1,6 +1,8 @@ package com.mogo.och.taxi.ui; import android.app.Activity; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; import android.graphics.Color; import android.graphics.drawable.GradientDrawable; import android.os.Build; @@ -16,13 +18,17 @@ import androidx.annotation.RequiresApi; import androidx.constraintlayout.widget.ConstraintLayout; import com.amap.api.navi.model.NaviLatLng; +import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.debug.DebugConfig; import com.mogo.commons.voice.AIAssist; import com.mogo.eagle.core.utilcode.mogo.logger.Logger; import com.mogo.eagle.core.utilcode.mogo.toast.TipToast; import com.mogo.eagle.core.utilcode.util.DateTimeUtils; import com.mogo.eagle.core.utilcode.util.UiThreadHandler; +import com.mogo.map.marker.MogoMarkerOptions; +import com.mogo.module.common.MogoApisHandler; import com.mogo.och.taxi.callback.IOCHTaxiNaviChangedCallback; +import com.mogo.och.taxi.constant.OCHTaxiConst; import com.mogo.och.taxi.constant.OrderStatusEnum; import com.mogo.och.taxi.R; import com.mogo.och.taxi.bean.OrderQueryRespBean; @@ -33,6 +39,7 @@ import com.mogo.och.taxi.utils.OchTaxiUtils; import java.text.DecimalFormat; import java.util.Calendar; +import java.util.List; /** * @author congtaowang @@ -150,7 +157,7 @@ public class OCHTaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implem return; } mOrderId = order.orderId; - onOrderStatusChanged(order.orderStatus); + onOrderStatusChanged(order); if (OrderStatusEnum.ArriveAtEndStation.getCode() == order.orderStatus) { mTaxiFragment.queryCurOrderRouteInfo(); mContentModule3.setVisibility(View.GONE); @@ -342,7 +349,8 @@ public class OCHTaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implem } } - public void onOrderStatusChanged(int status) { + public void onOrderStatusChanged(OrderQueryRespBean.Result order) { + int status = order.orderStatus; Log.d(TAG, "status==" + status); mActivity.runOnUiThread(() -> { if (status == OrderStatusEnum.None.getCode() || status == OrderStatusEnum.Cancel.getCode() || status == OrderStatusEnum.JourneyCompleted.getCode()) { @@ -358,10 +366,14 @@ public class OCHTaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implem showNotice(mActivity.getString(R.string.module_och_taxi_new_order)); startNaviToStartStation(false, mOrderStartStationLat, mOrderStartStationLng); showOrHideNavi(true); + setOrRemoveMapMaker(true, OCHTaxiConst.TAXI_START_MAP_MAKER,order.startSitePoint,R.drawable.icon_station_start_end); + setOrRemoveMapMaker(true,OCHTaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint,R.drawable.icon_station_start_end); break; case Cancel: showNotice(mActivity.getString(R.string.module_och_taxi_order_cancel)); showOrHideNavi(false); + setOrRemoveMapMaker(false, OCHTaxiConst.TAXI_START_MAP_MAKER,order.startSitePoint,R.drawable.icon_station_start_end); + setOrRemoveMapMaker(false,OCHTaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint,R.drawable.icon_station_start_end); break; case ArriveAtStartStation: showNotice(mActivity.getString(R.string.module_och_taxi_order_status_ph_text)); @@ -370,10 +382,12 @@ public class OCHTaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implem case OnTheWayToEndStation: // showNotice("欢迎使用蘑菇智行"); showOrHideNavi(false); + setOrRemoveMapMaker(false, OCHTaxiConst.TAXI_START_MAP_MAKER,order.startSitePoint,R.drawable.icon_station_start_end); break; case ArriveAtEndStation: showNotice(mActivity.getString(R.string.module_och_taxi_order_complete_1)); showOrHideNavi(false); + setOrRemoveMapMaker(false,OCHTaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint,R.drawable.icon_station_start_end); break; case JourneyCompleted: showNotice("感谢您使用蘑菇智行,再见~"); @@ -492,6 +506,31 @@ public class OCHTaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implem } }, 3000); } + + /** + * 绘制地图起点终点 + * @param isAdd + * @param uuid + * @param station + * @param iconId + */ + private void setOrRemoveMapMaker(boolean isAdd, String uuid, List station, int iconId){ + if (isAdd){ + Log.d("setMapMaker= ",uuid+"=latitude="+station.get(1)+",longitude="+station.get(0)); + MogoMarkerOptions options = new MogoMarkerOptions(); + options.anchorColor("#000000");//不设置报错,暂时随便设置个 + options.setGps(true);//使用wgs 必须设置true + options.scale(0.2f); + Bitmap bitmap = BitmapFactory.decodeResource(mActivity.getResources(), iconId, null); + options.icon(bitmap); + options.latitude(station.get(1)); + options.longitude(station.get(0)); + MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(AbsMogoApplication.getApp()).addMarker(uuid, options); + }else { + Log.d("RemoveMapMaker=",uuid+"=latitude="+station.get(1)+",longitude="+station.get(0)); + MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(AbsMogoApplication.getApp()).removeMarkers(uuid); + } + } /** * END */ diff --git a/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/end_maker_icon.png b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/end_maker_icon.png new file mode 100755 index 0000000000..8acf113151 Binary files /dev/null and b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/end_maker_icon.png differ diff --git a/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/icon_station_start_end.png b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/icon_station_start_end.png new file mode 100644 index 0000000000..04580a8f0d Binary files /dev/null and b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/icon_station_start_end.png differ diff --git a/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/start_maker_icon.png b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/start_maker_icon.png new file mode 100644 index 0000000000..9eca61e199 Binary files /dev/null and b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/start_maker_icon.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotBadCase.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotBadCase.kt index f9ce724573..79de48ee02 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotBadCase.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotBadCase.kt @@ -177,14 +177,37 @@ private suspend fun getCache(): BadCaseEntity? = suspendCancellableCoroutine { private fun getBuildIn(): BadCaseEntity = BadCaseEntity().also { itx -> val data = mutableListOf() data += Reason().also { + it.id = "1" it.reason = "变道有干扰" } data += Reason().also { + it.id = "2" it.reason = "遇红绿灯未停车" } data += Reason().also { + it.id = "3" it.reason = "遇障碍物未停车" } + data += Reason().also { + it.id = "4" + it.reason = "无法绕行" + } + data += Reason().also { + it.id = "5" + it.reason = "画龙" + } + data += Reason().also { + it.id = "6" + it.reason = "转弯过于靠近路侧" + } + data += Reason().also { + it.id = "7" + it.reason = "无故退出自动驾驶" + } + data += Reason().also { + it.id = "8" + it.reason = "其它" + } itx.data = data itx.isBuildIn = true } diff --git a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/reminder/Reminder.kt b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/reminder/Reminder.kt index fc883d70ec..6d642e35d1 100644 --- a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/reminder/Reminder.kt +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/reminder/Reminder.kt @@ -12,6 +12,7 @@ import com.mogo.eagle.core.utilcode.reminder.api.impl.ActivityReminder import kotlinx.coroutines.* import kotlinx.coroutines.android.asCoroutineDispatcher import java.lang.IllegalStateException +import java.lang.ref.WeakReference import java.util.* import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.CopyOnWriteArrayList @@ -44,7 +45,7 @@ object Reminder { } private val attaches by lazy { - ConcurrentHashMap>() + ConcurrentHashMap>>() } private val scope by lazy { @@ -106,7 +107,7 @@ object Reminder { attaches.getOrPut(attachTo, { mutableListOf() }).also { - it.add(reminder) + it.add(WeakReference(reminder)) } listener?.let { reminderListeners[reminder] = it @@ -144,15 +145,18 @@ object Reminder { val reminders = attaches.remove(attachTo) ?: return try { reminders.forEach { - if (it.isShowing()) { - it.hide() - } - enqueued.remove(it.key()) - showed.remove(it.key()) - if (it.isOverride()) { - queue.remove(it) - } else { - heap.remove(it) + val reminder = it.get() + if (reminder != null) { + if (reminder.isShowing()) { + reminder.hide() + } + enqueued.remove(reminder.key()) + showed.remove(reminder.key()) + if (reminder.isOverride()) { + queue.remove(reminder) + } else { + heap.remove(reminder) + } } } } catch (t: Throwable) { @@ -303,7 +307,10 @@ object Reminder { if (reminders == null || reminders.isEmpty()) { return false } - return reminders.find { it.isShowing() } != null + return reminders.find { + val ref = it.get() + return@find ref != null && ref.isShowing() + } != null } fun dismissAll(attachTo: LifecycleOwner) { @@ -313,13 +320,16 @@ object Reminder { } try { reminders.forEach { - if (it.isOverride()) { - queue.remove(it) - } else { - heap.remove(it) - } - if (it.isShowing()) { - it.hide() + val reminder = it.get() + if (reminder != null) { + if (reminder.isShowing()) { + reminder.hide() + } + if (reminder.isOverride()) { + queue.remove(reminder) + } else { + heap.remove(reminder) + } } } } catch (t: Throwable) { diff --git a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/reminder/api/IReminder.kt b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/reminder/api/IReminder.kt index cd021da78c..d7f6422a03 100644 --- a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/reminder/api/IReminder.kt +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/reminder/api/IReminder.kt @@ -123,6 +123,7 @@ interface IReminder : Comparable { override fun onViewDetachedFromWindow(v: View?) { lifecycle.let { if (it.currentState.isAtLeast(Lifecycle.State.CREATED)) { + this@lifecycleOwner.removeOnAttachStateChangeListener(this) it.currentState = Lifecycle.State.DESTROYED } } diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/HostConst.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/HostConst.java index 1d82c61d2c..1c7db8cea1 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/HostConst.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/HostConst.java @@ -7,27 +7,16 @@ package com.mogo.module.common.constants; */ public class HostConst { public static final String DEVA_HOST = "http://dzt-deva.zhidaozhixing.com"; - public static final String IM_HOST = "http://dzt-im.zhidaozhixing.com"; public static final String LAUNCHER_SNAPSHOT_HOST = "http://dzt-launcherSnapshot.zhidaozhixing.com"; - public static final String CHANNEL_MANAGER_HOST = "http://dzt-channelManager.zhidaozhixing.com"; public static final String DATA_SERVICE_HOST = "http://dzt-dataService.zhidaozhixing.com"; public static final String REALTIME_LOCATION_HOST = "http://dzt-realtimeLocation.zhidaozhixing.com"; - public static final String INSTANT_HOST = "http://dzt-Instant.zhidaozhixing.com"; public static final String GEOFENCE_HOST = "http://dzt-geoFenceCarService.zhidaozhixing.com"; public static final String CARLIFE_HOST = "http://dzt-carlife.zhidaozhixing.com"; public static final String STRATEGY_PUSH_HOST = "http://dzt-strategyPush.zhidaozhixing.com"; - public static final String TRAVEL_CONDITION_HOST = "http://dzt-travelCondition.zhidaozhixing.com"; - public static final String TMC_HOST = "http://dzt-tmcServer.zhidaozhixing.com"; - public static final String IM_SOCKET_DOMAIN = "dzt-im.zhidaozhixing.com"; - public static final String WEBSOCKET_DOMAIN = "dzt-Instant.zhidaozhixing.com"; public static final String CAMERA_STREAM_HOST = "http://dzt-smartTransportationAiCloud.zhidaozhixing.com"; public static final String OPEN_CAMERA_STREAM_HOST = "http://10.0.16.6:18080"; - public static final String MEC_ETL_HOST = "http://dzt-mecEtl.zhidaozhixing.com"; public static final String CITY_HOST = "http://dzt-city.zhidaozhixing.com"; public static final String SOCKET_CENTER_DOMAIN = "socketRegion"; - // 网约车 - public static final String OCH_DOMAIN = "http://dzt-hailing.zhidaozhixing.com"; - }