[2.12.0 fix] opt
This commit is contained in:
@@ -50,5 +50,5 @@ public interface ITaxiOrderStatusCallback {
|
||||
void onDriverHasCheckedPilotCondition(boolean isSafe);
|
||||
|
||||
//高德导航到达目的地
|
||||
void onNaviToEndAmap();
|
||||
void onNaviToEndAmap(boolean isVoicePlay);
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ 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.constant.TaxiConst;
|
||||
import com.mogo.och.taxi.utils.PermissionUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -37,6 +38,9 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
* @date: 2021/12/6
|
||||
*/
|
||||
public class NaviToDestinationModel implements AMapNaviListener {
|
||||
|
||||
public static final String TAG = "NaviToDestinationModel";
|
||||
|
||||
private static Context mContext;
|
||||
private AMapNavi mAMapNavi = null;
|
||||
protected final List<NaviLatLng> sList = new ArrayList<NaviLatLng>();
|
||||
@@ -132,6 +136,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());// 米、秒
|
||||
}
|
||||
}
|
||||
@@ -170,8 +175,8 @@ public class NaviToDestinationModel implements AMapNaviListener {
|
||||
// }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) {
|
||||
|
||||
@@ -1407,12 +1407,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.getInstance().reportOrderRemain(mContext, mCurrentOCHOrder.orderNo
|
||||
, lastSumLength, duration, new TaxiServiceCallback<BaseData>() {
|
||||
@@ -1545,12 +1545,12 @@ public class TaxiModel {
|
||||
}
|
||||
|
||||
//导航去订单终点目的地
|
||||
public void startNaviToEndStation(){
|
||||
public void startNaviToEndStation(boolean isVoicePlay){
|
||||
if (mRoutePoints.size() > 0 ){ //使用自驾轨迹
|
||||
|
||||
}else {//使用高的导航
|
||||
if (mOrderStatusCallback != null){
|
||||
mOrderStatusCallback.onNaviToEndAmap();
|
||||
mOrderStatusCallback.onNaviToEndAmap(isVoicePlay);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,10 +181,13 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
|
||||
}
|
||||
|
||||
//导航去订单目的地
|
||||
public void startNaviToEndStation(){
|
||||
TaxiModel.getInstance().startNaviToEndStation();
|
||||
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() {
|
||||
|
||||
@@ -311,8 +314,8 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviToEndAmap() {
|
||||
runOnUIThread( () -> mView.onNaviToEndAmap());
|
||||
public void onNaviToEndAmap(boolean isVoicePlay) {
|
||||
runOnUIThread( () -> mView.onNaviToEndAmap(isVoicePlay));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -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,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
protected RelativeLayout mSettingBtn;
|
||||
protected LinearLayout mBadcaseBtn;
|
||||
protected LinearLayout mAICollectBtn;
|
||||
protected TaxiNaviFragment ochNaviFragment = null;
|
||||
protected TaxiAmapNaviFragment ochNaviFragment = null;
|
||||
// protected TaxiTrafficLightView mTrafficLightView;
|
||||
|
||||
private Handler mHandler = new Handler(Looper.getMainLooper());
|
||||
@@ -571,7 +566,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
|
||||
if (isShow) {
|
||||
// if (ochNaviFragment == null){
|
||||
ochNaviFragment = TaxiNaviFragment.newInstance();
|
||||
ochNaviFragment = TaxiAmapNaviFragment.newInstance();
|
||||
// }
|
||||
if (ochNaviFragment.isAdded()) {
|
||||
return;
|
||||
@@ -594,5 +589,5 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void startNaviToEndStation();
|
||||
public abstract void startNaviToEndStation(boolean isVoicePlay);
|
||||
}
|
||||
|
||||
@@ -22,18 +22,18 @@ import com.mogo.och.taxi.model.NaviToDestinationModel;
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/11/30
|
||||
*/
|
||||
public class TaxiNaviFragment extends BaseTaxiUIFragment implements AMapNaviViewListener, View.OnClickListener {
|
||||
public class TaxiAmapNaviFragment 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() {
|
||||
public static TaxiAmapNaviFragment newInstance() {
|
||||
|
||||
Bundle args = new Bundle();
|
||||
|
||||
TaxiNaviFragment fragment = new TaxiNaviFragment();
|
||||
TaxiAmapNaviFragment fragment = new TaxiAmapNaviFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
@@ -340,20 +340,20 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement
|
||||
}
|
||||
}
|
||||
|
||||
private void startNaviToStation(boolean isShow, double orderStartStationLat, double orderStartStationLng) {
|
||||
private void startNaviToStation(boolean isVoicePlay, double stationLat, double stationLng) {
|
||||
NaviToDestinationModel.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);
|
||||
NaviLatLng endNaviLatLng = new NaviLatLng(stationLat, stationLng);
|
||||
NaviToDestinationModel.getInstance(getContext()).initAMapNavi(startNaviLatLng, endNaviLatLng);
|
||||
NaviToDestinationModel.getInstance(getContext()).setVoiceIsMute(isShow);
|
||||
NaviToDestinationModel.getInstance(getContext()).setVoiceIsMute(isVoicePlay);
|
||||
NaviToDestinationModel.getInstance(getContext()).setOCHTaciNaviChangedCallback(this);
|
||||
}
|
||||
|
||||
private void showOrHideNavi(boolean isShow) {
|
||||
if (!isShow) {
|
||||
mNaviStartIcon.setVisibility(View.GONE);
|
||||
mNaviStartIcon.setVisibility(View.GONE);
|
||||
mNaviToEndIcon.setVisibility(View.GONE);
|
||||
NaviToDestinationModel.getInstance(getContext()).destroyAmaNavi();
|
||||
mTaxiFragment.showNaviToStationFragment(false);
|
||||
}
|
||||
@@ -384,9 +384,15 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement
|
||||
if (mCurrentOrder != null && mCurrentOrder.orderStatus == TaxiOrderStatusEnum.OnTheWayToStart.getCode()) { //前往上车点
|
||||
|
||||
mDistanceAndTime3.setText(Html.fromHtml(strHtml2));
|
||||
mNaviStartIcon.setVisibility(View.VISIBLE);
|
||||
if (mNaviStartIcon.getVisibility() == View.GONE){
|
||||
mNaviStartIcon.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
} else if (mCurrentOrder != null && mCurrentOrder.orderStatus == TaxiOrderStatusEnum.OnTheWayToEnd.getCode()) { //前往终点 时间单位是分钟
|
||||
mNaviToEndIcon.setVisibility(View.VISIBLE);
|
||||
if (mNaviToEndIcon.getVisibility() == View.GONE){
|
||||
mNaviToEndIcon.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
if (mTtsLessThan200Tip < 1 && meters <= 250 && meters > 150){
|
||||
speekVoice200mTipsOnce();
|
||||
}
|
||||
@@ -469,7 +475,6 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement
|
||||
double orderStartStationLat = order.startSiteGcjPoint.get(1);
|
||||
double orderStartStationLng = order.startSiteGcjPoint.get(0);
|
||||
startNaviToStation(false, orderStartStationLat, orderStartStationLng);
|
||||
showOrHideNavi(true);
|
||||
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;
|
||||
@@ -501,7 +506,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;
|
||||
@@ -602,7 +612,7 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement
|
||||
*/
|
||||
private void showNaviToEndStationFragment(boolean isShow) {
|
||||
mTaxiFragment.showNaviToStationFragment(isShow);
|
||||
mTaxiFragment.startNaviToEndStation();
|
||||
mTaxiFragment.startNaviToEndStation(isShow);
|
||||
}
|
||||
|
||||
|
||||
@@ -643,6 +653,10 @@ 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
|
||||
@@ -683,12 +697,12 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
public void onNaviToEndAmap() {
|
||||
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(true,orderEndStationLat,orderEndStationLng);
|
||||
startNaviToStation(isVoicePlay,orderEndStationLat,orderEndStationLng);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst;
|
||||
import com.mogo.och.common.module.biz.provider.LoginService;
|
||||
import com.mogo.och.taxi.R;
|
||||
import com.mogo.och.taxi.constant.TaxiConst;
|
||||
import com.mogo.och.taxi.constant.TaxiOrderStatusEnum;
|
||||
import com.mogo.och.taxi.bean.OrderQueryRespBean;
|
||||
import com.mogo.och.taxi.bean.OrderQueryRouteInfoRespBean;
|
||||
@@ -95,8 +96,8 @@ public class TaxiFragment extends BaseTaxiTabFragment<TaxiFragment, TaxiPresente
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startNaviToEndStation() {
|
||||
mPresenter.startNaviToEndStation();
|
||||
public void startNaviToEndStation(boolean isVoicePlay) {
|
||||
mPresenter.startNaviToEndStation(isVoicePlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -311,11 +312,21 @@ public class TaxiFragment extends BaseTaxiTabFragment<TaxiFragment, TaxiPresente
|
||||
grabOrderFragment.onGrabOrderFailed();
|
||||
}
|
||||
|
||||
public void onNaviToEndAmap(){
|
||||
public void onNaviToEndAmap(boolean isVoicePlay){
|
||||
if (null == serverOrdersFragment) return;
|
||||
serverOrdersFragment.onNaviToEndAmap();
|
||||
serverOrdersFragment.onNaviToEndAmap(isVoicePlay);
|
||||
}
|
||||
|
||||
/**
|
||||
* 高德计算出来的到达目的地的剩余里程和时间
|
||||
* @param meters
|
||||
* @param timeInSecond
|
||||
*/
|
||||
public void reportToEndDisAndTime(int meters, long timeInSecond){ //米/秒
|
||||
mPresenter.reportToEndDisAndTime(Long.parseLong(String.valueOf(meters)),timeInSecond);
|
||||
}
|
||||
|
||||
|
||||
public void onOrdersWaitServiceChanged(List<OrderQueryRespBean.Result> waitServiceList) {
|
||||
if (null == waitServiceList) return;
|
||||
if (null == serverOrdersFragment) return;
|
||||
|
||||
@@ -0,0 +1,304 @@
|
||||
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 TaxiRottingNaviFragment extends BaseTaxiUIFragment implements AMapNaviViewListener, View.OnClickListener {
|
||||
|
||||
private AMapNaviView mAMapNaviView;
|
||||
// private OverviewButtonView mOverviewButtonView;
|
||||
// private NextTurnTipView mNextTurnTipView;
|
||||
private AMap aMap;
|
||||
private ITaxiNaviChangedCallback mNaviToStartInfoCallback; // 前往乘客上车点
|
||||
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_navi_view;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews(View view) {
|
||||
view.bringToFront();
|
||||
initMapView(view);
|
||||
}
|
||||
|
||||
private void initMapView(View view) {
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 车道信息说明:
|
||||
* <p>
|
||||
* 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 = {
|
||||
"直行"
|
||||
, "左转"
|
||||
, "左转或直行"
|
||||
, "右转"
|
||||
, "右转或这行"
|
||||
, "左掉头"
|
||||
, "左转或者右转"
|
||||
, " 左转或右转或直行"
|
||||
, "右转掉头"
|
||||
, "直行或左转掉头"
|
||||
, "直行或右转掉头"
|
||||
, "左转或左掉头"
|
||||
, "右转或右掉头"
|
||||
, "直行并且车道扩展"
|
||||
, "左转+左掉头+扩展"
|
||||
, "不可以选择"
|
||||
, "直行+左转+左掉头"
|
||||
, "右转+左掉头"
|
||||
, "左转+右转+左掉头"
|
||||
, "直行+右转+左掉头"
|
||||
, "左转+右掉头"
|
||||
, "公交车道"
|
||||
, "空车道"
|
||||
, "可变车道"
|
||||
};
|
||||
}
|
||||
@@ -215,8 +215,8 @@ public class TaxiServerOrdersFragment extends BaseTaxiUIFragment {
|
||||
beingServerdOrdersFragment.updateOrderBottomBtnUI();
|
||||
}
|
||||
|
||||
public void onNaviToEndAmap(){
|
||||
public void onNaviToEndAmap(boolean isVoicePlay){
|
||||
if (null == beingServerdOrdersFragment) return;
|
||||
beingServerdOrdersFragment.onNaviToEndAmap();
|
||||
beingServerdOrdersFragment.onNaviToEndAmap(isVoicePlay);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
tools:text="送乘客至" />
|
||||
<TextView
|
||||
android:id="@+id/module_och_taxi_order_station_2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="36px"
|
||||
android:textStyle="bold"
|
||||
@@ -74,10 +74,21 @@
|
||||
android:lineSpacingExtra="10px"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="23sp"
|
||||
app:layout_constraintRight_toLeftOf="@+id/module_och_taxi_navi_end_iv"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_och_taxi_order_station_title_2"
|
||||
tools:text="- -" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/module_och_taxi_navi_end_iv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/taxi_navi_icon"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/module_och_taxi_order_station_2"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_och_taxi_order_station_2"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_och_taxi_order_distance_anchor_2"
|
||||
android:layout_width="match_parent"
|
||||
@@ -156,7 +167,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_och_taxi_order_passenger_data">
|
||||
@@ -240,17 +251,6 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/arrive_station_32"
|
||||
app:layout_constraintLeft_toLeftOf="parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/module_och_taxi_navi_end_iv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/taxi_navi_icon"
|
||||
android:visibility="gone"
|
||||
android:layout_alignParentRight="true"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/module_och_taxi_order_end_station_32"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_och_taxi_order_end_station_32"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
|
||||
Reference in New Issue
Block a user