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 4d7f27668a..54e17aa76b 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 @@ -56,8 +56,10 @@ import com.mogo.och.common.module.biz.provider.LoginService; import com.mogo.och.common.module.manager.OCHAdasAbilityManager; import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil; import com.mogo.och.common.module.utils.DateTimeUtil; +import com.mogo.och.common.module.utils.NumberFormatUtil; 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.service.statusmanager.IMogoStatusChangedListener; import com.mogo.service.statusmanager.StatusDescriptor; @@ -605,10 +607,14 @@ public class BusOrderModel { @Override public void onFail(int code, String failMsg) { - if (!NetworkUtils.isConnected(mContext)) { - ToastUtils.showShort("网络异常,请稍后重试"); - }else { - ToastUtils.showShort(failMsg); + isArrivedStation = false; + isGoingToNextStation = true; + if (ToastUtilsOch.isCustomFastClick(5000)){ + if (!NetworkUtils.isConnected(mContext)) { + ToastUtils.showShort("网络异常,请稍后重试"); + }else { + ToastUtils.showShort(failMsg); + } } } }); @@ -855,10 +861,30 @@ public class BusOrderModel { return; } + //MAP 280 每隔100ms左右返回一次到站, 导致在到达中间站后再次滑动出发后会有时间差,收到一次到站,出现问题 + //此处比对 自驾告诉的到站站点坐标和本地应到站站点坐标, 一致时才能到站 + if (data != null && data.getEndLocation() != null){ + + 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); + + if (!latitude.equals(arriveLat) || !longitude.equals(arriveLon)){ + CallerLogger.INSTANCE.e( M_BUS + TAG, "行程日志-到站拦截,到站坐标不一致" ); + return; + } + } + if (isArrivedStation) return; isArrivedStation = true; - CallerLogger.INSTANCE.d( M_BUS + TAG, "行程日志-到站==backgroundCurrentStationIndex=" + backgroundCurrentStationIndex); + CallerLogger.INSTANCE.d( M_BUS + TAG, "行程日志-当前==backgroundCurrentStationIndex=" + + backgroundCurrentStationIndex); + isGoingToNextStation = false; arriveSiteStation(); diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/NaviToDestinationModel.java b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/map/AmapNaviToDestinationModel.java similarity index 73% rename from OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/NaviToDestinationModel.java rename to OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/map/AmapNaviToDestinationModel.java index 84a387ead4..048a0baa0d 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/NaviToDestinationModel.java +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/map/AmapNaviToDestinationModel.java @@ -1,4 +1,4 @@ -package com.mogo.och.taxi.model; +package com.mogo.och.common.module.map; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI; @@ -25,8 +25,7 @@ import com.amap.api.navi.model.NaviLatLng; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.util.NetworkUtils; import com.mogo.eagle.core.utilcode.util.ToastUtils; -import com.mogo.och.taxi.callback.ITaxiNaviChangedCallback; -import com.mogo.och.taxi.utils.PermissionUtil; +import com.mogo.och.common.module.utils.PermissionUtil; import java.util.ArrayList; import java.util.List; @@ -36,24 +35,27 @@ import java.util.concurrent.atomic.AtomicInteger; * @author: wangmingjun * @date: 2021/12/6 */ -public class NaviToDestinationModel implements AMapNaviListener { +public class AmapNaviToDestinationModel implements AMapNaviListener { + + public static final String TAG = "NaviToDestinationModel"; + private static Context mContext; private AMapNavi mAMapNavi = null; protected final List sList = new ArrayList(); protected final List eList = new ArrayList(); protected List mWayPointList = new ArrayList(); - private ITaxiNaviChangedCallback mNaviChangedCallback; + private ICommonNaviChangedCallback mNaviChangedCallback; private AtomicInteger errorCount = new AtomicInteger(0); private boolean isPlay; - public static NaviToDestinationModel getInstance(Context context) { + public static AmapNaviToDestinationModel getInstance(Context context) { mContext = context; return SingletonHolder.INSTANCE; } private static final class SingletonHolder { - private static final NaviToDestinationModel INSTANCE = new NaviToDestinationModel(); + private static final AmapNaviToDestinationModel INSTANCE = new AmapNaviToDestinationModel(); } - private NaviToDestinationModel(){ + private AmapNaviToDestinationModel(){ } public void initAMapNavi(NaviLatLng startLatLng,NaviLatLng endLatLng) { try { @@ -90,7 +92,7 @@ public class NaviToDestinationModel implements AMapNaviListener { } } - public void setOCHTaciNaviChangedCallback(ITaxiNaviChangedCallback callback){ + public void setOCHTaciNaviChangedCallback(ICommonNaviChangedCallback callback){ this.mNaviChangedCallback = callback; } @Override @@ -132,6 +134,7 @@ public class NaviToDestinationModel implements AMapNaviListener { public void onNaviInfoUpdate(NaviInfo naviinfo) { //导航过程中的信息更新,请看NaviInfo的具体说明 if (null != mNaviChangedCallback){ + CallerLogger.INSTANCE.i(M_TAXI + TAG, "距离=" + naviinfo.getPathRetainDistance() + ", 剩余时间 " + naviinfo.getPathRetainTime()); mNaviChangedCallback.onCurrentNaviDistAndTimeChanged(naviinfo.getPathRetainDistance(),naviinfo.getPathRetainTime());// 米、秒 } } @@ -165,13 +168,9 @@ public class NaviToDestinationModel implements AMapNaviListener { } return; } -// if (result.getErrorCode() == 3){ -// ToastUtils.showShort("车辆当前坐标错误"); -// }else if (result.getErrorCode() == 6){ -// ToastUtils.showShort("终点坐标错误"); -// } - CallerLogger.INSTANCE.i(M_TAXI + "dm", "路线计算失败:错误码=" + result.getErrorCode() + ",Error Message= " + result.getErrorDetail()); - CallerLogger.INSTANCE.i(M_TAXI + "dm", "错误码详细链接见:http://lbs.amap.com/api/android-navi-sdk/guide/tools/errorcode/"); + + CallerLogger.INSTANCE.i(M_TAXI + TAG, "路线计算失败:错误码=" + result.getErrorCode() + ",Error Message= " + result.getErrorDetail()); + CallerLogger.INSTANCE.i(M_TAXI + TAG, "错误码详细链接见:http://lbs.amap.com/api/android-navi-sdk/guide/tools/errorcode/"); } @Override public void onStartNavi(int type) { @@ -341,88 +340,4 @@ public class NaviToDestinationModel implements AMapNaviListener { public void onPlayRing(int i) { } - - /** - * 车道信息说明: - *

