[driver passenger ] bus/taxi司机端,taxi乘客端 :1、起终点marker替换 2、司乘端迈速单位统一 KM/H 3、小程序、司机端里程统一保留1位小数。
bus 乘客端: UI icon 优化
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 9.3 KiB |
@@ -154,7 +154,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="@dimen/dp_20"
|
||||
android:layout_marginBottom="@dimen/dp_400"
|
||||
android:layout_marginBottom="@dimen/dp_370"
|
||||
android:src="@drawable/bus_p_arrow_nor"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
|
||||
@@ -174,16 +174,16 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
mStartStationFlag.setText(getResources().getString(R.string.bus_arrive_to_end_start));
|
||||
|
||||
setOrRemoveMapMaker(true, BusConst.BUS_START_MAP_MAKER, startStation.getLat()
|
||||
, startStation.getLon());
|
||||
, startStation.getLon(),R.raw.star_marker);
|
||||
setOrRemoveMapMaker(true, BusConst.BUS_END_MAP_MAKER, endStation.getLat()
|
||||
, endStation.getLon());
|
||||
, endStation.getLon(),R.raw.end_marker);
|
||||
} else if (currentStation > 0 && currentStation < stationList.size() - 1) {// 是否到达站点
|
||||
isArriveAtStation = true;
|
||||
|
||||
setOrRemoveMapMaker(false, BusConst.BUS_START_MAP_MAKER, startStation.getLat()
|
||||
, startStation.getLon());
|
||||
, startStation.getLon(),R.raw.star_marker);
|
||||
setOrRemoveMapMaker(true, BusConst.BUS_END_MAP_MAKER, endStation.getLat()
|
||||
, endStation.getLon());
|
||||
, endStation.getLon(),R.raw.end_marker);
|
||||
} else if (currentStation == stationList.size() - 1) {// 是否到达终点
|
||||
isArriveEndStation = true;
|
||||
nextStationName = "--";
|
||||
@@ -192,14 +192,14 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
endStationFlagVisibility = View.INVISIBLE;
|
||||
|
||||
setOrRemoveMapMaker(false, BusConst.BUS_START_MAP_MAKER, startStation.getLat()
|
||||
, startStation.getLon());
|
||||
, startStation.getLon(),R.raw.star_marker);
|
||||
|
||||
if (isArrived) {
|
||||
setOrRemoveMapMaker(false, BusConst.BUS_END_MAP_MAKER, endStation.getLat()
|
||||
, endStation.getLon());
|
||||
, endStation.getLon(),R.raw.end_marker);
|
||||
} else {
|
||||
setOrRemoveMapMaker(true, BusConst.BUS_END_MAP_MAKER, endStation.getLat()
|
||||
, endStation.getLon());
|
||||
, endStation.getLon(),R.raw.end_marker);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -292,11 +292,11 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
//移除起点终点
|
||||
if (null != startStation) {
|
||||
setOrRemoveMapMaker(false, BusConst.BUS_START_MAP_MAKER, startStation.getLat()
|
||||
, startStation.getLon());
|
||||
, startStation.getLon(),R.raw.star_marker);
|
||||
}
|
||||
if (null != endStation) {
|
||||
setOrRemoveMapMaker(false, BusConst.BUS_END_MAP_MAKER, endStation.getLat()
|
||||
, endStation.getLon());
|
||||
, endStation.getLon(),R.raw.end_marker);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -318,9 +318,9 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
* @param isAdd
|
||||
* @param uuid
|
||||
*/
|
||||
private void setOrRemoveMapMaker(boolean isAdd, String uuid, double lat, double longi) {
|
||||
private void setOrRemoveMapMaker(boolean isAdd, String uuid, double lat, double longi,int resourceId) {
|
||||
if (isAdd) {
|
||||
CallerLogger.INSTANCE.d("setMapMaker= ", uuid + "=latitude=" + lat + ",longitude=" + longi);
|
||||
CallerLogger.INSTANCE.d(M_BUS + "setMapMaker= ", uuid + "=latitude=" + lat + ",longitude=" + longi);
|
||||
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.owner(BusConst.TYPE_MARKER_BUS_ORDER)
|
||||
@@ -328,7 +328,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
.set3DMode(true)
|
||||
.gps(true)
|
||||
.controlAngle(true)
|
||||
.icon3DRes(R.raw.start_and_end)
|
||||
.icon3DRes(resourceId)
|
||||
.latitude(lat)
|
||||
.longitude(longi);
|
||||
IMogoMarker marker = MogoMarkerManager.getInstance(AbsMogoApplication.getApp()) .addMarker(uuid, options);
|
||||
@@ -337,7 +337,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
.getAngle()
|
||||
.floatValue());
|
||||
}else {
|
||||
CallerLogger.INSTANCE.d("RemoveMapMaker=",uuid+"=latitude="+lat+",longitude="+longi);
|
||||
CallerLogger.INSTANCE.d(M_BUS + "RemoveMapMaker=",uuid+"=latitude="+lat+",longitude="+longi);
|
||||
MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).removeMarkers(uuid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import com.mogo.och.bus.R;
|
||||
public class BusArcView extends View {
|
||||
|
||||
//中心的文字描述
|
||||
private String mDes = "km/h";
|
||||
private String mDes = "KM/H";
|
||||
//根据数据显示的圆弧Paint
|
||||
private Paint mArcPaint;
|
||||
//圆弧颜色
|
||||
|
||||
BIN
OCH/mogo-och-bus/src/main/res/raw/star_marker.nt3d
Normal file
@@ -2,6 +2,7 @@ package com.mogo.och.taxi.passenger.presenter;
|
||||
|
||||
import android.location.Location;
|
||||
import android.os.Build;
|
||||
import android.os.Looper;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresApi;
|
||||
@@ -12,6 +13,7 @@ import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerOrderQueryRespBean;
|
||||
import com.mogo.och.taxi.passenger.callback.IOCHTaxiPassengerAutopilotPlanningCallback;
|
||||
import com.mogo.och.taxi.passenger.callback.IOCHTaxiPassengerControllerStatusCallback;
|
||||
@@ -72,13 +74,13 @@ public class TaxiPassengerServingOrderPresenter extends Presenter<TaxiPassengerS
|
||||
for (MessagePad.Location routeModel : models) {
|
||||
latLngList.add(new MogoLatLng(routeModel.getLatitude(), routeModel.getLongitude()));
|
||||
}
|
||||
mView.routeResult(latLngList);
|
||||
runOnUIThread(() -> mView.routeResult(latLngList));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void routeResultByServer(List<LatLng> models) {
|
||||
if (models == null) return;
|
||||
mView.routeResultByServer(models);
|
||||
runOnUIThread(() -> mView.routeResultByServer(models));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -112,12 +114,12 @@ public class TaxiPassengerServingOrderPresenter extends Presenter<TaxiPassengerS
|
||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||
@Override
|
||||
public void onCurrentOrderDistToEndChanged(long meters, long timeInSecond) {
|
||||
mView.onCurrentOrderDistToEndChanged(meters, timeInSecond);
|
||||
runOnUIThread(() -> mView.onCurrentOrderDistToEndChanged(meters, timeInSecond));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCurrentRoadName(String currentRoadName) {
|
||||
mView.onCurrentRoadName(currentRoadName);
|
||||
runOnUIThread(() -> mView.onCurrentRoadName(currentRoadName));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -128,7 +130,7 @@ public class TaxiPassengerServingOrderPresenter extends Presenter<TaxiPassengerS
|
||||
@Override
|
||||
public void onCarLocationChanged(Location location) {
|
||||
if (location != null){
|
||||
mView.onCarLocationChanged(location);
|
||||
runOnUIThread(() -> mView.onCarLocationChanged(location));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,4 +145,14 @@ public class TaxiPassengerServingOrderPresenter extends Presenter<TaxiPassengerS
|
||||
releaseListener();
|
||||
}
|
||||
|
||||
private void runOnUIThread( Runnable executor ) {
|
||||
if ( executor == null ) {
|
||||
return;
|
||||
}
|
||||
if ( Looper.myLooper() != Looper.getMainLooper() ) {
|
||||
UiThreadHandler.post( executor );
|
||||
} else {
|
||||
executor.run();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,32 +137,34 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
private int mPrevAPStatus = -1;
|
||||
public void onAutopilotStatusChanged(int status) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
if (isStarting && IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING != status) {
|
||||
// 1. 主动开启自动驾驶中,不为2(为0、1)则继续loading
|
||||
return;
|
||||
}
|
||||
if (isStarting && IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == status
|
||||
&& mPrevAPStatus != status) {
|
||||
// 2. 主动开启自动驾驶中,为2则停止loading,并isStarting = false
|
||||
startAutopilotDone(true);
|
||||
return;
|
||||
}
|
||||
// if (isStarting && IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING != status) {
|
||||
// // 1. 主动开启自动驾驶中,不为2(为0、1)则继续loading
|
||||
// return;
|
||||
// }
|
||||
// if (isStarting && IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == status
|
||||
// && mPrevAPStatus != status) {
|
||||
// // 2. 主动开启自动驾驶中,为2则停止loading,并isStarting = false
|
||||
// startAutopilotDone(true);
|
||||
// return;
|
||||
// }
|
||||
// 3. 其他过程直接更新
|
||||
AutopilotStatusAnimchanged(status);
|
||||
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == mPrevAPStatus) {
|
||||
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == status) {
|
||||
// 2->1
|
||||
// AIAssist.getInstance(getContext()).speakTTSVoice("已进入人工驾驶模式");
|
||||
} else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE == status) {
|
||||
// 2->0
|
||||
// AIAssist.getInstance(getContext()).speakTTSVoice("自动驾驶已停止,请人工接管");
|
||||
}
|
||||
if (mPrevAPStatus != status){
|
||||
autopilotStatusAnimchanged(status);
|
||||
}
|
||||
// if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == mPrevAPStatus) {
|
||||
// if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == status) {
|
||||
// // 2->1
|
||||
//// AIAssist.getInstance(getContext()).speakTTSVoice("已进入人工驾驶模式");
|
||||
// } else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE == status) {
|
||||
// // 2->0
|
||||
//// AIAssist.getInstance(getContext()).speakTTSVoice("自动驾驶已停止,请人工接管");
|
||||
// }
|
||||
// }
|
||||
mPrevAPStatus = status;
|
||||
});
|
||||
}
|
||||
|
||||
public void AutopilotStatusAnimchanged(int status) {
|
||||
public void autopilotStatusAnimchanged(int status) {
|
||||
// mAutopilotTv.setText(isInAutopilot?"自动驾驶":"开启自动驾驶");
|
||||
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == status) {
|
||||
mAutopilotImage.setImageResource(R.drawable.taxi_p_auto_nor);
|
||||
|
||||
@@ -518,7 +518,7 @@ public class TaxiPassengerServingOrderFragment extends
|
||||
}
|
||||
|
||||
public void onCarLocationChanged(Location location) {
|
||||
runOnUIThread(() -> updateSpeedView(location.getSpeed()));
|
||||
updateSpeedView(location.getSpeed());
|
||||
}
|
||||
|
||||
public void onLimitingVelocityChange(int limitingVelocity) {
|
||||
|
||||
@@ -99,7 +99,7 @@ public class TaxiPassengerUtils {
|
||||
* @return
|
||||
*/
|
||||
public static String formatLong(double d) {
|
||||
BigDecimal bg = new BigDecimal(d).setScale(2, RoundingMode.HALF_UP);
|
||||
BigDecimal bg = new BigDecimal(d).setScale(1, RoundingMode.HALF_UP);
|
||||
double num = bg.doubleValue();
|
||||
if (Math.round(num) - num == 0) {
|
||||
return String.valueOf((long) num);
|
||||
|
||||
@@ -357,7 +357,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_12"
|
||||
android:text="KM/h"
|
||||
android:text="KM/H"
|
||||
android:includeFontPadding="false"
|
||||
android:layout_marginBottom="@dimen/dp_15"
|
||||
android:textColor="@android:color/white"
|
||||
|
||||
@@ -384,8 +384,8 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement
|
||||
mTtsLessThan200Tip = 0;
|
||||
startNaviToStartStation(false, mOrderStartStationLat, mOrderStartStationLng);
|
||||
showOrHideNavi(true);
|
||||
setOrRemoveMapMaker(true, TaxiConst.TAXI_START_MAP_MAKER,order.startSitePoint);
|
||||
setOrRemoveMapMaker(true, TaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint);
|
||||
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;
|
||||
case Cancel:
|
||||
mCurrentOrder = null;
|
||||
@@ -393,23 +393,23 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement
|
||||
mOrderCancel.setVisibility(View.VISIBLE);
|
||||
showNotice(mActivity.getString(R.string.module_och_taxi_order_cancel));
|
||||
showOrHideNavi(false);
|
||||
setOrRemoveMapMaker(false, TaxiConst.TAXI_START_MAP_MAKER,order.startSitePoint);
|
||||
setOrRemoveMapMaker(false, TaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint);
|
||||
setOrRemoveMapMaker(false, TaxiConst.TAXI_START_MAP_MAKER,order.startSitePoint,R.raw.star_marker);
|
||||
setOrRemoveMapMaker(false, TaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint,R.raw.end_marker);
|
||||
break;
|
||||
case ArriveAtStart:
|
||||
mTtsLessThan200Tip = 0;
|
||||
mOrderCancel.setVisibility(View.VISIBLE);
|
||||
showNotice(mActivity.getString(R.string.module_och_taxi_order_status_ph_text));
|
||||
showOrHideNavi(false);
|
||||
setOrRemoveMapMaker(true, TaxiConst.TAXI_START_MAP_MAKER,order.startSitePoint);
|
||||
setOrRemoveMapMaker(true, TaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint);
|
||||
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;
|
||||
case OnTheWayToEnd:
|
||||
// showNotice("欢迎使用蘑菇智行");
|
||||
mOrderCancel.setVisibility(View.VISIBLE);
|
||||
showOrHideNavi(false);
|
||||
setOrRemoveMapMaker(false, TaxiConst.TAXI_START_MAP_MAKER,order.startSitePoint);
|
||||
setOrRemoveMapMaker(true, TaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint);
|
||||
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;
|
||||
case ArriveAtEnd:
|
||||
mCurrentOrder = null;
|
||||
@@ -417,8 +417,8 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement
|
||||
mOrderCancel.setVisibility(View.GONE);
|
||||
showNotice(mActivity.getString(R.string.module_och_taxi_order_auto_arrive_end_tip));
|
||||
showOrHideNavi(false);
|
||||
setOrRemoveMapMaker(false, TaxiConst.TAXI_START_MAP_MAKER,order.startSitePoint);
|
||||
setOrRemoveMapMaker(false, TaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint);
|
||||
setOrRemoveMapMaker(false, TaxiConst.TAXI_START_MAP_MAKER,order.startSitePoint,R.raw.star_marker);
|
||||
setOrRemoveMapMaker(false, TaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint,R.raw.end_marker);
|
||||
break;
|
||||
case JourneyCompleted:
|
||||
mCurrentOrder = null;
|
||||
@@ -486,8 +486,8 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement
|
||||
public void onCurrentOrderCancelDone() {
|
||||
//去除起终点
|
||||
if (mCurrentOrder != null){
|
||||
setOrRemoveMapMaker(false, TaxiConst.TAXI_START_MAP_MAKER,mCurrentOrder.startSitePoint);
|
||||
setOrRemoveMapMaker(false, TaxiConst.TAXI_END_MAP_MAKER,mCurrentOrder.endSitePoint);
|
||||
setOrRemoveMapMaker(false, TaxiConst.TAXI_START_MAP_MAKER,mCurrentOrder.startSitePoint,R.raw.star_marker);
|
||||
setOrRemoveMapMaker(false, TaxiConst.TAXI_END_MAP_MAKER,mCurrentOrder.endSitePoint,R.raw.end_marker);
|
||||
}
|
||||
//提交取消订单后的回调
|
||||
TipToast.tip("订单取消成功");
|
||||
@@ -552,7 +552,7 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement
|
||||
* @param uuid
|
||||
* @param station
|
||||
*/
|
||||
private void setOrRemoveMapMaker(boolean isAdd, String uuid, List<Double> station){
|
||||
private void setOrRemoveMapMaker(boolean isAdd, String uuid, List<Double> station,int resourceId){
|
||||
if (isAdd){
|
||||
CallerLogger.INSTANCE.d(M_TAXI + "setMapMaker= ",uuid+"=latitude="
|
||||
+station.get(1)+",longitude="+station.get(0));
|
||||
@@ -563,7 +563,7 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement
|
||||
.set3DMode(true)
|
||||
.gps(true)
|
||||
.controlAngle(true)
|
||||
.icon3DRes(R.raw.start_and_end)
|
||||
.icon3DRes(resourceId)
|
||||
.latitude(station.get(1))
|
||||
.longitude(station.get(0));
|
||||
IMogoMarker marker = MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).addMarker(uuid, options);
|
||||
|
||||
@@ -99,7 +99,7 @@ public class TaxiDateTimeUtil {
|
||||
* @return
|
||||
*/
|
||||
public static String formatLong(double d) {
|
||||
BigDecimal bg = new BigDecimal(d).setScale(2, RoundingMode.HALF_UP);
|
||||
BigDecimal bg = new BigDecimal(d).setScale(1, RoundingMode.HALF_UP);
|
||||
double num = bg.doubleValue();
|
||||
if (Math.ceil(num) - num == 0) {
|
||||
return String.valueOf((long) num);
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Km/h"
|
||||
android:text="KM/H"
|
||||
android:textColor="#FFFFFF"
|
||||
android:layout_marginTop="-10px"
|
||||
android:textSize="32px"
|
||||
|
||||