Merge remote-tracking branch 'origin/dev_robotaxi-d-app-module_251_220125_2.5.1' into dev_robotaxi-d-app-module_251_220125_2.5.1
This commit is contained in:
@@ -9,5 +9,5 @@ import java.util.List;
|
||||
* @date: 2021/10/22
|
||||
*/
|
||||
public interface RefreshBusStationsCallback {
|
||||
void refreshBusStations(List<OchBusStation> stationList, int currentStation, int nextStation);
|
||||
void refreshBusStations(List<OchBusStation> stationList, int currentStation, int nextStation,boolean isArrived);
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -93,9 +93,9 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements CarO
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refreshBusStations(List<OchBusStation> stationList, int currentStation, int nextStation) {
|
||||
public void refreshBusStations(List<OchBusStation> stationList, int currentStation, int nextStation, boolean isArrived) {
|
||||
if ( mView != null ) {
|
||||
mView.refreshBusStations( stationList, currentStation, nextStation );
|
||||
mView.refreshBusStations( stationList, currentStation, nextStation ,isArrived);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/end_maker_icon.png
Executable file
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/end_maker_icon.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 100 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
@@ -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"
|
||||
|
||||
119
OCH/mogo-och-bus/src/main/res/values-xhdpi-2560x1600/dimens.xml
Normal file
119
OCH/mogo-och-bus/src/main/res/values-xhdpi-2560x1600/dimens.xml
Normal file
@@ -0,0 +1,119 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- 本套资源适配分体机xhdpi -->
|
||||
<dimen name="module_mogo_och_bus_station_panel_width">300px</dimen>
|
||||
<dimen name="module_mogo_och_bus_station_panel_height">348px</dimen>
|
||||
<dimen name="module_mogo_och_bus_two_station_panel_height">211px</dimen>
|
||||
<dimen name="module_mogo_och_bus_three_station_panel_height">276px</dimen>
|
||||
|
||||
|
||||
<dimen name="module_mogo_och_bus_station_list_height">220px</dimen>
|
||||
<dimen name="module_mogo_och_bus_two_station_list_height">98px</dimen>
|
||||
<dimen name="module_mogo_och_bus_three_station_list_height">159px</dimen>
|
||||
|
||||
<dimen name="module_mogo_och_bus_current_station_name_text_size">32px</dimen>
|
||||
<dimen name="module_mogo_och_bus_current_station_notice_text_size">20px</dimen>
|
||||
<dimen name="module_mogo_och_bus_station_name_text_size">42px</dimen>
|
||||
<dimen name="module_mogo_och_bus_station_notice_text_size">32px</dimen>
|
||||
|
||||
<dimen name="module_mogo_och_bus_station_name_margin_left">15px</dimen>
|
||||
|
||||
<dimen name="module_mogo_och_bus_station_panel_padding_top">20px</dimen>
|
||||
<dimen name="module_mogo_och_bus_station_panel_padding_left">36px</dimen>
|
||||
<dimen name="module_mogo_och_bus_station_panel_padding_bottom">28px</dimen>
|
||||
<dimen name="module_mogo_och_bus_station_panel_padding_right">36px</dimen>
|
||||
|
||||
<dimen name="module_mogo_och_bus_station_panel_guide_offset_left">3px</dimen>
|
||||
<dimen name="module_mogo_och_bus_station_panel_guide_offset_right">3px</dimen>
|
||||
<dimen name="module_mogo_och_bus_station_panel_guide_offset_top">17px</dimen>
|
||||
<dimen name="module_mogo_och_bus_station_panel_guide_offset_bottom">17px</dimen>
|
||||
|
||||
|
||||
<dimen name="module_och_bus_panel_width">300px</dimen>
|
||||
<dimen name="module_och_bus_panel_height">270px</dimen>
|
||||
<dimen name="module_och_bus_order_status_marginLeft">30px</dimen>
|
||||
<dimen name="module_och_bus_order_status_marginTop">24px</dimen>
|
||||
<dimen name="module_och_bus_order_status_textSize">24px</dimen>
|
||||
<dimen name="module_och_bus_order_status_divider_height">1px</dimen>
|
||||
<dimen name="module_och_bus_order_status_divider_marginLeft">30px</dimen>
|
||||
<dimen name="module_och_bus_order_status_divider_marginTop">23px</dimen>
|
||||
<dimen name="module_och_bus_order_status_divider_marginRight">30px</dimen>
|
||||
<dimen name="module_och_bus_order_status_stationInfo_height">146px</dimen>
|
||||
<dimen name="module_och_bus_order_status_stationInfo_paddingLeft">20px</dimen>
|
||||
<dimen name="module_och_bus_order_status_stationInfo_paddingTop">23px</dimen>
|
||||
<dimen name="module_och_bus_order_status_stationInfo_paddingRight">30px</dimen>
|
||||
<dimen name="module_och_bus_order_status_stationInfo_paddingBottom">23px</dimen>
|
||||
<dimen name="module_och_bus_order_start_station_textSize">26px</dimen>
|
||||
<dimen name="module_och_bus_order_start_station_anchor_textSize">32px</dimen>
|
||||
<dimen name="module_och_bus_order_end_station_anchor_textSize">20px</dimen>
|
||||
<dimen name="module_och_bus_order_distance_container_height">80px</dimen>
|
||||
<dimen name="module_och_bus_order_distance_container_marginLeft">3px</dimen>
|
||||
<dimen name="module_och_bus_order_distance_anchor_marginTop">44.5px</dimen>
|
||||
<dimen name="module_och_bus_order_distance_anchor_textSize">20px</dimen>
|
||||
<dimen name="module_och_bus_order_distance_textSize">28px</dimen>
|
||||
<dimen name="module_och_bus_order_distance_marginRight">27px</dimen>
|
||||
|
||||
|
||||
<dimen name="module_mogo_och_autopilot_order_tag_height">25.6px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_tag_m_t">20px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_tag_m_r">20px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_tag_p_r">16px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_tag_p_l">16px</dimen>
|
||||
|
||||
<dimen name="module_mogo_och_margin_left">40px</dimen>
|
||||
<dimen name="module_mogo_och_margin_right">40px</dimen>
|
||||
<dimen name="module_mogo_och_margin_bottom">46px</dimen>
|
||||
<dimen name="module_mogo_och_margin_top">24px</dimen>
|
||||
|
||||
<dimen name="module_mogo_och_station_panel_container_margin_top_no_call">530px</dimen>
|
||||
<dimen name="module_mogo_och_station_panel_container_margin_top_with_call">492px</dimen>
|
||||
|
||||
<dimen name="module_mogo_och_slide_panel_block_start_x">20px</dimen>
|
||||
<dimen name="module_mogo_och_slide_panel_block_start_y">20px</dimen>
|
||||
<dimen name="module_mogo_och_slide_panel_normal_text_margin_left">70px</dimen>
|
||||
<dimen name="module_mogo_och_slide_panel_normal_text_margin_right">130px</dimen>
|
||||
<dimen name="module_mogo_och_slide_panel_short_text_margin_left">93px</dimen>
|
||||
<dimen name="module_mogo_och_slide_panel_short_text_margin_right">150px</dimen>
|
||||
<dimen name="module_mogo_och_slide_panel_textSize">70px</dimen>
|
||||
|
||||
<dimen name="module_mogo_och_autopilot_status_bg_corner">24px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_status_bg_width">460px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_status_bg_height">140px</dimen>
|
||||
|
||||
<dimen name="module_mogo_och_operation_status_bg_width">112px</dimen>
|
||||
<dimen name="module_mogo_och_operation_status_bg_height">112px</dimen>
|
||||
|
||||
<dimen name="module_mogo_och_operation_status_padding">92px</dimen>
|
||||
|
||||
<dimen name="module_mogo_och_autopilot_order_m_t">30px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_bg_width">466px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_bg_height">414px</dimen>
|
||||
|
||||
|
||||
<dimen name="module_mogo_och_autopilot_status_text_size">36px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_status_text_padding_top">13px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_status_text_drawable_padding">12px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_status_text_m_l">350px</dimen>
|
||||
|
||||
<dimen name="module_mogo_och_notice_text_max_width">460px</dimen>
|
||||
<dimen name="module_mogo_och_notice_text_size">30px</dimen>
|
||||
|
||||
<dimen name="bus_ext_arcView_center_text_size">110px</dimen>
|
||||
<dimen name="bus_ext_arcView_des_text_size">40px</dimen>
|
||||
<dimen name="bus_ext_arcView_height">320px</dimen>
|
||||
<dimen name="bus_ext_arcView_stroke_with">20px</dimen>
|
||||
<dimen name="bus_ext_arcView_top">40px</dimen>
|
||||
<dimen name="bus_ext_arcView_width">320px</dimen>
|
||||
<dimen name="bus_ext_speed_height">460px</dimen>
|
||||
<dimen name="bus_ext_speed_padding">70px</dimen>
|
||||
<dimen name="bus_ext_speed_width">460px</dimen>
|
||||
<dimen name="bus_ext_speed_width_big_radius">130px</dimen>
|
||||
<dimen name="bus_ext_speed_width_sm_radius">30px</dimen>
|
||||
<dimen name="bus_switch_map">276px</dimen>
|
||||
<dimen name="bus_switch_map_height">112px</dimen>
|
||||
<dimen name="bus_switch_margin_left">22px</dimen>
|
||||
<dimen name="bus_switch_text_size">36px</dimen>
|
||||
<dimen name="bus_switch_image">50px</dimen>
|
||||
<dimen name="bus_switch_image_circle">60px</dimen>
|
||||
|
||||
</resources>
|
||||
@@ -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";
|
||||
}
|
||||
}
|
||||
@@ -139,7 +139,9 @@ public class MogoOCHTaxiModelNew {
|
||||
}
|
||||
|
||||
public void startOrStopOrderLoop(){
|
||||
startOrStopOrderLoop(mOCHCarStatus == 1);
|
||||
if (NetworkUtils.isConnected(mContext)) {
|
||||
startOrStopOrderLoop(mOCHCarStatus == 1);
|
||||
}
|
||||
}
|
||||
|
||||
public void release() {
|
||||
|
||||
@@ -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<Double> 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
|
||||
*/
|
||||
|
||||
BIN
OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/end_maker_icon.png
Executable file
BIN
OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/end_maker_icon.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 100 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
@@ -177,14 +177,37 @@ private suspend fun getCache(): BadCaseEntity? = suspendCancellableCoroutine {
|
||||
private fun getBuildIn(): BadCaseEntity = BadCaseEntity().also { itx ->
|
||||
val data = mutableListOf<Reason>()
|
||||
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
|
||||
}
|
||||
|
||||
@@ -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<LifecycleOwner, MutableList<IReminder>>()
|
||||
ConcurrentHashMap<LifecycleOwner, MutableList<WeakReference<IReminder>>>()
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
@@ -123,6 +123,7 @@ interface IReminder : Comparable<IReminder> {
|
||||
override fun onViewDetachedFromWindow(v: View?) {
|
||||
lifecycle.let {
|
||||
if (it.currentState.isAtLeast(Lifecycle.State.CREATED)) {
|
||||
this@lifecycleOwner.removeOnAttachStateChangeListener(this)
|
||||
it.currentState = Lifecycle.State.DESTROYED
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user