- * 0xFF, 无对应车道 - * 0, 直行 - * 1, 左转 - * 2, 直行+左转 - * 3, 右转 - * 4, 直行+右转 - * 5, 左掉头 - * 6, 左转+右转 - * 7, 直行+左转+右转 - * 8, 右掉头 - * 9, 直行+左掉头 - * 10, 直行+右掉头 - * 11, 左转+左掉头 - * 12, 右转+右掉头 - * 13, 直行+扩展 - * 14, 左转+左掉头+扩展 - * 15, 保留 - * 16, 直行+左转+左掉头 - * 17, 右转+左掉头 - * 18, 左转+右转+左掉头 - * 19, 直行+右转+左掉头 - * 20, 左转+右掉头 - * 21, 公交车道 - * 22, 空车道 - * 23 可变车道 - */ - - String[] array = { - "直行车道" - , "左转车道" - , "左转或直行车道" - , "右转车道" - , "右转或直行车道" - , "左掉头车道" - , "左转或者右转车道" - , " 左转或右转或直行车道" - , "右转掉头车道" - , "直行或左转掉头车道" - , "直行或右转掉头车道" - , "左转或左掉头车道" - , "右转或右掉头车道" - , "直行并且车道扩展" - , "左转+左掉头+扩展" - , "不可以选择该车道" - , "直行+左转+左掉头车道" - , "右转+左掉头" - , "左转+右转+左掉头" - , "直行+右转+左掉头" - , "左转+右掉头" - , "公交车道" - , "空车道" - , "可变车道" - }; - - String[] actions = { - "直行" - , "左转" - , "左转或直行" - , "右转" - , "右转或这行" - , "左掉头" - , "左转或者右转" - , " 左转或右转或直行" - , "右转掉头" - , "直行或左转掉头" - , "直行或右转掉头" - , "左转或左掉头" - , "右转或右掉头" - , "直行并且车道扩展" - , "左转+左掉头+扩展" - , "不可以选择" - , "直行+左转+左掉头" - , "右转+左掉头" - , "左转+右转+左掉头" - , "直行+右转+左掉头" - , "左转+右掉头" - , "公交车道" - , "空车道" - , "可变车道" - }; } diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/map/CommonAmapNaviVIew.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/map/CommonAmapNaviVIew.kt new file mode 100644 index 0000000000..887729704f --- /dev/null +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/map/CommonAmapNaviVIew.kt @@ -0,0 +1,249 @@ +package com.mogo.och.common.module.map + +import android.content.Context +import android.graphics.BitmapFactory +import android.os.Bundle +import android.util.AttributeSet +import android.view.LayoutInflater +import android.widget.RelativeLayout +import com.amap.api.maps.AMap +import com.amap.api.maps.model.CustomMapStyleOptions +import com.amap.api.navi.AMapNaviView +import com.amap.api.navi.AMapNaviViewListener +import com.amap.api.navi.AMapNaviViewOptions +import com.amap.api.navi.model.RouteOverlayOptions +import com.mogo.eagle.core.utilcode.mogo.MapAssetStyleUtils +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d +import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant +import com.mogo.och.common.module.R +import kotlinx.android.synthetic.main.taxi_common_amap_navi_view.view.* +import kotlin.concurrent.thread + +/** + * @author: wangmingjun + * @date: 2022/10/23 + */ +class CommonAmapNaviVIew @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0) + : RelativeLayout(context,attrs,defStyleAttr), AMapNaviViewListener { + + private val TAG : String = "TaxiAmapNaviVIew" + + var aMap : AMap? = null + + init { + LayoutInflater.from(context).inflate(R.layout.taxi_common_amap_navi_view,this,true) + initMapView() + } + + private fun initMapView(){ + + amapNaviView.setAMapNaviViewListener(this) + //车头向上模式 + amapNaviView.naviMode = AMapNaviView.CAR_UP_MODE + aMap = amapNaviView.map + //关闭地图文字显示 + aMap!!.showMapText(false) + // 设置导航地图模式,aMap是地图控制器对象。 + aMap!!.mapType = AMap.MAP_TYPE_NIGHT + // 关闭显示实时路况图层,aMap是地图控制器对象。 + aMap!!.isTrafficEnabled = false + setMapViewOptions() + + thread(start = true){ + try { + Thread.sleep(1000L) + } catch (e : InterruptedException) { + e.printStackTrace() + } + + if (null == context){ + return@thread + } + + aMap!!.setCustomMapStyle( + CustomMapStyleOptions() + .setEnable(true) + .setStyleData(MapAssetStyleUtils.getAssetsStyle(context, "over_view_style.data")) + .setStyleExtraData(MapAssetStyleUtils.getAssetsExtraStyle(context, "over_view_style_extra.data")) + ) + } + } + + private fun setMapViewOptions() { + + val options = AMapNaviViewOptions() + options.tilt = 0 //设置 2D 模式 + + options.isLayoutVisible = false //设置导航界面UI是否显示。 + + options.isTrafficBarEnabled = false //设置路况光柱条是否显示(只适用于驾车导航,需要联网)。 + + options.isAutoLockCar = true //设置6秒后是否自动锁车 + + options.isAutoDisplayOverview = true //设置是否自动全览模式,即在算路成功后自动进入全览模式 + + options.isTrafficLine = false + options.setModeCrossDisplayShow(true) //设置是否显示路口放大图(路口模型图) + + options.isAutoChangeZoom = true //自动缩放级别 + + options.carBitmap = + BitmapFactory.decodeResource(context.resources, R.drawable.taxi_navi_arrow_icon) + options.fourCornersBitmap = + BitmapFactory.decodeResource(this.resources, R.drawable.taxi_navi_direction_icon) + options.isAutoChangeZoom = true //设置是否开启动态比例尺 (锁车态下自动进行地图缩放变化) + +// options.setZoom(18);//14-18 +// options.setTrafficInfoUpdateEnabled(false); +// options.setTrafficLayerEnabled(false);//设置[实时交通图层开关按钮]是否显示(只适用于驾车导航,需要联网)。 +// options.setCameraInfoUpdateEnabled(false); +// options.setCompassEnabled(false);//设置指南针图标否在导航界面显示,默认显示。 +// options.setLaneInfoShow(false);// 设置是否显示道路信息view +// options.setNaviArrowVisible(false);//设置路线转向箭头隐藏和显示 +// options.setRealCrossDisplayShow(false);//设置是否显示路口放大图(实景图) +// options.setRouteListButtonShow(true);//设置导航界面是否显示路线全览按钮。 +// options.setSettingMenuEnabled(false);//设置菜单按钮是否在导航界面显示。 + + // options.setZoom(18);//14-18 +// options.setTrafficInfoUpdateEnabled(false); +// options.setTrafficLayerEnabled(false);//设置[实时交通图层开关按钮]是否显示(只适用于驾车导航,需要联网)。 +// options.setCameraInfoUpdateEnabled(false); +// options.setCompassEnabled(false);//设置指南针图标否在导航界面显示,默认显示。 +// options.setLaneInfoShow(false);// 设置是否显示道路信息view +// options.setNaviArrowVisible(false);//设置路线转向箭头隐藏和显示 +// options.setRealCrossDisplayShow(false);//设置是否显示路口放大图(实景图) +// options.setRouteListButtonShow(true);//设置导航界面是否显示路线全览按钮。 +// options.setSettingMenuEnabled(false);//设置菜单按钮是否在导航界面显示。 + val routeOverlayOptions = RouteOverlayOptions() + +// routeOverlayOptions.setArrowOnTrafficRoute(BitmapFactory.decodeResource(getResources(),R.drawable.custtexture_aolr)); + +// routeOverlayOptions.setArrowOnTrafficRoute(BitmapFactory.decodeResource(getResources(),R.drawable.custtexture_aolr)); + routeOverlayOptions.normalRoute = + BitmapFactory.decodeResource(resources, R.drawable.taxi_navi_line_icon) + options.routeOverlayOptions = routeOverlayOptions + + amapNaviView.viewOptions = options + } + + override fun onNaviSetting() { + //底部导航设置点击回调 + } + + override fun onNaviCancel() { + TODO("Not yet implemented") + } + + override fun onNaviBackClick(): Boolean { + return false + } + + override fun onNaviMapMode(p0: Int) { + //导航态车头模式,0:车头朝上状态;1:正北朝上模式。 + } + + override fun onNaviTurnClick() { + //转弯view的点击回调 + } + + override fun onNextRoadClick() { + //下一个道路View点击回调 + } + + override fun onScanViewButtonClick() { + //全览按钮点击回调 + } + + override fun onLockMap(p0: Boolean) { + //锁地图状态发生变化时回调 + } + + override fun onNaviViewLoaded() { + d(SceneConstant.M_TAXI + TAG, "导航页面加载成功") + d( + SceneConstant.M_TAXI + TAG, + "请不要使用AMapNaviView.getMap().setOnMapLoadedListener();会overwrite导航SDK内部画线逻辑" + ) + } + + override fun onMapTypeChanged(p0: Int) { + TODO("Not yet implemented") + } + + override fun onNaviViewShowMode(p0: Int) { + TODO("Not yet implemented") + } + + fun onCreate(savedInstanceState : Bundle?){ + amapNaviView.onCreate(savedInstanceState) + } + + fun onResume(){ + amapNaviView.onResume() + } + + fun onPause(){ + amapNaviView.onPause() + } + + fun onDestroy(){ + amapNaviView.onDestroy() + } + + var array = arrayOf( + "直行车道", + "左转车道", + "左转或直行车道", + "右转车道", + "右转或直行车道", + "左掉头车道", + "左转或者右转车道", + " 左转或右转或直行车道", + "右转掉头车道", + "直行或左转掉头车道", + "直行或右转掉头车道", + "左转或左掉头车道", + "右转或右掉头车道", + "直行并且车道扩展", + "左转+左掉头+扩展", + "不可以选择该车道", + "直行+左转+左掉头车道", + "右转+左掉头", + "左转+右转+左掉头", + "直行+右转+左掉头", + "左转+右掉头", + "公交车道", + "空车道", + "可变车道" + ) + + var actions = arrayOf( + "直行", + "左转", + "左转或直行", + "右转", + "右转或这行", + "左掉头", + "左转或者右转", + " 左转或右转或直行", + "右转掉头", + "直行或左转掉头", + "直行或右转掉头", + "左转或左掉头", + "右转或右掉头", + "直行并且车道扩展", + "左转+左掉头+扩展", + "不可以选择", + "直行+左转+左掉头", + "右转+左掉头", + "左转+右转+左掉头", + "直行+右转+左掉头", + "左转+右掉头", + "公交车道", + "空车道", + "可变车道" + ) +} \ No newline at end of file diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/callback/ITaxiNaviChangedCallback.java b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/map/ICommonNaviChangedCallback.java similarity index 75% rename from OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/callback/ITaxiNaviChangedCallback.java rename to OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/map/ICommonNaviChangedCallback.java index 138de6b9b1..12440028bb 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/callback/ITaxiNaviChangedCallback.java +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/map/ICommonNaviChangedCallback.java @@ -1,11 +1,11 @@ -package com.mogo.och.taxi.callback; +package com.mogo.och.common.module.map; /** * @author: wangmingjun * @date: 2021/12/3 */ -public interface ITaxiNaviChangedCallback { +public interface ICommonNaviChangedCallback { // 当前位置距离上车点的距离(米)、预估时间(秒) void onCurrentNaviDistAndTimeChanged(int meters, long timeInSecond); void reInitNaviAmap(boolean isPlay,boolean isRestart); -} +} \ No newline at end of file diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/NumberFormatUtil.java b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/NumberFormatUtil.java index 4c626a4659..1af162ef26 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/NumberFormatUtil.java +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/NumberFormatUtil.java @@ -21,4 +21,20 @@ public class NumberFormatUtil { } return String.valueOf(num); } + + /** + * 截取小数点后cutNum位, 不进行四舍五入 + * @param num + * @param cutNum + * @return + */ + public static String cutOutNumber(double num,int cutNum){ + try{ + BigDecimal bg = new BigDecimal(num).setScale(cutNum, RoundingMode.DOWN); + return String.valueOf(bg.doubleValue()); + }catch (Exception e){ + + } + return ""; + } } diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/PermissionUtil.java b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/PermissionUtil.java new file mode 100644 index 0000000000..8dac5fdf56 --- /dev/null +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/PermissionUtil.java @@ -0,0 +1,35 @@ +package com.mogo.och.common.module.utils; + +import android.content.Context; +import android.content.pm.PackageManager; +import android.location.LocationManager; + +import androidx.core.content.ContextCompat; + +/** + * @author: wangmingjun + * @date: 2021/12/7 + */ +public class PermissionUtil { + + public static boolean checkPermission(Context context,String... permissons) { + + for (String permisson : permissons) { + if ((ContextCompat.checkSelfPermission(context, + permisson) != PackageManager.PERMISSION_GRANTED)) { + return false; + } + } + return true; + } + + public static boolean isLocServiceEnable(Context context) { + LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); + boolean gps = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); + boolean network = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER); + if (gps || network) { + return true; + } + return false; + } +} diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/ToastUtilsOch.java b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/ToastUtilsOch.java index 829093f3a7..a2a02a8475 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/ToastUtilsOch.java +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/ToastUtilsOch.java @@ -4,6 +4,11 @@ import com.mogo.commons.debug.DebugConfig; import com.mogo.eagle.core.utilcode.util.ToastUtils; public class ToastUtilsOch { + + private static long lastClickTime; + // 两次点击按钮之间的点击间隔不能少于1000毫秒 + private static int MIN_CLICK_DELAY_TIME = 1000; + public static void showWithCodeMessage(int code,String message){ if(message==null){ return; @@ -14,4 +19,15 @@ public class ToastUtilsOch { ToastUtils.showShort(message); } } + + public static boolean isCustomFastClick(int customCLickDelayTime) { + MIN_CLICK_DELAY_TIME = customCLickDelayTime; + boolean flag = false; + long curClickTime = System.currentTimeMillis(); + if ((curClickTime - lastClickTime) >= MIN_CLICK_DELAY_TIME) { + flag = true; + } + lastClickTime = curClickTime; + return flag; + } } diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-xhdpi/taxi_navi_arrow_icon.png b/OCH/mogo-och-common-module/src/main/res/drawable-xhdpi/taxi_navi_arrow_icon.png new file mode 100644 index 0000000000..a83b7c9e74 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-xhdpi/taxi_navi_arrow_icon.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-xhdpi/taxi_navi_direction_icon.png b/OCH/mogo-och-common-module/src/main/res/drawable-xhdpi/taxi_navi_direction_icon.png new file mode 100755 index 0000000000..1b96799531 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-xhdpi/taxi_navi_direction_icon.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-xhdpi/taxi_navi_line_icon.png b/OCH/mogo-och-common-module/src/main/res/drawable-xhdpi/taxi_navi_line_icon.png new file mode 100644 index 0000000000..7f758d5999 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-xhdpi/taxi_navi_line_icon.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/layout/taxi_common_amap_navi_view.xml b/OCH/mogo-och-common-module/src/main/res/layout/taxi_common_amap_navi_view.xml new file mode 100644 index 0000000000..3d5f5aa763 --- /dev/null +++ b/OCH/mogo-och-common-module/src/main/res/layout/taxi_common_amap_navi_view.xml @@ -0,0 +1,5 @@ + + diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerStartAutopilotView.java b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerStartAutopilotView.java index 7f93833b86..29c26ae3c7 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerStartAutopilotView.java +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerStartAutopilotView.java @@ -11,6 +11,7 @@ import android.widget.RelativeLayout; import android.widget.TextView; import com.elegant.utils.UiThreadHandler; +import com.mogo.commons.AbsMogoApplication; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.util.OverlayViewUtils; import com.mogo.eagle.core.utilcode.util.ToastUtils; @@ -159,6 +160,7 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V } public void updateStartAutopilotBtnStatus(boolean isClickable){ + if (mContext == null) return; if (isClickable){ mStartAutopilotBtn.setTextColor( mContext.getResources().getColor(R.color.taxi_p_start_autopilot_txt_color)); @@ -259,6 +261,7 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V } private void updateStatusCountDownOver() { + if (mContext == null) return; isStarting = false; startingCarBgAnimatorDrawable(false); mStartAutopilotBtn.setText( @@ -273,4 +276,14 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V mContext = null; super.onDetachedFromWindow(); } + + @Override + protected void onAttachedToWindow() { + super.onAttachedToWindow(); + try { + mContext = AbsMogoApplication.getApp(); + }catch (Exception e){ + e.printStackTrace(); + } + } } diff --git a/OCH/mogo-och-taxi/src/main/assets/map_style.data b/OCH/mogo-och-taxi/src/main/assets/map_style.data new file mode 100644 index 0000000000..b200669659 Binary files /dev/null and b/OCH/mogo-och-taxi/src/main/assets/map_style.data differ diff --git a/OCH/mogo-och-taxi/src/main/assets/map_style_extra.data b/OCH/mogo-och-taxi/src/main/assets/map_style_extra.data new file mode 100644 index 0000000000..7aa8fa7b45 Binary files /dev/null and b/OCH/mogo-och-taxi/src/main/assets/map_style_extra.data differ diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/callback/IOCHTaxiAutopilotPlanningCallback.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/callback/IOCHTaxiAutopilotPlanningCallback.java new file mode 100644 index 0000000000..bdd1d074cc --- /dev/null +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/callback/IOCHTaxiAutopilotPlanningCallback.java @@ -0,0 +1,15 @@ +package com.mogo.och.taxi.callback; + + +import com.amap.api.maps.model.LatLng; + +import java.util.List; + +/** + * @author: wangmingjun + * @date: 2021/11/1 + */ +public interface IOCHTaxiAutopilotPlanningCallback { + void setLineMarker(List models); + void routeResult(List models, int haveArrivedIndex); +} \ No newline at end of file diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/callback/ITaxiAutopilotPlanningCallback.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/callback/ITaxiAutopilotPlanningCallback.java deleted file mode 100644 index 32226d2dd4..0000000000 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/callback/ITaxiAutopilotPlanningCallback.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.mogo.och.taxi.callback; - - -import java.util.List; - -import mogo.telematics.pad.MessagePad; - -/** - * @author: wangmingjun - * @date: 2021/11/1 - */ -public interface ITaxiAutopilotPlanningCallback { - void routeResult(List models); -} \ No newline at end of file diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/callback/ITaxiOrderStatusCallback.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/callback/ITaxiOrderStatusCallback.java index d10920b8d1..af980f8aea 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/callback/ITaxiOrderStatusCallback.java +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/callback/ITaxiOrderStatusCallback.java @@ -48,4 +48,11 @@ public interface ITaxiOrderStatusCallback { // 司机已确认开启自动驾驶环境 void onDriverHasCheckedPilotCondition(boolean isSafe); + + /** + * 导航到目的地 + * @param isAmap 是否是高德导航 + * @param isVoicePlay 是否播报声音 + */ + void onNaviToEnd(boolean isAmap, boolean isVoicePlay); } diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/TaxiModel.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/TaxiModel.java index cc319f4954..d14ffa65a2 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/TaxiModel.java +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/TaxiModel.java @@ -39,6 +39,7 @@ import com.mogo.och.common.module.biz.constant.OchCommonConst; import com.mogo.och.common.module.biz.network.OchCommonServiceCallback; import com.mogo.och.common.module.biz.provider.LoginService; import com.mogo.och.common.module.manager.OCHAdasAbilityManager; +import com.mogo.och.common.module.map.AmapNaviToDestinationModel; import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil; import com.mogo.och.common.module.utils.PinYinUtil; import com.mogo.och.common.module.utils.ToastUtilsOch; @@ -55,6 +56,7 @@ import com.mogo.och.taxi.bean.OrdersNewBookingQueryRespBean; import com.mogo.och.taxi.bean.QueryOrderRouteResp; import com.mogo.och.taxi.bean.TaxiDataBaseRespBean; import com.mogo.och.taxi.bean.TaxiOrPassengerReadyReqBean; +import com.mogo.och.taxi.callback.IOCHTaxiAutopilotPlanningCallback; import com.mogo.och.taxi.callback.ITaxiADASStatusCallback; import com.mogo.och.taxi.callback.ITaxiCarStatusCallback; import com.mogo.och.taxi.callback.ITaxiControllerStatusCallback; @@ -117,6 +119,7 @@ public class TaxiModel { private ITaxiCarStatusCallback mCarStatusCallback; //Model->Presenter:接单状态、登录状态和司机今日接单状态 private ITaxiControllerStatusCallback mControllerStatusCallback; //Model->Presenter:VR mode等 private ITaxiOrderStatusCallback mOrderStatusCallback; //Model->Presenter:订单变更 + private IOCHTaxiAutopilotPlanningCallback mAutopilotPlanningCallback; private volatile boolean isRestartAutopilot = false; @@ -129,6 +132,11 @@ public class TaxiModel { private TaxiModel() { } + public void setMoGoAutopilotPlanningListener(IOCHTaxiAutopilotPlanningCallback + moGoAutopilotPlanningCallback) { + this.mAutopilotPlanningCallback = moGoAutopilotPlanningCallback; + } + public void setADASStatusCallback(ITaxiADASStatusCallback callback) { this.mADASStatusCallback = callback; } @@ -1243,12 +1251,25 @@ public class TaxiModel { } if (null != routeList && routeList.getWayPointsList().size() > 0) { updateOrderRoute(routeList.getWayPointsList()); + setRouteLineMarker(routeList.getWayPointsList()); updateOrderRouteInfo(routeList.getWayPointsList()); } } }; + /** + * 设置路径规划起终点 + * @param models + */ + private void setRouteLineMarker(List models) { + List latLngModels = CoordinateCalculateRouteUtil + .coordinateConverterWgsToGcjListCommon(mContext,models); + if (mAutopilotPlanningCallback != null){ + mAutopilotPlanningCallback.setLineMarker(latLngModels); + } + } + /** * 上报订单全路径规划数据 * @@ -1319,6 +1340,7 @@ public class TaxiModel { } //开启实时计算剩余距离,剩余时间,预计时间 startOrStopCalculateRouteInfo(true); + AmapNaviToDestinationModel.getInstance(mContext).destroyAmaNavi(); } private void reportTotalDisAndTime() { @@ -1360,6 +1382,18 @@ public class TaxiModel { } reportOrderRemain((long) lastSumLength, (long) lastTime); + + routeAndWipe(); + } + } + + private void routeAndWipe() { + if (mRoutePoints != null && mRoutePoints.size() > 0){ + int haveArrivedIndex = CoordinateCalculateRouteUtil + .getArrivedPointIndex(mRoutePoints,mLongitude,mLatitude); + if (mAutopilotPlanningCallback != null){ + mAutopilotPlanningCallback.routeResult(mRoutePoints,haveArrivedIndex); + } } } @@ -1407,12 +1441,12 @@ public class TaxiModel { } /** - * 上报订单剩余里程和时间 单位:KM, M, 单位:分钟 + * 上报订单剩余里程和时间 单位:KM, M, 单位:秒 * * @param lastSumLength * @param duration */ - private void reportOrderRemain(long lastSumLength, long duration) {// 米/分钟 + public void reportOrderRemain(long lastSumLength, long duration) {// 米/秒 if (mCurrentOCHOrder == null) return; TaxiServiceManager.reportOrderRemain(mContext, mCurrentOCHOrder.orderNo , lastSumLength, duration, new OchCommonServiceCallback() { @@ -1530,9 +1564,6 @@ public class TaxiModel { , new OchCommonServiceCallback() { @Override public void onSuccess(TaxiDataBaseRespBean data) { -// if (null != data && 0 == data.code){ -// updateOrderStatus(TaxiOrderStatusEnum.JourneyCompleted); -// } } @Override @@ -1546,4 +1577,17 @@ public class TaxiModel { public void logout() { loginService.loginOut(mLatitude,mLongitude); } + + //导航去订单终点目的地 + public void startNaviToEndStation(boolean isVoicePlay){ + if (mRoutePoints.size() > 0 ){ //使用自驾轨迹 + if (mOrderStatusCallback != null){ + mOrderStatusCallback.onNaviToEnd(false,isVoicePlay); + } + }else {//使用高的导航 + if (mOrderStatusCallback != null){ + mOrderStatusCallback.onNaviToEnd(true,isVoicePlay); + } + } + } } diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/presenter/NaviPresenter.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/presenter/NaviPresenter.java new file mode 100644 index 0000000000..8cb3205aa9 --- /dev/null +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/presenter/NaviPresenter.java @@ -0,0 +1,80 @@ +package com.mogo.och.taxi.presenter; + +import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI; + +import android.os.Looper; + +import androidx.annotation.NonNull; +import androidx.lifecycle.LifecycleOwner; + +import com.amap.api.maps.model.LatLng; +import com.mogo.commons.AbsMogoApplication; +import com.mogo.commons.mvp.Presenter; +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; +import com.mogo.eagle.core.utilcode.util.UiThreadHandler; +import com.mogo.och.taxi.callback.IOCHTaxiAutopilotPlanningCallback; +import com.mogo.och.taxi.model.TaxiModel; +import com.mogo.och.taxi.ui.TaxiRottingNaviFragment; + +import java.util.List; + +/** + * @author congtaowang + * @since 2021/1/18 + * + * 描述 + */ +public class NaviPresenter extends Presenter implements IOCHTaxiAutopilotPlanningCallback { + + private static final String TAG = NaviPresenter.class.getSimpleName(); + + public NaviPresenter(TaxiRottingNaviFragment view) { + super(view); + TaxiModel.getInstance().init(AbsMogoApplication.getApp()); + initListeners(); + } + + @Override + public void onCreate( @NonNull LifecycleOwner owner ) { + super.onCreate( owner ); + CallerLogger.INSTANCE.d( M_TAXI + TAG, " onCreate" ); + } + + @Override + public void onDestroy( @NonNull LifecycleOwner owner ) { + super.onDestroy( owner ); + + releaseListeners(); + TaxiModel.getInstance().release(); + } + + private void initListeners() { + TaxiModel.getInstance().setMoGoAutopilotPlanningListener(this); + } + + private void releaseListeners() { + TaxiModel.getInstance().setMoGoAutopilotPlanningListener(null); + } + + private void runOnUIThread( Runnable executor ) { + if ( executor == null ) { + return; + } + if ( Looper.myLooper() != Looper.getMainLooper() ) { + UiThreadHandler.post( executor ); + } else { + executor.run(); + } + } + + @Override + public void setLineMarker(List models) { + if (models == null) return; + runOnUIThread(() -> mView.setLineMarker(models)); + } + + @Override + public void routeResult(List models, int haveArrivedIndex) { + mView.routeResult(models,haveArrivedIndex); + } +} diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/presenter/TaxiPresenter.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/presenter/TaxiPresenter.java index b6cdb73c6b..2cd80ce226 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/presenter/TaxiPresenter.java +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/presenter/TaxiPresenter.java @@ -10,6 +10,7 @@ import androidx.annotation.NonNull; import androidx.annotation.RequiresApi; import androidx.lifecycle.LifecycleOwner; +import com.amap.api.maps.model.LatLng; import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.mvp.Presenter; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; @@ -19,6 +20,7 @@ import com.mogo.och.common.module.biz.bean.DriverStatusQueryRespBean; import com.mogo.och.common.module.biz.callback.ILoginCallback; import com.mogo.och.common.module.biz.constant.LoginStatusManager; import com.mogo.och.common.module.manager.OCHAdasAbilityManager; +import com.mogo.och.taxi.callback.IOCHTaxiAutopilotPlanningCallback; import com.mogo.och.taxi.constant.TaxiConst; import com.mogo.och.taxi.constant.TaxiDriverRoleEnum; import com.mogo.och.taxi.constant.TaxiOrderStatusEnum; @@ -75,7 +77,6 @@ public class TaxiPresenter extends Presenter implements ITaxiADASS TaxiModel.getInstance().setCarStatusCallback(this); TaxiModel.getInstance().setControllerStatusCallback(this); TaxiModel.getInstance().setOrderStatusCallback(this); - OCHAdasAbilityManager.getInstance().release(); } private void releaseListeners() { @@ -83,6 +84,7 @@ public class TaxiPresenter extends Presenter implements ITaxiADASS TaxiModel.getInstance().setCarStatusCallback(null); TaxiModel.getInstance().setControllerStatusCallback(null); TaxiModel.getInstance().setOrderStatusCallback(null); + OCHAdasAbilityManager.getInstance().release(); } private void runOnUIThread( Runnable executor ) { @@ -180,6 +182,14 @@ public class TaxiPresenter extends Presenter implements ITaxiADASS TaxiModel.getInstance().logout(); } + //导航去订单目的地 + public void startNaviToEndStation(boolean isVoicePlay){ + TaxiModel.getInstance().startNaviToEndStation(isVoicePlay); + } + + public void reportToEndDisAndTime(long lastSumLength, long duration){//米/秒 + TaxiModel.getInstance().reportOrderRemain(lastSumLength,duration); + } @Override public void onAutopilotArriveEnd() { @@ -268,7 +278,6 @@ public class TaxiPresenter extends Presenter implements ITaxiADASS @Override public void onCurrentOrderDistToStartChanged(long meters, long timeInSecond) { - runOnUIThread(() -> mView.onCurrentOrderDistToStartChanged(meters,timeInSecond)); } @Override @@ -306,6 +315,11 @@ public class TaxiPresenter extends Presenter implements ITaxiADASS runOnUIThread(() -> mView.onCheckPilotConditionSafe(isSafe)); } + @Override + public void onNaviToEnd(boolean isAmap, boolean isVoicePlay) { + runOnUIThread( () -> mView.onNaviToEnd(isAmap,isVoicePlay)); + } + @Override public void onVRModeChanged(boolean isVRMode) { runOnUIThread(() -> mView.switchVRFlatMode(isVRMode)); diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/BaseTaxiTabFragment.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/BaseTaxiTabFragment.java index 54ee62dd60..e486a42f0b 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/BaseTaxiTabFragment.java +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/BaseTaxiTabFragment.java @@ -21,7 +21,6 @@ import androidx.annotation.Nullable; import androidx.constraintlayout.widget.Group; import androidx.fragment.app.FragmentTransaction; -import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.mvp.IView; import com.mogo.commons.mvp.MvpFragment; import com.mogo.commons.mvp.Presenter; @@ -34,19 +33,15 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListener import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager; 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.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.util.ToastUtils; 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.constants.DataTypes; import com.mogo.module.common.view.OnPreventFastClickListener; import com.mogo.och.common.module.utils.AnimatorDrawableUtil; import com.mogo.och.taxi.R; -import com.mogo.och.taxi.constant.TaxiConst; import java.util.Arrays; @@ -81,7 +76,8 @@ public abstract class BaseTaxiTabFragment { - showNaviToStartStationFragment(false); + showAmapNaviToStationFragment(false); }); } @@ -567,30 +563,75 @@ public abstract class BaseTaxiTabFragment 用车"; } mOrderOtherContent3.setText(Html.fromHtml(strHtml1)); - mOrderStartStationLat = order.startSiteGcjPoint.get(1); - mOrderStartStationLng = order.startSiteGcjPoint.get(0); } }catch (NullPointerException e){ //可能会出现订单信息已经轮询回来,但进行中页面控件还未初始化完成的情况 TaxiModel.getInstance().clearCurrentOCHOrder(); @@ -339,21 +341,22 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement } } - private void startNaviToStartStation(boolean isShow, double orderStartStationLat, double orderStartStationLng) { - NaviToDestinationModel.getInstance(getContext()).destroyAmaNavi(); + private void startNaviToStation(boolean isVoicePlay, double stationLat, double stationLng) { + AmapNaviToDestinationModel.getInstance(getContext()).destroyAmaNavi(); CallerLogger.INSTANCE.d(M_TAXI + TAG, "currentLatLng=" + mTaxiFragment.mCurLatitude + " " + mTaxiFragment.mCurLongitude); NaviLatLng startNaviLatLng = new NaviLatLng(mTaxiFragment.mCurLatitude, mTaxiFragment.mCurLongitude); - NaviLatLng endNaviLatLng = new NaviLatLng(orderStartStationLat, orderStartStationLng); - NaviToDestinationModel.getInstance(getContext()).initAMapNavi(startNaviLatLng, endNaviLatLng); - NaviToDestinationModel.getInstance(getContext()).setVoiceIsMute(isShow); - NaviToDestinationModel.getInstance(getContext()).setOCHTaciNaviChangedCallback(this); + NaviLatLng endNaviLatLng = new NaviLatLng(stationLat, stationLng); + AmapNaviToDestinationModel.getInstance(getContext()).initAMapNavi(startNaviLatLng, endNaviLatLng); + AmapNaviToDestinationModel.getInstance(getContext()).setVoiceIsMute(isVoicePlay); + AmapNaviToDestinationModel.getInstance(getContext()).setOCHTaciNaviChangedCallback(this); } private void showOrHideNavi(boolean isShow) { if (!isShow) { - mNaviIcon.setVisibility(View.GONE); - NaviToDestinationModel.getInstance(getContext()).destroyAmaNavi(); - mTaxiFragment.showNaviToStartStationFragment(false); + mNaviStartIcon.setVisibility(View.GONE); + mNaviToEndIcon.setVisibility(View.GONE); + AmapNaviToDestinationModel.getInstance(getContext()).destroyAmaNavi(); + mTaxiFragment.showAmapNaviToStationFragment(false); } } @@ -379,11 +382,18 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement String strHtml2 = "里程 " + "" + dis + "" + " "+disUnit+"" + ",剩余 " + "" + min + "" + " 分钟"; - if (mContentModule3 != null && mContentModule3.getVisibility() == View.VISIBLE) { //前往上车点 + if (mCurrentOrder != null && mCurrentOrder.orderStatus == TaxiOrderStatusEnum.OnTheWayToStart.getCode()) { //前往上车点 mDistanceAndTime3.setText(Html.fromHtml(strHtml2)); - mNaviIcon.setVisibility(View.VISIBLE); - } else if (mContentModule2 != null && mContentModule2.getVisibility() == View.VISIBLE) { //前往终点 时间单位是分钟 + if (mNaviStartIcon.getVisibility() == View.GONE){ + mNaviStartIcon.setVisibility(View.VISIBLE); + } + + } else if (mCurrentOrder != null && mCurrentOrder.orderStatus == TaxiOrderStatusEnum.OnTheWayToEnd.getCode()) { //前往终点 时间单位是分钟 + if (mNaviToEndIcon.getVisibility() == View.GONE){ + mNaviToEndIcon.setVisibility(View.VISIBLE); + } + if (mTtsLessThan200Tip < 1 && meters <= 250 && meters > 150){ speekVoice200mTipsOnce(); } @@ -427,7 +437,7 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement @Override public void onDestroyView() { super.onDestroyView(); - NaviToDestinationModel.getInstance(getContext()).destroyAmaNavi(); + AmapNaviToDestinationModel.getInstance(getContext()).destroyAmaNavi(); } private void startOrEndService() { @@ -463,8 +473,9 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement showNotice(mActivity.getString(R.string.module_och_taxi_new_order)); mTtsLessThan200Tip = 0; isFirstStartAutopilotDone = true; - startNaviToStartStation(false, mOrderStartStationLat, mOrderStartStationLng); - showOrHideNavi(true); + double orderStartStationLat = order.startSiteGcjPoint.get(1); + double orderStartStationLng = order.startSiteGcjPoint.get(0); + startNaviToStation(false, orderStartStationLat, orderStartStationLng); setOrRemoveMapMaker(true, TaxiConst.TAXI_START_MAP_MAKER,order.startSitePoint,R.raw.star_marker); setOrRemoveMapMaker(true, TaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint,R.raw.end_marker); break; @@ -496,7 +507,12 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement case OnTheWayToEnd: // showNotice("欢迎使用蘑菇智行"); mOrderCancel.setVisibility(View.VISIBLE); - showOrHideNavi(false); +// double orderEndStationLat = order.endSiteGcjPoint.get(1); +// double orderEndStationLng = order.endSiteGcjPoint.get(0); +// startNaviToStation(false, orderEndStationLat, orderEndStationLng); + if (mTaxiFragment != null) { + showNaviToEndStationFragment(false); + } setOrRemoveMapMaker(false, TaxiConst.TAXI_START_MAP_MAKER,order.startSitePoint,R.raw.star_marker); setOrRemoveMapMaker(true, TaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint,R.raw.end_marker); break; @@ -556,11 +572,15 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement } else if (v.getId() == R.id.module_och_taxi_order_cancel_iv) { new TaxiOrderCancelDialog(mTaxiFragment, mActivity, mOrderNo, saveOrderState).show(); } else if (v.getId() == R.id.module_och_taxi_navi_iv) { - // TODO: 2021/11/30 打开去往乘客上车点的导航页面 if (mTaxiFragment != null) { showNaviToStartStationFragment(true); } - } else if (v.getId() == R.id.taxi_start_by_auto){//自驾模式 + } else if (v.getId() == R.id.module_och_taxi_navi_end_iv){ + // TODO: 2021/11/30 打开去往乘客下车点的导航页面 + if (mTaxiFragment != null) { + showNaviToEndStationFragment(true); + } + }else if (v.getId() == R.id.taxi_start_by_auto){//自驾模式 CallerLogger.INSTANCE.d(M_TAXI + TAG, "自驾模式"); mOrderStartModeBtn.setTag(0); startOrEndService(); @@ -577,8 +597,23 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement * @param isShow */ private void showNaviToStartStationFragment(boolean isShow) { - mTaxiFragment.showNaviToStartStationFragment(isShow); - startNaviToStartStation(isShow, mOrderStartStationLat, mOrderStartStationLng); + if (mCurrentOrder != null && + mCurrentOrder.orderStatus == TaxiOrderStatusEnum.OnTheWayToStart.getCode()){ + double orderStartStationLat = mCurrentOrder.startSiteGcjPoint.get(1); + double orderStartStationLng = mCurrentOrder.startSiteGcjPoint.get(0); + mTaxiFragment.showAmapNaviToStationFragment(isShow); + startNaviToStation(isShow, orderStartStationLat, orderStartStationLng); + } + } + + /** + * 显示/隐藏 前往乘客目的地的导航 + * + * @param isShow + */ + private void showNaviToEndStationFragment(boolean isShow) { + mTaxiFragment.showAmapNaviToStationFragment(isShow); + mTaxiFragment.startNaviToEndStation(isShow); } @@ -619,37 +654,59 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement @Override public void onCurrentNaviDistAndTimeChanged(int meters, long timeInSecond) { updateDistanceAndTime(meters, timeInSecond); + if (mCurrentOrder != null + && mCurrentOrder.orderStatus == TaxiOrderStatusEnum.OnTheWayToEnd.getCode()){ + mTaxiFragment.reportToEndDisAndTime(meters, timeInSecond); + } } @Override public void reInitNaviAmap(boolean isPlay, boolean isRestart) { CallerLogger.INSTANCE.d(M_TAXI + TAG, "isPlay = " + isPlay + ", isRestart=" + isRestart); if (!isRestart) { - mTaxiFragment.showNaviToStartStationFragment(false); + mTaxiFragment.showAmapNaviToStationFragment(false); return; } - mTaxiFragment.showNaviToStartStationFragment(false); + mTaxiFragment.showAmapNaviToStationFragment(false); UiThreadHandler.postDelayed(new Runnable() { @Override public void run() { - if (saveOrderState == TaxiOrderStatusEnum.OnTheWayToStart.getCode()) { - startNaviToStartStation(false, mOrderStartStationLat, mOrderStartStationLng); + if (mCurrentOrder != null && + mCurrentOrder.orderStatus == TaxiOrderStatusEnum.OnTheWayToStart.getCode()) { + double orderStartStationLat = mCurrentOrder.startSiteGcjPoint.get(1); + double orderStartStationLng = mCurrentOrder.startSiteGcjPoint.get(0); + startNaviToStation(false, orderStartStationLat, orderStartStationLng); } } }, 2000); UiThreadHandler.postDelayed(new Runnable() { @Override public void run() { - if (saveOrderState == TaxiOrderStatusEnum.OnTheWayToStart.getCode()) { - if (mNaviIcon.getVisibility() == View.GONE) { - mNaviIcon.setVisibility(View.VISIBLE); + if (mCurrentOrder != null && + mCurrentOrder.orderStatus == TaxiOrderStatusEnum.OnTheWayToStart.getCode()) { + if (mNaviStartIcon.getVisibility() == View.GONE) { + mNaviStartIcon.setVisibility(View.VISIBLE); + } + } + if (mCurrentOrder != null && + mCurrentOrder.orderStatus == TaxiOrderStatusEnum.OnTheWayToEnd.getCode()){ + if (mNaviToEndIcon.getVisibility() == View.GONE) { + mNaviToEndIcon.setVisibility(View.VISIBLE); } } - } }, 3000); } + public void onNaviToEndAmap(boolean isVoicePlay) { + if (mCurrentOrder != null && + mCurrentOrder.orderStatus == TaxiOrderStatusEnum.OnTheWayToEnd.getCode()){ + double orderEndStationLat = mCurrentOrder.endSiteGcjPoint.get(1); + double orderEndStationLng = mCurrentOrder.endSiteGcjPoint.get(0); + startNaviToStation(isVoicePlay,orderEndStationLat,orderEndStationLng); + } + } + /** * 绘制地图起点终点 * @param isAdd diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/ITaxiMapDirectionView.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/ITaxiMapDirectionView.java new file mode 100644 index 0000000000..cf589373ef --- /dev/null +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/ITaxiMapDirectionView.java @@ -0,0 +1,23 @@ +package com.mogo.och.taxi.ui; + +/** + * @author xiaoyuzhou + * @date 2021/6/24 11:33 上午 + */ +public interface ITaxiMapDirectionView { + + /** + * 绘制路径线 + */ + void drawablePolyline(); + + /** + * 清除路径线 + */ + void clearPolyline(); + + /** + * 设置路径中起终点marker + */ + void setLineMarker(); +} diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiAmapNaviFragment.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiAmapNaviFragment.java new file mode 100644 index 0000000000..f112a4f47a --- /dev/null +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiAmapNaviFragment.java @@ -0,0 +1,217 @@ +package com.mogo.och.taxi.ui; + +import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI; + +import android.os.Bundle; +import android.view.View; + +import com.amap.api.navi.AMapNaviViewListener; +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; +import com.mogo.och.common.module.map.AmapNaviToDestinationModel; +import com.mogo.och.common.module.map.ICommonNaviChangedCallback; +import com.mogo.och.common.module.map.CommonAmapNaviVIew; +import com.mogo.och.taxi.R; + +/** + * @author: wangmingjun + * @date: 2021/11/30 + */ +public class TaxiAmapNaviFragment extends BaseTaxiUIFragment implements AMapNaviViewListener { + + private CommonAmapNaviVIew mAMapNaviView; + private ICommonNaviChangedCallback mNaviToStartInfoCallback; + public static TaxiAmapNaviFragment newInstance() { + + Bundle args = new Bundle(); + + TaxiAmapNaviFragment fragment = new TaxiAmapNaviFragment(); + fragment.setArguments(args); + return fragment; + } + + @Override + protected int getLayoutId() { + return R.layout.taxi_amap_navi_view; + } + + @Override + protected void initViews(View view) { + mAMapNaviView = view.findViewById(R.id.navi_view); + } + + @Override + protected void initViews(Bundle savedInstanceState) { + super.initViews(savedInstanceState); + if (mAMapNaviView != null) + mAMapNaviView.onCreate(savedInstanceState); + } + + @Override + public void onResume() { + super.onResume(); + if (mAMapNaviView != null) + mAMapNaviView.onResume(); + } + + @Override + public void onPause() { + super.onPause(); + if (mAMapNaviView != null) + mAMapNaviView.onPause(); + } + + @Override + public void onDestroy() { + super.onDestroy(); + + AmapNaviToDestinationModel.getInstance(getContext()).setVoiceIsMute(false); + if (mAMapNaviView != null){ + mAMapNaviView.onDestroy(); + } + + if (mNaviToStartInfoCallback != null){ + mNaviToStartInfoCallback = null; + } + } + + @Override + public void onNaviSetting() { + //底部导航设置点击回调 + } + + @Override + public void onNaviCancel() { + } + + @Override + public void onNaviMapMode(int naviMode) { + //导航态车头模式,0:车头朝上状态;1:正北朝上模式。 + } + + @Override + public void onNaviTurnClick() { + //转弯view的点击回调 + } + + @Override + public void onNextRoadClick() { + //下一个道路View点击回调 + } + + + @Override + public void onScanViewButtonClick() { + //全览按钮点击回调 + } + + + @Override + public void onLockMap(boolean isLock) { + //锁地图状态发生变化时回调 + } + + @Override + public void onNaviViewLoaded() { + CallerLogger.INSTANCE.d(M_TAXI + "wlx", "导航页面加载成功"); + CallerLogger.INSTANCE.d(M_TAXI + "wlx", "请不要使用AMapNaviView.getMap().setOnMapLoadedListener();会overwrite导航SDK内部画线逻辑"); + } + + @Override + public void onMapTypeChanged(int i) { + + } + + @Override + public void onNaviViewShowMode(int i) { + + } + + @Override + public boolean onNaviBackClick() { + return false; + } + + /** + * 车道信息说明: + *

+ * 0xFF, 无对应车道 + * 0, 直行 + * 1, 左转 + * 2, 直行+左转 + * 3, 右转 + * 4, 直行+右转 + * 5, 左掉头 + * 6, 左转+右转 + * 7, 直行+左转+右转 + * 8, 右掉头 + * 9, 直行+左掉头 + * 10, 直行+右掉头 + * 11, 左转+左掉头 + * 12, 右转+右掉头 + * 13, 直行+扩展 + * 14, 左转+左掉头+扩展 + * 15, 保留 + * 16, 直行+左转+左掉头 + * 17, 右转+左掉头 + * 18, 左转+右转+左掉头 + * 19, 直行+右转+左掉头 + * 20, 左转+右掉头 + * 21, 公交车道 + * 22, 空车道 + * 23 可变车道 + */ + + String[] array = { + "直行车道" + , "左转车道" + , "左转或直行车道" + , "右转车道" + , "右转或直行车道" + , "左掉头车道" + , "左转或者右转车道" + , " 左转或右转或直行车道" + , "右转掉头车道" + , "直行或左转掉头车道" + , "直行或右转掉头车道" + , "左转或左掉头车道" + , "右转或右掉头车道" + , "直行并且车道扩展" + , "左转+左掉头+扩展" + , "不可以选择该车道" + , "直行+左转+左掉头车道" + , "右转+左掉头" + , "左转+右转+左掉头" + , "直行+右转+左掉头" + , "左转+右掉头" + , "公交车道" + , "空车道" + , "可变车道" + }; + + String[] actions = { + "直行" + , "左转" + , "左转或直行" + , "右转" + , "右转或这行" + , "左掉头" + , "左转或者右转" + , " 左转或右转或直行" + , "右转掉头" + , "直行或左转掉头" + , "直行或右转掉头" + , "左转或左掉头" + , "右转或右掉头" + , "直行并且车道扩展" + , "左转+左掉头+扩展" + , "不可以选择" + , "直行+左转+左掉头" + , "右转+左掉头" + , "左转+右转+左掉头" + , "直行+右转+左掉头" + , "左转+右掉头" + , "公交车道" + , "空车道" + , "可变车道" + }; +} diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiFragment.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiFragment.java index 21ec411aee..219d5090b8 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiFragment.java +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiFragment.java @@ -94,6 +94,11 @@ public class TaxiFragment extends BaseTaxiTabFragment waitServiceList) { if (null == waitServiceList) return; if (null == serverOrdersFragment) return; @@ -341,11 +365,6 @@ public class TaxiFragment extends BaseTaxiTabFragment { + testRouteInfoUpload(); + }); } @Subscribe(threadMode = ThreadMode.MAIN) diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiMapDirectionView.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiMapDirectionView.java new file mode 100644 index 0000000000..6ffc32d42e --- /dev/null +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiMapDirectionView.java @@ -0,0 +1,367 @@ +package com.mogo.och.taxi.ui; + +import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI; + +import android.content.Context; +import android.os.Bundle; +import android.util.AttributeSet; +import android.view.LayoutInflater; +import android.view.MotionEvent; +import android.view.View; +import android.widget.RelativeLayout; + +import androidx.annotation.Nullable; + +import com.amap.api.maps.AMap; +import com.amap.api.maps.CameraUpdate; +import com.amap.api.maps.CameraUpdateFactory; +import com.amap.api.maps.CoordinateConverter; +import com.amap.api.maps.TextureMapView; +import com.amap.api.maps.UiSettings; +import com.amap.api.maps.model.BitmapDescriptor; +import com.amap.api.maps.model.BitmapDescriptorFactory; +import com.amap.api.maps.model.CameraPosition; +import com.amap.api.maps.model.CustomMapStyleOptions; +import com.amap.api.maps.model.LatLng; +import com.amap.api.maps.model.LatLngBounds; +import com.amap.api.maps.model.Marker; +import com.amap.api.maps.model.MarkerOptions; +import com.amap.api.maps.model.Polyline; +import com.amap.api.maps.model.PolylineOptions; +import com.mogo.eagle.core.data.map.MogoLatLng; +import com.mogo.eagle.core.data.map.MogoLocation; +import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener; +import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager; +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; +import com.mogo.och.taxi.R; +import com.mogo.och.taxi.utils.TaxiMapAssetStyleUtil; + +import java.util.ArrayList; +import java.util.List; + +/** + * taxi司机端前往目的地小地图导航 + */ +public class TaxiMapDirectionView + extends RelativeLayout + implements IMoGoMapLocationListener, ITaxiMapDirectionView, AMap.OnCameraChangeListener { + + //小地图名称 + public static final String TAG = "TPMapDirectionView"; + + private TextureMapView mAMapNaviView; + private AMap mAMap; + private Marker mCarMarker; + private Marker mStartMarker; + private Marker mEndMarker; + + private int zoomLevel = 13; + private List mCoordinatesLatLng = new ArrayList<>(); + private Polyline mPolyline; + private CameraUpdate mCameraUpdate; + private Context mContext; + private int mHaveArrivedIndex; + + List textureList = new ArrayList<>(); + List texIndexList = new ArrayList<>(); + + private BitmapDescriptor mArrivedRes; + private BitmapDescriptor mUnArrivedRes; + + public TaxiMapDirectionView(Context context) { + this(context, null); + } + + public TaxiMapDirectionView(Context context, @Nullable AttributeSet attrs) { + this(context, attrs, 0); + } + + public TaxiMapDirectionView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + try { + initView(context); + } catch (Exception e) { + e.printStackTrace(); + } + } + + + private void initView(Context context) { + CallerLogger.INSTANCE.d(M_TAXI + TAG, "initView"); + + mContext = context; + + View smpView = LayoutInflater.from(context).inflate(R.layout.taxi_map_view, this); + + mAMapNaviView = (TextureMapView) smpView.findViewById(R.id.taxi_amap_view); + + initAMapView(); + + // 注册定位监听 + CallerMapLocationListenerManager.INSTANCE.addListener(TAG, this, false); + } + + @Override + protected void onDetachedFromWindow() { + super.onDetachedFromWindow(); + // 注册定位监听 + CallerMapLocationListenerManager.INSTANCE.removeListener(TAG, false); + } + + private void initAMapView() { + mCameraUpdate = CameraUpdateFactory.zoomTo(zoomLevel); + mAMap = mAMapNaviView.getMap(); + // 设置导航地图模式,aMap是地图控制器对象。 + mAMap.setMapType(AMap.MAP_TYPE_NIGHT); + + // 关闭显示实时路况图层,aMap是地图控制器对象。 + mAMap.setTrafficEnabled(false); + + // 设置 锚点 图标 + mCarMarker = mAMap.addMarker(new MarkerOptions() + .icon(BitmapDescriptorFactory.fromResource(R.drawable.taxi_map_car)) + .anchor(0.5f, 0.5f)); + mStartMarker = mAMap.addMarker(new MarkerOptions() + .icon(BitmapDescriptorFactory.fromResource(R.drawable.taxi_map_view_dir_start))); + mEndMarker = mAMap.addMarker(new MarkerOptions() + .icon(BitmapDescriptorFactory.fromResource(R.drawable.taxi_map_view_dir_end))); + + mArrivedRes = BitmapDescriptorFactory.fromResource(R.drawable.taxi_map_arrow_arrived); + mUnArrivedRes = BitmapDescriptorFactory.fromResource(R.drawable.taxi_map_arrow_un_arrive); + + // 加载自定义样式 + CustomMapStyleOptions customMapStyleOptions = new CustomMapStyleOptions() + .setEnable(true) + .setStyleData(TaxiMapAssetStyleUtil.getAssetsStyle(getContext(),"map_style.data")) + .setStyleExtraData(TaxiMapAssetStyleUtil.getAssetsExtraStyle(getContext(),"map_style_extra.data")); + // 设置自定义样式 + mAMap.setCustomMapStyle(customMapStyleOptions); + + //设置希望展示的地图缩放级别 + mAMap.moveCamera(mCameraUpdate); + + // 设置地图的样式 + UiSettings uiSettings = mAMap.getUiSettings(); + uiSettings.setZoomControlsEnabled(false);// 地图缩放级别的交换按钮 + uiSettings.setAllGesturesEnabled(false);// 所有手势 + uiSettings.setMyLocationButtonEnabled(false); // 显示默认的定位按钮 + uiSettings.setLogoBottomMargin(-150); //设置Logo下边界距离屏幕底部的边距,设置为负值即可 + + mAMap.setOnMapLoadedListener(new AMap.OnMapLoadedListener() { + @Override + public void onMapLoaded() { + CallerLogger.INSTANCE.d(M_TAXI + TAG, "smp---onMapLoaded"); + // 加载自定义样式 + CustomMapStyleOptions customMapStyleOptions = new CustomMapStyleOptions() + .setEnable(true) + .setStyleData(TaxiMapAssetStyleUtil.getAssetsStyle(getContext(),"map_style.data")) + .setStyleExtraData(TaxiMapAssetStyleUtil.getAssetsExtraStyle(getContext(),"map_style_extra.data")); + // 设置自定义样式 + mAMap.setCustomMapStyle(customMapStyleOptions); + mAMapNaviView.getMap().setPointToCenter(mAMapNaviView.getWidth() / 2, mAMapNaviView.getHeight() / 2); + } + }); + + //设置地图状态的监听接口 + mAMap.setOnCameraChangeListener(this); + } + + + @Override + public boolean onInterceptTouchEvent(MotionEvent ev) { + return true; + } + + + @Override + public void onLocationChanged(@org.jetbrains.annotations.Nullable MogoLocation location, int from, boolean isGps) { + if (location == null){ + return; + } + LatLng currentLatLng = new LatLng(location.getLatitude(), location.getLongitude()); + + if (mCoordinatesLatLng.size() > 1) { + //圈定地图显示范围 + LatLng endLatLng = mCoordinatesLatLng.get(mCoordinatesLatLng.size() - 1); + //存放经纬度 + LatLngBounds.Builder boundsBuilder = new LatLngBounds.Builder(); + boundsBuilder.include(currentLatLng); + boundsBuilder.include(endLatLng); + //第二个参数为四周留空宽度 + mAMap.moveCamera(CameraUpdateFactory.newLatLngBoundsRect(boundsBuilder.build(), 100,100,100,100)); +// CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "onCarLocationChanged2--moveCamera :" + location.getLatitude()+", "+location.getLongitude()); + + } else { + //设置希望展示的地图缩放级别 + CameraPosition cameraPosition = new CameraPosition.Builder() + .target(mCarMarker.getPosition()).tilt(0).bearing(location.getBearing()).zoom(zoomLevel).build(); + mAMap.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)); + } + //更新车辆位置 + if (mCarMarker != null) { +// CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "location.getBearing() = " + location.getBearing()); + mCarMarker.setRotateAngle(360 - location.getBearing()); + mCarMarker.setPosition(currentLatLng); +// CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "onCarLocationChanged2--loacation :" + location.getLatitude()+", "+location.getLongitude()); + mCarMarker.setToTop(); + } + } + + @Override + public void setLineMarker() { + if (mStartMarker != null) { + mStartMarker.setVisible(false); + } + if (mEndMarker != null) { + mEndMarker.setVisible(false); + } + if (mCoordinatesLatLng.size() > 2) { + // 设置开始结束Marker位置 + LatLng startLatLng = mCoordinatesLatLng.get(0); + LatLng endLatLng = mCoordinatesLatLng.get(mCoordinatesLatLng.size() - 1); + + mStartMarker.setPosition(startLatLng); + mEndMarker.setPosition(endLatLng); + mStartMarker.setVisible(true); + mEndMarker.setVisible(true); + } + } + + @Override + public void drawablePolyline() { + if (mPolyline != null) { + mPolyline.remove(); + } + if (mAMap != null) { + + addRouteColorList(); + + if (mCoordinatesLatLng.size() > 2) { + //设置线段纹理 + PolylineOptions polylineOptions = new PolylineOptions(); + polylineOptions.addAll(mCoordinatesLatLng); + polylineOptions.setUseTexture(true); + polylineOptions.width(15); + polylineOptions.lineCapType(PolylineOptions.LineCapType.LineCapRound); + polylineOptions.setCustomTextureList(textureList); + polylineOptions.setCustomTextureIndex(texIndexList); +// polylineOptions.setCustomTexture(BitmapDescriptorFactory.fromResource(R.drawable.taxi_p_map_arrow_un_arrive)); + + // 绘制线 + mPolyline = mAMap.addPolyline(polylineOptions); + + } + } + } + + /** + * 添加画线颜色值 + */ + private void addRouteColorList() { + textureList.clear(); + texIndexList.clear(); + for (int i = 0; i < mCoordinatesLatLng.size(); i++){ + if (i <= mHaveArrivedIndex){ + textureList.add(mArrivedRes); + }else { + textureList.add(mUnArrivedRes); + } + texIndexList.add(i); + } + } + + + public LatLng CoordinateConverterFrom84(Context mContext, MogoLatLng mogoLatLng) { + CoordinateConverter mCoordinateConverter = new CoordinateConverter(mContext); + mCoordinateConverter.from(CoordinateConverter.CoordType.GPS); + mCoordinateConverter.coord(new LatLng(mogoLatLng.lat, mogoLatLng.lon)); + LatLng latLng = mCoordinateConverter.convert(); + return latLng; + } + + public List CoordinateConverterFrom84ForList(Context mContext, List mogoLatLngList) { + List list = new ArrayList<>(); + for (MogoLatLng m : mogoLatLngList) { + LatLng mogoLatLng = CoordinateConverterFrom84(mContext, m); + list.add(mogoLatLng); + } + return list; + } + + @Override + public void clearPolyline() { + if (mPolyline != null) { + mPolyline.remove(); + } + if (mStartMarker != null) { + mStartMarker.setVisible(false); + } + if (mEndMarker != null) { + mEndMarker.setVisible(false); + } + } + + public void resetPolyine() { + mCoordinatesLatLng.clear(); + if (mPolyline != null) { + mPolyline.remove(); + } + if (mStartMarker != null) { + mStartMarker.setVisible(false); + } + if (mEndMarker != null) { + mEndMarker.setVisible(false); + } + } + + public void onCreateView(Bundle savedInstanceState) { + if (mAMapNaviView != null) { + mAMapNaviView.onCreate(savedInstanceState); + } + } + + public void onResume() { + if (mAMapNaviView != null) { + mAMapNaviView.onResume(); + } + } + + public void onPause() { + if (mAMapNaviView != null) { + mAMapNaviView.onPause(); + } + } + + public void onDestroy() { + if (mAMapNaviView != null) { + mAMapNaviView.onDestroy(); + } + } + + public void convert(List coordinates) { + mCoordinatesLatLng.clear(); + List latLngs = CoordinateConverterFrom84ForList(mContext, coordinates); + mCoordinatesLatLng.addAll(latLngs); + } + + public void setCoordinatesLatLng(List latLngs){ + mCoordinatesLatLng.clear(); + mCoordinatesLatLng.addAll(latLngs); + } + + public void setCoordinatesLatLng(List latLngs, int haveArrivedIndex){ + mCoordinatesLatLng.clear(); + mCoordinatesLatLng.addAll(latLngs); + mHaveArrivedIndex = haveArrivedIndex; + } + + @Override + public void onCameraChange(CameraPosition cameraPosition) { + + } + + @Override + public void onCameraChangeFinish(CameraPosition cameraPosition) { + + } +} diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiNaviFragment.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiNaviFragment.java deleted file mode 100644 index fd629e6f51..0000000000 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiNaviFragment.java +++ /dev/null @@ -1,310 +0,0 @@ -package com.mogo.och.taxi.ui; - -import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI; - -import android.graphics.BitmapFactory; -import android.os.Bundle; -import android.view.View; - -import com.amap.api.maps.AMap; -import com.amap.api.maps.model.CustomMapStyleOptions; -import com.amap.api.navi.AMapNaviView; -import com.amap.api.navi.AMapNaviViewListener; -import com.amap.api.navi.AMapNaviViewOptions; -import com.amap.api.navi.model.RouteOverlayOptions; -import com.mogo.eagle.core.utilcode.mogo.MapAssetStyleUtils; -import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; -import com.mogo.och.taxi.R; -import com.mogo.och.taxi.callback.ITaxiNaviChangedCallback; -import com.mogo.och.taxi.model.NaviToDestinationModel; - -/** - * @author: wangmingjun - * @date: 2021/11/30 - */ -public class TaxiNaviFragment extends BaseTaxiUIFragment implements AMapNaviViewListener, View.OnClickListener { - - private AMapNaviView mAMapNaviView; -// private OverviewButtonView mOverviewButtonView; -// private NextTurnTipView mNextTurnTipView; - private AMap aMap; - private ITaxiNaviChangedCallback mNaviToStartInfoCallback; // 前往乘客上车点 - public static TaxiNaviFragment newInstance() { - - Bundle args = new Bundle(); - - TaxiNaviFragment fragment = new TaxiNaviFragment(); - fragment.setArguments(args); - return fragment; - } - - @Override - protected int getLayoutId() { - return R.layout.taxi_navi_view; - } - - @Override - protected void initViews(View view) { - view.bringToFront(); - initMapView(view); - } - - private void initMapView(View view) { -// mOverviewButtonView = view.findViewById(R.id.navi_overviewbuttonview); -// mAMapNaviView.setLazyOverviewButtonView(mOverviewButtonView); - // mOverviewButtonView.setOnClickListener(this); -// DriveWayView mDriveWayView = view.findViewById(R.id.navi_drivewayview); -// mAMapNaviView.setLazyDriveWayView(mDriveWayView); -// mNextTurnTipView = view.findViewById(R.id.navi_nextturntipview); -// mAMapNaviView.setLazyNextTurnTipView(mNextTurnTipView); - mAMapNaviView = view.findViewById(R.id.navi_view); - mAMapNaviView.setAMapNaviViewListener(this); - //车头向上模式 - mAMapNaviView.setNaviMode(AMapNaviView.CAR_UP_MODE); - aMap = mAMapNaviView.getMap(); - //关闭地图文字显示 - aMap.showMapText(false); - // 设置导航地图模式,aMap是地图控制器对象。 - aMap.setMapType(AMap.MAP_TYPE_NIGHT); - // 关闭显示实时路况图层,aMap是地图控制器对象。 - aMap.setTrafficEnabled(false); - setMapViewOptions(); - new Thread(() -> { - try { - Thread.sleep(1000L); - } catch (InterruptedException e) { - e.printStackTrace(); - } - if (null == getContext()){ - return; - } - aMap.setCustomMapStyle( - new CustomMapStyleOptions() - .setEnable(true) - .setStyleData(MapAssetStyleUtils.getAssetsStyle(getContext(), "over_view_style.data")) - .setStyleExtraData(MapAssetStyleUtils.getAssetsExtraStyle(getContext(), "over_view_style_extra.data")) - ); - - //设置希望展示的地图缩放级别 - }).start(); - } - - private void setMapViewOptions() { - AMapNaviViewOptions options = new AMapNaviViewOptions(); - options.setTilt(0);//设置 2D 模式 - options.setLayoutVisible(false);//设置导航界面UI是否显示。 - options.setTrafficBarEnabled(false);//设置路况光柱条是否显示(只适用于驾车导航,需要联网)。 - options.setAutoLockCar(true);//设置6秒后是否自动锁车 - options.setAutoDisplayOverview(true);//设置是否自动全览模式,即在算路成功后自动进入全览模式 - options.setTrafficLine(false); - options.setModeCrossDisplayShow(true);//设置是否显示路口放大图(路口模型图) - options.setAutoChangeZoom(true);//自动缩放级别 - options.setCarBitmap(BitmapFactory.decodeResource(getContext().getResources(), R.drawable.taxi_navi_arrow_icon)); - options.setFourCornersBitmap(BitmapFactory.decodeResource(this.getResources(), R.drawable.taxi_navi_direction_icon)); - options.setAutoChangeZoom(true);//设置是否开启动态比例尺 (锁车态下自动进行地图缩放变化) -// options.setZoom(18);//14-18 -// options.setTrafficInfoUpdateEnabled(false); -// options.setTrafficLayerEnabled(false);//设置[实时交通图层开关按钮]是否显示(只适用于驾车导航,需要联网)。 -// options.setCameraInfoUpdateEnabled(false); -// options.setCompassEnabled(false);//设置指南针图标否在导航界面显示,默认显示。 -// options.setLaneInfoShow(false);// 设置是否显示道路信息view -// options.setNaviArrowVisible(false);//设置路线转向箭头隐藏和显示 -// options.setRealCrossDisplayShow(false);//设置是否显示路口放大图(实景图) -// options.setRouteListButtonShow(true);//设置导航界面是否显示路线全览按钮。 -// options.setSettingMenuEnabled(false);//设置菜单按钮是否在导航界面显示。 - - RouteOverlayOptions routeOverlayOptions = new RouteOverlayOptions(); - -// routeOverlayOptions.setArrowOnTrafficRoute(BitmapFactory.decodeResource(getResources(),R.drawable.custtexture_aolr)); - routeOverlayOptions.setNormalRoute(BitmapFactory.decodeResource(getResources(), R.drawable.taxi_navi_line_icon)); - options.setRouteOverlayOptions(routeOverlayOptions); - - mAMapNaviView.setViewOptions(options); - } - public void goToOverview(){ - if (mAMapNaviView.isRouteOverviewNow()){ - mAMapNaviView.recoverLockMode(); - }else { - mAMapNaviView.displayOverview(); - } - } - - @Override - public void onClick(View v) { -// if (v.getId() == R.id.navi_overviewbuttonview){ -// goToOverview(); -// } - } - @Override - protected void initViews(Bundle savedInstanceState) { - super.initViews(savedInstanceState); - mAMapNaviView.onCreate(savedInstanceState); - } - - @Override - public void onResume() { - super.onResume(); - mAMapNaviView.onResume(); - } - - @Override - public void onPause() { - super.onPause(); - mAMapNaviView.onPause(); - } - - @Override - public void onDestroy() { - super.onDestroy(); - - NaviToDestinationModel.getInstance(getContext()).setVoiceIsMute(false); - if (mAMapNaviView != null){ - mAMapNaviView.onDestroy(); - } - - if (mNaviToStartInfoCallback != null){ - mNaviToStartInfoCallback = null; - } - } - - @Override - public void onNaviSetting() { - //底部导航设置点击回调 - } - - @Override - public void onNaviCancel() { - } - - @Override - public void onNaviMapMode(int naviMode) { - //导航态车头模式,0:车头朝上状态;1:正北朝上模式。 - } - - @Override - public void onNaviTurnClick() { - //转弯view的点击回调 - } - - @Override - public void onNextRoadClick() { - //下一个道路View点击回调 - } - - - @Override - public void onScanViewButtonClick() { - //全览按钮点击回调 - } - - - @Override - public void onLockMap(boolean isLock) { - //锁地图状态发生变化时回调 - } - - @Override - public void onNaviViewLoaded() { - CallerLogger.INSTANCE.d(M_TAXI + "wlx", "导航页面加载成功"); - CallerLogger.INSTANCE.d(M_TAXI + "wlx", "请不要使用AMapNaviView.getMap().setOnMapLoadedListener();会overwrite导航SDK内部画线逻辑"); - } - - @Override - public void onMapTypeChanged(int i) { - - } - - @Override - public void onNaviViewShowMode(int i) { - - } - - @Override - public boolean onNaviBackClick() { - return false; - } - - /** - * 车道信息说明: - *

- * 0xFF, 无对应车道 - * 0, 直行 - * 1, 左转 - * 2, 直行+左转 - * 3, 右转 - * 4, 直行+右转 - * 5, 左掉头 - * 6, 左转+右转 - * 7, 直行+左转+右转 - * 8, 右掉头 - * 9, 直行+左掉头 - * 10, 直行+右掉头 - * 11, 左转+左掉头 - * 12, 右转+右掉头 - * 13, 直行+扩展 - * 14, 左转+左掉头+扩展 - * 15, 保留 - * 16, 直行+左转+左掉头 - * 17, 右转+左掉头 - * 18, 左转+右转+左掉头 - * 19, 直行+右转+左掉头 - * 20, 左转+右掉头 - * 21, 公交车道 - * 22, 空车道 - * 23 可变车道 - */ - - String[] array = { - "直行车道" - , "左转车道" - , "左转或直行车道" - , "右转车道" - , "右转或直行车道" - , "左掉头车道" - , "左转或者右转车道" - , " 左转或右转或直行车道" - , "右转掉头车道" - , "直行或左转掉头车道" - , "直行或右转掉头车道" - , "左转或左掉头车道" - , "右转或右掉头车道" - , "直行并且车道扩展" - , "左转+左掉头+扩展" - , "不可以选择该车道" - , "直行+左转+左掉头车道" - , "右转+左掉头" - , "左转+右转+左掉头" - , "直行+右转+左掉头" - , "左转+右掉头" - , "公交车道" - , "空车道" - , "可变车道" - }; - - String[] actions = { - "直行" - , "左转" - , "左转或直行" - , "右转" - , "右转或这行" - , "左掉头" - , "左转或者右转" - , " 左转或右转或直行" - , "右转掉头" - , "直行或左转掉头" - , "直行或右转掉头" - , "左转或左掉头" - , "右转或右掉头" - , "直行并且车道扩展" - , "左转+左掉头+扩展" - , "不可以选择" - , "直行+左转+左掉头" - , "右转+左掉头" - , "左转+右转+左掉头" - , "直行+右转+左掉头" - , "左转+右掉头" - , "公交车道" - , "空车道" - , "可变车道" - }; -} diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiRottingNaviFragment.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiRottingNaviFragment.java new file mode 100644 index 0000000000..e1318d866b --- /dev/null +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiRottingNaviFragment.java @@ -0,0 +1,127 @@ +package com.mogo.och.taxi.ui; + +import android.os.Bundle; + +import androidx.annotation.NonNull; + +import com.amap.api.maps.model.LatLng; +import com.mogo.commons.mvp.MvpFragment; +import com.mogo.eagle.core.utilcode.util.UiThreadHandler; +import com.mogo.och.taxi.R; +import com.mogo.och.taxi.presenter.NaviPresenter; + +import java.util.List; + +/** + * @author: wangmingjun + * @date: 2021/11/30 + */ +public class TaxiRottingNaviFragment extends MvpFragment { + + private final String TAG = TaxiRottingNaviFragment.class.getSimpleName(); + + private TaxiMapDirectionView mMapDirectionView; + public static TaxiRottingNaviFragment newInstance() { + + Bundle args = new Bundle(); + + TaxiRottingNaviFragment fragment = new TaxiRottingNaviFragment(); + fragment.setArguments(args); + return fragment; + } + + @Override + protected int getLayoutId() { + return R.layout.taxi_rotting_navi_view; + } + + @Override + public String getTagName() { + return TAG; + } + + @Override + protected void initViews() { + + } + + @Override + protected void initViews(Bundle savedInstanceState) { + super.initViews(savedInstanceState); + mMapDirectionView = mRootView.findViewById(R.id.rotting_navi_view); + mMapDirectionView.onCreateView(savedInstanceState); + } + + @Override + public void onResume() { + super.onResume(); + mMapDirectionView.onResume(); + } + + @Override + public void onPause() { + super.onPause(); + mMapDirectionView.onPause(); + } + + @Override + public void onDestroy() { + super.onDestroy(); + + if (mMapDirectionView != null){ + mMapDirectionView.onDestroy(); + } + } + + @NonNull + @Override + protected NaviPresenter createPresenter() { + return new NaviPresenter(this); + } + + public void routeResult(List latLngList, int haveArrivedIndex){ + if (latLngList.size() > 0) { + drawablePolylineByRoute(latLngList,haveArrivedIndex); + } else { + clearPolyline(); + } + } + + public void setLineMarker(List latLngList){ + if (latLngList.size() > 0) { + if (mMapDirectionView != null) { + mMapDirectionView.setCoordinatesLatLng(latLngList); + UiThreadHandler.post(new Runnable() { + @Override + public void run() { + mMapDirectionView.setLineMarker(); + } + }); + } + } else { + clearPolyline(); + } + } + + public void drawablePolylineByRoute(List mCoordinatesLatLng,int haveArrivedIndex){ + if (mMapDirectionView != null){ + mMapDirectionView.setCoordinatesLatLng(mCoordinatesLatLng,haveArrivedIndex); + UiThreadHandler.post(new Runnable() { + @Override + public void run() { + mMapDirectionView.drawablePolyline(); + } + }); + } + } + private void clearPolyline() { + if (mMapDirectionView != null) { + UiThreadHandler.post(new Runnable() { + @Override + public void run() { + mMapDirectionView.clearPolyline(); + } + }); + } + } +} diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiServerOrdersFragment.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiServerOrdersFragment.java index 0e4f2bd53b..ce0f7bb40d 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiServerOrdersFragment.java +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiServerOrdersFragment.java @@ -51,7 +51,7 @@ public class TaxiServerOrdersFragment extends BaseTaxiUIFragment { private ViewPager mTaxiOrderPager; private String[] mTabTitles = {"进行中","待服务"}; private List fragments = new ArrayList<>(); - private TaxiBeingServerdOrdersFragment beingServerdOrdersFragment = null; + private CommonBeingServerdOrdersFragment beingServerdOrdersFragment = null; private TaxiReserveOrdersFragment reserveOrdersFragment = null; @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) @@ -82,7 +82,7 @@ public class TaxiServerOrdersFragment extends BaseTaxiUIFragment { if (0 == i){ mTaxiOrderTab.addTab(tab,true); changeTabLayoutTabUI(tab,true); - beingServerdOrdersFragment = TaxiBeingServerdOrdersFragment.newInstance(getActivity(),(TaxiFragment) getParentFragment()); + beingServerdOrdersFragment = CommonBeingServerdOrdersFragment.newInstance(getActivity(),(TaxiFragment) getParentFragment()); fragments.add(beingServerdOrdersFragment); }else if (1 == i){ mTaxiOrderTab.addTab(tab); @@ -200,10 +200,7 @@ public class TaxiServerOrdersFragment extends BaseTaxiUIFragment { if (null == beingServerdOrdersFragment) return; beingServerdOrdersFragment.onCurrentOrderCancelDone(); } - public void onCurrentOrderDistToStartChanged(long meters, long timeInSecond){ - if (null == beingServerdOrdersFragment) return; - beingServerdOrdersFragment.updateDistanceAndTime(meters,timeInSecond); - } + public void onCurrentOrderDistToEndChanged(long meters, long timeInSecond){ if (null == beingServerdOrdersFragment) return; beingServerdOrdersFragment.updateDistanceAndTime(meters,timeInSecond); @@ -217,4 +214,9 @@ public class TaxiServerOrdersFragment extends BaseTaxiUIFragment { if (null == beingServerdOrdersFragment) return; beingServerdOrdersFragment.updateOrderBottomBtnUI(); } + + public void onNaviToEndAmap(boolean isVoicePlay){ + if (null == beingServerdOrdersFragment) return; + beingServerdOrdersFragment.onNaviToEndAmap(isVoicePlay); + } } diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/utils/TPRouteDataTestUtils.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/utils/TPRouteDataTestUtils.java index 472d0bbf27..5adc1a9531 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/utils/TPRouteDataTestUtils.java +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/utils/TPRouteDataTestUtils.java @@ -37,7 +37,7 @@ public class TPRouteDataTestUtils { builder.setLongitude(s.getDouble("lon")); list.add(builder.build()); } - TaxiModel.getInstance().updateOrderRoute(list); +// TaxiModel.getInstance().updateOrderRoute(list); TaxiModel.getInstance().updateOrderRouteInfo(list); } catch (JSONException e) { e.printStackTrace(); diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/utils/TaxiMapAssetStyleUtil.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/utils/TaxiMapAssetStyleUtil.java new file mode 100644 index 0000000000..4e991eda96 --- /dev/null +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/utils/TaxiMapAssetStyleUtil.java @@ -0,0 +1,61 @@ +package com.mogo.och.taxi.utils; + + +import android.content.Context; + +import java.io.IOException; +import java.io.InputStream; + +/** + * @author donghongyu + * @date 12/18/20 5:37 PM + */ +public class TaxiMapAssetStyleUtil { + + public static byte[] getAssetsStyle(Context context,String fileName) { + byte[] buffer1 = null; + InputStream is1 = null; + try { + is1 = context.getResources().getAssets().open(fileName); //eg. over_view_style.data + int lenght1 = is1.available(); + buffer1 = new byte[lenght1]; + is1.read(buffer1); + } catch (IOException e) { + e.printStackTrace(); + } finally { + try { + if (is1 != null) { + is1.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + return buffer1; + } + + + public static byte[] getAssetsExtraStyle(Context context, String fileName) { + byte[] buffer1 = null; + InputStream is1 = null; + try { + is1 = context.getResources().getAssets().open(fileName); //eg. over_view_style_extra.data + int lenght1 = is1.available(); + buffer1 = new byte[lenght1]; + is1.read(buffer1); + } catch (IOException e) { + e.printStackTrace(); + } finally { + try { + if (is1 != null) { + is1.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + return buffer1; + } + + +} diff --git a/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1440/taxi_map_arrow_arrived.png b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1440/taxi_map_arrow_arrived.png new file mode 100644 index 0000000000..36ef2e88d3 Binary files /dev/null and b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1440/taxi_map_arrow_arrived.png differ diff --git a/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1440/taxi_map_arrow_un_arrive.png b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1440/taxi_map_arrow_un_arrive.png new file mode 100644 index 0000000000..baa35592cb Binary files /dev/null and b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1440/taxi_map_arrow_un_arrive.png differ diff --git a/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1440/taxi_map_car.png b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1440/taxi_map_car.png new file mode 100644 index 0000000000..dedaf093e9 Binary files /dev/null and b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1440/taxi_map_car.png differ diff --git a/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1440/taxi_map_view_dir_end.png b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1440/taxi_map_view_dir_end.png new file mode 100644 index 0000000000..a81336d4c2 Binary files /dev/null and b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1440/taxi_map_view_dir_end.png differ diff --git a/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1440/taxi_map_view_dir_start.png b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1440/taxi_map_view_dir_start.png new file mode 100644 index 0000000000..3cee184981 Binary files /dev/null and b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1440/taxi_map_view_dir_start.png differ diff --git a/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/taxi_map_arrow_arrived.png b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/taxi_map_arrow_arrived.png new file mode 100644 index 0000000000..36ef2e88d3 Binary files /dev/null and b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/taxi_map_arrow_arrived.png differ diff --git a/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/taxi_map_arrow_un_arrive.png b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/taxi_map_arrow_un_arrive.png new file mode 100644 index 0000000000..baa35592cb Binary files /dev/null and b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/taxi_map_arrow_un_arrive.png differ diff --git a/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/taxi_map_car.png b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/taxi_map_car.png new file mode 100644 index 0000000000..dedaf093e9 Binary files /dev/null and b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/taxi_map_car.png differ diff --git a/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/taxi_map_view_dir_end.png b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/taxi_map_view_dir_end.png new file mode 100644 index 0000000000..a81336d4c2 Binary files /dev/null and b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/taxi_map_view_dir_end.png differ diff --git a/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/taxi_map_view_dir_start.png b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/taxi_map_view_dir_start.png new file mode 100644 index 0000000000..3cee184981 Binary files /dev/null and b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/taxi_map_view_dir_start.png differ diff --git a/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/taxi_map_arrow_arrived.png b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/taxi_map_arrow_arrived.png new file mode 100644 index 0000000000..36ef2e88d3 Binary files /dev/null and b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/taxi_map_arrow_arrived.png differ diff --git a/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/taxi_map_arrow_un_arrive.png b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/taxi_map_arrow_un_arrive.png new file mode 100644 index 0000000000..baa35592cb Binary files /dev/null and b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/taxi_map_arrow_un_arrive.png differ diff --git a/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/taxi_map_car.png b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/taxi_map_car.png new file mode 100644 index 0000000000..dedaf093e9 Binary files /dev/null and b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/taxi_map_car.png differ diff --git a/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/taxi_map_view_dir_end.png b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/taxi_map_view_dir_end.png new file mode 100644 index 0000000000..a81336d4c2 Binary files /dev/null and b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/taxi_map_view_dir_end.png differ diff --git a/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/taxi_map_view_dir_start.png b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/taxi_map_view_dir_start.png new file mode 100644 index 0000000000..3cee184981 Binary files /dev/null and b/OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/taxi_map_view_dir_start.png differ diff --git a/OCH/mogo-och-taxi/src/main/res/layout/taxi_amap_navi_view.xml b/OCH/mogo-och-taxi/src/main/res/layout/taxi_amap_navi_view.xml new file mode 100644 index 0000000000..419da50519 --- /dev/null +++ b/OCH/mogo-och-taxi/src/main/res/layout/taxi_amap_navi_view.xml @@ -0,0 +1,15 @@ + + + + diff --git a/OCH/mogo-och-taxi/src/main/res/layout/taxi_being_order.xml b/OCH/mogo-och-taxi/src/main/res/layout/taxi_being_order.xml index 9cb4d3a230..76c0b9aa4a 100644 --- a/OCH/mogo-och-taxi/src/main/res/layout/taxi_being_order.xml +++ b/OCH/mogo-och-taxi/src/main/res/layout/taxi_being_order.xml @@ -65,7 +65,7 @@ tools:text="送乘客至" /> + + @@ -205,7 +216,7 @@ - + tools:text="送乘客至" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintTop_toTopOf="parent"/> - + tools:text="- -" + app:layout_constraintTop_toBottomOf="@+id/arrive_station_32" + app:layout_constraintLeft_toLeftOf="parent"/> + + + + + + \ No newline at end of file diff --git a/OCH/mogo-och-taxi/src/main/res/layout/taxi_navi_view.xml b/OCH/mogo-och-taxi/src/main/res/layout/taxi_navi_view.xml deleted file mode 100644 index 49d6454265..0000000000 --- a/OCH/mogo-och-taxi/src/main/res/layout/taxi_navi_view.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/OCH/mogo-och-taxi/src/main/res/layout/taxi_panel.xml b/OCH/mogo-och-taxi/src/main/res/layout/taxi_panel.xml index 49fb0eda5f..32a776ed22 100644 --- a/OCH/mogo-och-taxi/src/main/res/layout/taxi_panel.xml +++ b/OCH/mogo-och-taxi/src/main/res/layout/taxi_panel.xml @@ -85,5 +85,12 @@ android:text="到达目的地" android:textSize="12sp" /> +