[2.15.0-merge-master]
@@ -1,7 +1,13 @@
|
||||
# 网约车(Online Car Hailing)
|
||||
1. mogo-och-bus:Bus司机端(Bus)
|
||||
2. mogo-och-bus-passenger:Bus乘客端(BusPassenger)
|
||||
3. mogo-och-taxi:Taxi司机端(Taxi)
|
||||
4. mogo-och-taxi-passenger:Taxi乘客端(TaxiPassenger)
|
||||
5. mogo-och-noop:空实现,用于独立鹰眼打包
|
||||
6. mogo-och-sweeper: 清扫车(Sweeper)
|
||||
1. mogo-och-bus: 公交车模式司机端
|
||||
2. mogo-och-bus-passenger: 公交车模式乘客端
|
||||
3. mogo-och-charter 包车模式司机端
|
||||
4. mogo-och-charter-passenger 包车模式乘客端
|
||||
5. mogo-och-common-module 公用代码
|
||||
6. mogo-och-data 数据
|
||||
7. mogo-och-noop: 空实现,用于独立鹰眼打包
|
||||
8. mogo-och-shuttle 接驳模式司机端
|
||||
9. mogo-och-shuttle-passenger 接驳模式乘客屏
|
||||
10. mogo-och-sweeper: 清扫车
|
||||
11. mogo-och-taxi: 出租车模式司机端
|
||||
12. mogo-och-taxi-passenger: 出租车乘客端
|
||||
15
OCH/mogo-och-bus-passenger/README.md
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
src
|
||||
- androidTest Android 测试代码
|
||||
- basecommon 金旅开沃、接驳车 公用代码部分
|
||||
- jinlvvan 金旅开沃 独立代码部分
|
||||
- m1 金旅m1 独立代码部分
|
||||
- m2 金旅m2 独立代码部分
|
||||
- main 所有车型公用代码部分
|
||||
- shuttle 接驳车独立代码 因为接驳车和金旅开沃代码耦合厉害暂时放入到mogo-och-bus-passenger里面
|
||||
后期会创建独立module和mogo-och-bus-passenger平级
|
||||
- test 普通代码测试
|
||||
@@ -1,6 +1,7 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
@@ -15,9 +16,10 @@ android {
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles "consumer-rules.pro"
|
||||
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
arguments = [AROUTER_MODULE_NAME: project.getName()]
|
||||
kapt {
|
||||
useBuildCache = false
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.getName())
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,6 +29,10 @@ android {
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
@@ -37,6 +43,15 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
flavorDimensions "vehicle"
|
||||
productFlavors {
|
||||
// 车型:金旅星辰、开沃 小巴业务
|
||||
jinlvvan {
|
||||
dimension "vehicle"
|
||||
buildConfigField 'int', 'NEW_TEST', '0'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -46,12 +61,14 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
implementation rootProject.ext.dependencies.androidxrecyclerview
|
||||
implementation rootProject.ext.dependencies.material
|
||||
annotationProcessor rootProject.ext.dependencies.aroutercompiler
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
implementation rootProject.ext.dependencies.rxandroid
|
||||
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
||||
implementation rootProject.ext.dependencies.amapnavi3dmap
|
||||
implementation project(":OCH:mogo-och-common-module")
|
||||
compileOnly project(":libraries:mogo-map")
|
||||
implementation project(':core:mogo-core-res')
|
||||
testImplementation 'junit:junit:4.12'
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -6,12 +6,17 @@ import android.content.Context;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.MultiDisplayUtils;
|
||||
import com.mogo.och.bus.passenger.constant.BusPassengerConst;
|
||||
import com.mogo.och.bus.passenger.ui.BusPassengerRouteFragment;
|
||||
import com.mogo.och.common.module.wigets.video.VideoPlayerActivity;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -40,6 +45,10 @@ public class MogoOCHBusPassenger implements IMogoOCH {
|
||||
this.mActivity = activity;
|
||||
this.mContainerId = containerId;
|
||||
showFragment();
|
||||
|
||||
if (AppIdentityModeUtils.isJL(FunctionBuildConfig.appIdentityMode)) {
|
||||
MultiDisplayUtils.INSTANCE.startActWithSecond(activity, VideoPlayerActivity.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -69,14 +78,23 @@ public class MogoOCHBusPassenger implements IMogoOCH {
|
||||
}
|
||||
|
||||
private void showFragment() {
|
||||
if (mPassengerFragment == null) {
|
||||
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "准备add fragment======");
|
||||
mPassengerFragment = new BusPassengerRouteFragment();
|
||||
mActivity.getSupportFragmentManager().beginTransaction().add(mContainerId, mPassengerFragment).commitAllowingStateLoss();
|
||||
FragmentManager supportFragmentManager = mActivity.getSupportFragmentManager();
|
||||
if(mPassengerFragment == null){
|
||||
CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "准备add fragment======");
|
||||
Fragment fragmentByTag = supportFragmentManager.findFragmentByTag(BusPassengerRouteFragment.TAG);
|
||||
if (fragmentByTag instanceof BusPassengerRouteFragment){
|
||||
mPassengerFragment = (BusPassengerRouteFragment)fragmentByTag;
|
||||
}else {
|
||||
mPassengerFragment = new BusPassengerRouteFragment();
|
||||
}
|
||||
if (!mPassengerFragment.isAdded()){
|
||||
supportFragmentManager.beginTransaction().add(mContainerId, mPassengerFragment,BusPassengerRouteFragment.TAG).commitAllowingStateLoss();
|
||||
}
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "准备show fragment");
|
||||
mActivity.getSupportFragmentManager().beginTransaction().show(mPassengerFragment).commitAllowingStateLoss();
|
||||
|
||||
CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "准备show fragment");
|
||||
supportFragmentManager.beginTransaction().show(mPassengerFragment).commitAllowingStateLoss();
|
||||
}
|
||||
|
||||
private void hideFragment(){
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.mogo.och.bus.passenger.bean;
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.mogo.och.bus.passenger.callback;
|
||||
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created on 2022/3/31
|
||||
*/
|
||||
public interface IBusPassengerAutopilotPlanningCallback {
|
||||
void routeResult(List<LatLng> models,int haveArrivedIndex);
|
||||
void routePlanningToNextStationChanged(long meters, long timeInSecond);
|
||||
void updateTotalDistance();
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import java.util.List;
|
||||
*/
|
||||
public interface IBusPassengerRouteLineInfoCallback {
|
||||
void updateLineInfo(String lineName, String lineDurTime);
|
||||
void updateStationsInfo(List<BusPassengerStation> stations,int currentStationIndex,boolean isArrived);
|
||||
void updateStationsInfo(List<BusPassengerStation> stations, int currentStationIndex, boolean isArrived);
|
||||
void showNoTaskView();
|
||||
void hideNoTaskView();
|
||||
}
|
||||
@@ -28,14 +28,19 @@ import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener;
|
||||
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager;
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.CoordinateUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.och.bus.passenger.R;
|
||||
@@ -51,10 +56,17 @@ import com.mogo.och.bus.passenger.callback.IBusPassengerRouteLineInfoCallback;
|
||||
import com.mogo.och.bus.passenger.constant.BusPassengerConst;
|
||||
import com.mogo.och.bus.passenger.network.BusPassengerModelLoopManager;
|
||||
import com.mogo.och.bus.passenger.network.BusPassengerServiceManager;
|
||||
import com.mogo.och.common.module.bean.dpmsg.AppConnectMsg;
|
||||
import com.mogo.och.common.module.bean.dpmsg.BaseDPMsg;
|
||||
import com.mogo.och.common.module.bean.dpmsg.DPMsgType;
|
||||
import com.mogo.och.common.module.bean.dpmsg.LoginCacheStatus;
|
||||
import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager;
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst;
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback;
|
||||
import com.mogo.och.common.module.manager.AbnormalFactorsLoopManager;
|
||||
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
|
||||
import com.mogo.och.common.module.utils.PinYinUtil;
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -143,6 +155,7 @@ public class BusPassengerModel {
|
||||
public void onSuccess(BusPassengerOperationStatusResponse data) {
|
||||
if (data == null || data.data == null) return;
|
||||
if (mDriverStatusCallback != null) {
|
||||
CallerLogger.INSTANCE.d( M_BUS_P + TAG, "queryDriverOperationStatus = %s", data.data.plateNumber );
|
||||
mDriverStatusCallback.changeOperationStatus(data.data.driverStatus == 1);
|
||||
mDriverStatusCallback.updatePlateNumber(data.data.plateNumber);
|
||||
}
|
||||
@@ -171,38 +184,43 @@ public class BusPassengerModel {
|
||||
, new OchCommonServiceCallback<BusPassengerRoutesResponse>() {
|
||||
@Override
|
||||
public void onSuccess(BusPassengerRoutesResponse data) {
|
||||
if ( data == null
|
||||
|| data.getResult() == null
|
||||
|| data.getResult().getSites() == null) {
|
||||
routesResult = null;
|
||||
mNextStationIndex = 0;
|
||||
startOrStopCalculateRouteInfo(false);
|
||||
if (mRouteLineInfoCallback != null){
|
||||
mRouteLineInfoCallback.showNoTaskView();
|
||||
if ( data == null || data.getResult() == null) {
|
||||
CallerLogger.INSTANCE.d( M_BUS_P + TAG, "queryDriverSiteByCoordinate = null");
|
||||
if (routesResult != null) {
|
||||
routesResult = null;
|
||||
mNextStationIndex = 0;
|
||||
startOrStopCalculateRouteInfo(false);
|
||||
if (mRouteLineInfoCallback != null){
|
||||
mRouteLineInfoCallback.showNoTaskView();
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
if (routesResult != null && routesResult.equals(data.getResult())){
|
||||
if (routesResult != null && data.getResult().equals(routesResult)){
|
||||
CallerLogger.INSTANCE.d( M_BUS_P + TAG, "queryDriverSiteByCoordinate = not update");
|
||||
return;
|
||||
}
|
||||
routesResult = data.getResult();
|
||||
updatePassengerRouteInfo(data.getResult());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(int code, String msg) {
|
||||
CallerLogger.INSTANCE.d( M_BUS_P + TAG, "queryDriverSiteByCoordinate = %s", msg
|
||||
+ ", sn = " +BusPassengerServiceManager.INSTANCE.getDriverAppSn());
|
||||
if (code == 1003){
|
||||
queryDriverOperationDelay();
|
||||
}
|
||||
if (BusPassengerServiceManager.INSTANCE.getDriverAppSn().isEmpty()){
|
||||
//此处拦截是为了防止过程中乘客屏和司机端断连,拿不到司机端sn, 造成请求失败去刷新了界面
|
||||
return;
|
||||
}
|
||||
if (code == 1003){
|
||||
routesResult = null;
|
||||
startOrStopCalculateRouteInfo(false);
|
||||
queryDriverOperationDelay();
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d( M_BUS_P + TAG, "queryDriverSiteByCoordinate = %s", msg );
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -334,6 +352,9 @@ public class BusPassengerModel {
|
||||
//2021.11.1 自动驾驶路线规划接口
|
||||
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG,moGoAutopilotPlanningListener);
|
||||
|
||||
//监听司机端消息
|
||||
CallerTelematicListenerManager.INSTANCE.addListener(TAG,mReceivedMsgListener);
|
||||
|
||||
AbnormalFactorsLoopManager.INSTANCE.startLoopAbnormalFactors(mContext);
|
||||
}
|
||||
|
||||
@@ -348,10 +369,31 @@ public class BusPassengerModel {
|
||||
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.removeListener(mGoAutopilotStatusListener);
|
||||
CallerPlanningRottingListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener);
|
||||
CallerTelematicListenerManager.INSTANCE.removeListener(TAG);
|
||||
|
||||
AbnormalFactorsLoopManager.INSTANCE.stopLoopAbnormalFactors();
|
||||
}
|
||||
|
||||
private final IReceivedMsgListener mReceivedMsgListener = new IReceivedMsgListener() {
|
||||
@Override
|
||||
public void onReceivedMsg(int type, @NonNull byte[] byteArray) {
|
||||
if (OchCommonConst.BUSINESS_STRING == type){
|
||||
|
||||
BaseDPMsg baseMsg = GsonUtils.fromJson(new String(byteArray), BaseDPMsg.class);
|
||||
Logger.d(SceneConstant.M_BUS_P+TAG,"onReceivedMsg = "+GsonUtils.toJson(baseMsg));
|
||||
|
||||
if (baseMsg != null && baseMsg.getType() == DPMsgType.TYPE_COMMON.getType()){
|
||||
AppConnectMsg msg = GsonUtils.fromJson(new String(byteArray), AppConnectMsg.class);
|
||||
if (msg.isViewShow()){ //消息盒子显示内容
|
||||
OCHSocketMessageManager.INSTANCE.pushAppOperationalMsgBox(
|
||||
DateTimeUtil.getCurrentTimeStamp(),msg.getMsg(),
|
||||
OCHSocketMessageManager.OPERATION_SYSTEM);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//监听网络变化,避免启动机器时无网导致无法更新订单信息
|
||||
private final IMogoIntentListener mNetWorkIntentListener = new IMogoIntentListener() {
|
||||
@Override
|
||||
@@ -409,6 +451,7 @@ public class BusPassengerModel {
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autopilotStatusInfo) {
|
||||
if (autopilotStatusInfo == null) return;
|
||||
int state = autopilotStatusInfo.getState();
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
//2022.7.20 自动驾驶更换成带档位的
|
||||
@@ -484,7 +527,7 @@ public class BusPassengerModel {
|
||||
//找出前往站对应的轨迹点,拿出两站点的集合
|
||||
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "mRoutePoints.size() = " + mRoutePoints.size());
|
||||
if (mRoutePoints.size() > 0) {
|
||||
if (mStations.size() > 2){ //两个站点以上要计算两个站点间的估计路线
|
||||
if (mStations.size() > 1){ //两个站点及以上要计算两个站点间的轨迹路线
|
||||
if (mNextStationIndex <= mStations.size()-1 && mNextStationIndex - 1 >=0){
|
||||
mTwoStationsRouts.clear();
|
||||
BusPassengerStation stationNext = mStations.get(mNextStationIndex);
|
||||
@@ -503,10 +546,11 @@ public class BusPassengerModel {
|
||||
mTwoStationsRouts.addAll(mRoutePoints.subList(currentRouteIndex,nextRouteIndex + 1));
|
||||
}
|
||||
}
|
||||
}else { //只有两个站点的时候整个路线就是两个站点之间的轨迹
|
||||
mTwoStationsRouts.clear();
|
||||
mTwoStationsRouts.addAll(mRoutePoints);
|
||||
}
|
||||
// else { //只有两个站点的时候整个路线就是两个站点之间的轨迹
|
||||
// mTwoStationsRouts.clear();
|
||||
// mTwoStationsRouts.addAll(mRoutePoints);
|
||||
// }
|
||||
if (mTwoStationsRouts.size() > 0){
|
||||
float sumLength = CoordinateCalculateRouteUtil.calculateRouteSumLength(mTwoStationsRouts);
|
||||
SharedPrefsMgr.getInstance(mContext).putInt(BusPassengerConst.BUS_SP_KEY_ORDER_SUM_DIS,(int) sumLength);
|
||||
@@ -549,7 +593,8 @@ public class BusPassengerModel {
|
||||
}else {
|
||||
lastSumLength = CoordinateCalculateRouteUtil.calculateRouteSumLength(lastPoints);
|
||||
}
|
||||
double lastTime = lastSumLength / BusPassengerConst.BUS_AVERAGE_SPEED * 3.6 ; //秒
|
||||
|
||||
double lastTime = lastSumLength / getAverageSpeed() * 3.6 ; //秒
|
||||
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "轨迹排查==lastSumLength = " + lastSumLength);
|
||||
if (mAutopilotPlanningCallback != null){
|
||||
mAutopilotPlanningCallback.routePlanningToNextStationChanged((long)lastSumLength,(long) lastTime);
|
||||
@@ -558,6 +603,10 @@ public class BusPassengerModel {
|
||||
}
|
||||
}
|
||||
|
||||
public int getAverageSpeed(){
|
||||
return BusPassengerConst.BUS_AVERAGE_SPEED;
|
||||
}
|
||||
|
||||
public void startRemainRouteInfo() {
|
||||
//开启实时计算剩余距离,剩余时间,预计时间
|
||||
startOrStopCalculateRouteInfo(true);
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.mogo.och.bus.passenger.network
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.och.bus.passenger.constant.BusPassengerConst.Companion.getBaseUrl
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager.getServerToken
|
||||
import com.mogo.och.bus.passenger.bean.BusPassengerRoutesResponse
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.och.bus.passenger.bean.BusPassengerQueryLineRequest
|
||||
import com.mogo.och.bus.passenger.bean.BusPassengerOperationStatusResponse
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
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.network.OchCommonSubscribeImpl
|
||||
import com.mogo.och.common.module.biz.network.interceptor.transformTry
|
||||
@@ -17,15 +17,24 @@ import com.mogo.och.common.module.biz.network.interceptor.transformTry
|
||||
*/
|
||||
object BusPassengerServiceManager {
|
||||
|
||||
private var mBusPassengerServiceApi = MoGoRetrofitFactory.getInstance(getBaseUrl())
|
||||
.create(BusPassengerServiceApi::class.java)
|
||||
private var driverSnCache = ""
|
||||
|
||||
private var mBusPassengerServiceApi =
|
||||
MoGoRetrofitFactory.getInstance(OchCommonConst.getBaseUrl()).create(PassengerServiceApi::class.java)
|
||||
|
||||
/**
|
||||
* 获取Bus司机端的sn
|
||||
* @return
|
||||
*/
|
||||
private val driverAppSn: String
|
||||
get() = getServerToken()
|
||||
val driverAppSn: String
|
||||
get() {
|
||||
val serverToken = getServerToken()
|
||||
if (serverToken != driverSnCache && serverToken.isNotEmpty()) {
|
||||
driverSnCache = serverToken
|
||||
}
|
||||
return driverSnCache
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询绑定行驶的小巴车路线
|
||||
* @param context
|
||||
@@ -38,8 +47,10 @@ object BusPassengerServiceManager {
|
||||
mBusPassengerServiceApi.queryDriverSiteByCoordinate(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
BusPassengerQueryLineRequest(driverAppSn))
|
||||
.transformTry()
|
||||
BusPassengerQueryLineRequest(
|
||||
driverAppSn
|
||||
)
|
||||
).transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryDriverSiteByCoordinate"))
|
||||
}
|
||||
|
||||
@@ -51,11 +62,13 @@ object BusPassengerServiceManager {
|
||||
@JvmStatic
|
||||
fun queryDriverOperationStatus(
|
||||
context: Context,
|
||||
callback: OchCommonServiceCallback<BusPassengerOperationStatusResponse>?) {
|
||||
callback: OchCommonServiceCallback<BusPassengerOperationStatusResponse>?
|
||||
) {
|
||||
mBusPassengerServiceApi.queryDriverOperationStatus(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
driverAppSn)
|
||||
driverAppSn
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryDriverOperationStatus"))
|
||||
}
|
||||
@@ -17,7 +17,7 @@ import retrofit2.http.Query;
|
||||
*
|
||||
* Bus乘客端接口定义
|
||||
*/
|
||||
interface BusPassengerServiceApi {
|
||||
interface PassengerServiceApi {
|
||||
/**
|
||||
* 查询bus司机端绑定路线
|
||||
* @return 接口返回数据
|
||||
@@ -0,0 +1,223 @@
|
||||
package com.mogo.och.bus.passenger.ui;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.widget.ContentLoadingProgressBar;
|
||||
|
||||
import com.mogo.commons.mvp.IView;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.view.MapBizView;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.och.bus.passenger.R;
|
||||
import com.mogo.och.bus.passenger.constant.BusPassengerConst;
|
||||
import com.mogo.och.common.module.utils.NumberFormatUtil;
|
||||
|
||||
/**
|
||||
* Created on 2022/3/31
|
||||
* <p>
|
||||
* Bus乘客端基础Fragment
|
||||
*/
|
||||
public abstract class BusPassengerBaseFragment<V extends IView, P extends Presenter<V>> extends MvpFragment<V, P> {
|
||||
private static final String TAG = BusPassengerBaseFragment.class.getSimpleName();
|
||||
|
||||
private MapBizView mapBizView;
|
||||
private TextView mCurrentArriveStation;
|
||||
private TextView mCurrentArriveStationTitle;
|
||||
private TextView mCurrentArriveTip;
|
||||
private ImageView mAutopilotIv;
|
||||
private FrameLayout flContainer;
|
||||
private ContentLoadingProgressBar mProgressBar;
|
||||
|
||||
/**
|
||||
* 改变自动驾驶状态
|
||||
*
|
||||
* @param status 2 - running 1 - enable 2 - disable
|
||||
*/
|
||||
private int mPrevAPStatus = -1;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.bus_p_base_fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTagName() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
mapBizView = findViewById(R.id.mapBizView);
|
||||
mCurrentArriveStation = findViewById(R.id.bus_p_cur_station_name);
|
||||
mCurrentArriveStationTitle = findViewById(R.id.bus_p_cur_station_title);
|
||||
mCurrentArriveTip = findViewById(R.id.bus_p_cur_station_tip);
|
||||
mAutopilotIv = findViewById(R.id.bus_p_autopilot_iv);
|
||||
|
||||
mProgressBar = findViewById(R.id.bus_progress_bar);
|
||||
|
||||
showRouteFragment();
|
||||
|
||||
// mCurrentArriveStation.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
// @Override
|
||||
// public boolean onLongClick(View v) {
|
||||
// showOverviewFragment();
|
||||
// return false;
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews(Bundle savedInstanceState) {
|
||||
super.initViews(savedInstanceState);
|
||||
mapBizView.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
mapBizView.onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
mapBizView.onSaveInstanceState(outState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLowMemory() {
|
||||
super.onLowMemory();
|
||||
mapBizView.onLowMemory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
mapBizView.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
mapBizView.onDestroy();
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取站点面板view,在{@link #initViews()}时候添加到container中
|
||||
*
|
||||
* @return 站点面板view
|
||||
*/
|
||||
public abstract int getStationPanelViewId();
|
||||
|
||||
/**
|
||||
* 显示线路信息
|
||||
*/
|
||||
public void showRouteFragment() {
|
||||
flContainer = findViewById(R.id.bus_p_route_panel);
|
||||
LayoutInflater.from(getContext()).inflate(getStationPanelViewId(), flContainer);
|
||||
}
|
||||
|
||||
public void updateArrivedStation(String station,int currentIndex,boolean isArrived){
|
||||
if (null == station){
|
||||
mCurrentArriveStation.setText("----");
|
||||
mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_station_title_init));
|
||||
mCurrentArriveTip.setText(getResources().getString(R.string.bus_p_cur_station_arrived_tip));
|
||||
removeProgressBar();
|
||||
}else {
|
||||
mCurrentArriveStation.setText(station);
|
||||
if (currentIndex == 0){
|
||||
mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_station_title_init));
|
||||
mCurrentArriveTip.setText(getResources().getString(R.string.bus_p_cur_station_arrived_tip_init));
|
||||
removeProgressBar();
|
||||
return;
|
||||
}
|
||||
if (isArrived){
|
||||
mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_station_title));
|
||||
mCurrentArriveTip.setText(getResources().getString(R.string.bus_p_cur_station_arrived_tip));
|
||||
removeProgressBar();
|
||||
}else {
|
||||
mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_next_station_title));
|
||||
mProgressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void removeProgressBar() {
|
||||
mProgressBar.setProgress(0);
|
||||
mProgressBar.setMax(0);
|
||||
mProgressBar.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
public void updateRoutePlanningToNextStation(long meters, long timeInSecond){
|
||||
//更新进度条
|
||||
updateProgressBar(meters);
|
||||
String dis = "0";
|
||||
String disUnit = "公里";
|
||||
if (meters > 0){
|
||||
if (meters / 1000 < 1){
|
||||
disUnit = "米";
|
||||
dis = String.valueOf(Math.round(meters));
|
||||
}else {
|
||||
disUnit = "公里";
|
||||
dis = NumberFormatUtil.formatLong((double)meters / 1000);
|
||||
}
|
||||
}
|
||||
String strHtml2 = "<font color=\"#2D3E5F\">距离 </font>" + "<b><font color=\"#0043FF\">" + dis + "</font></b>" + "<font color=\"#2D3E5F\"> "+disUnit+"</font>"
|
||||
+ "<font color=\"#2D3E5F\">   剩余 </font>" + "<b><font color=\"#0043FF\">" + (int)Math.ceil((double)timeInSecond/ 60f) + "</font></b>" + "<font color=\"#2D3E5F\"> 分钟</font>";
|
||||
mCurrentArriveTip.setText(Html.fromHtml(strHtml2));
|
||||
}
|
||||
|
||||
private void updateProgressBar(long meters) {
|
||||
int haveDriven = new Long(meters).intValue();
|
||||
int progressInt = SharedPrefsMgr.getInstance(getContext())
|
||||
.getInt(BusPassengerConst.BUS_SP_KEY_ORDER_SUM_DIS,0) - haveDriven;
|
||||
mProgressBar.setProgress(progressInt);
|
||||
}
|
||||
|
||||
public void setProgressBarMax(){
|
||||
int max = SharedPrefsMgr.getInstance(getContext())
|
||||
.getInt(BusPassengerConst.BUS_SP_KEY_ORDER_SUM_DIS,0);
|
||||
mProgressBar.setMax(max);
|
||||
}
|
||||
|
||||
public void onAutopilotStatusChanged(int status) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
// 3. 其他过程直接更新
|
||||
if (mPrevAPStatus != status){
|
||||
AutopilotStatusChanged(status);
|
||||
}
|
||||
mPrevAPStatus = status;
|
||||
});
|
||||
}
|
||||
|
||||
public void AutopilotStatusChanged(int status) {
|
||||
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == status) {
|
||||
mAutopilotIv.setImageResource(R.drawable.bus_p_auto_nor);
|
||||
} else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == status){
|
||||
mAutopilotIv.setImageResource(R.drawable.bus_p_un_auto_nor);
|
||||
} else {
|
||||
mAutopilotIv.setImageResource(R.drawable.bus_p_un_auto_nor);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void showOverviewFragment() {
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
}
|
||||
},5000L);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,346 @@
|
||||
package com.mogo.och.bus.passenger.ui;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
|
||||
|
||||
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.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.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.och.bus.passenger.R;
|
||||
import com.mogo.och.bus.passenger.callback.IBusPassengerMapViewCallback;
|
||||
import com.mogo.och.bus.passenger.utils.BusPassengerMapAssetStyleUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 乘客屏小地图
|
||||
*/
|
||||
public class BusPassengerMapDirectionView
|
||||
extends RelativeLayout
|
||||
implements IMoGoChassisLocationGCJ02Listener,
|
||||
IBusPassengerMapDirectionView,
|
||||
AMap.OnCameraChangeListener {
|
||||
|
||||
//小地图名称
|
||||
public static final String TAG = "TPMapDirectionView";
|
||||
|
||||
private TextureMapView mAMapNaviView;
|
||||
private AMap mAMap;
|
||||
private Marker mCarMarker;
|
||||
|
||||
private List<LatLng> mCoordinatesLatLng = new ArrayList<>(); //轨迹坐标数据
|
||||
private List<LatLng> mLineStationLatLng = new ArrayList<>();//站点坐标数据
|
||||
private Polyline mPolyline;
|
||||
private CameraUpdate mCameraUpdate;
|
||||
private Context mContext;
|
||||
|
||||
List<BitmapDescriptor> textureList = new ArrayList<>();
|
||||
List<Integer> texIndexList = new ArrayList<>();
|
||||
private int mHaveArrivedIndex = 0;
|
||||
|
||||
private List<Marker> mLineMarkers = new ArrayList<>();
|
||||
|
||||
private IBusPassengerMapViewCallback mIBusPassengerMapViewCallback;
|
||||
private BitmapDescriptor mArrivedRes;
|
||||
private BitmapDescriptor mUnArrivedRes;
|
||||
|
||||
public BusPassengerMapDirectionView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public BusPassengerMapDirectionView(Context context, @Nullable AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public BusPassengerMapDirectionView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
try {
|
||||
initView(context);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void setTaxiPassengerMapViewCallback(IBusPassengerMapViewCallback iBusPassengerMapViewCallback) {
|
||||
this.mIBusPassengerMapViewCallback = iBusPassengerMapViewCallback;
|
||||
}
|
||||
|
||||
private void initView(Context context) {
|
||||
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "initView");
|
||||
|
||||
mContext = context;
|
||||
|
||||
View smpView = LayoutInflater.from(context).inflate(R.layout.bus_p_map_view, this);
|
||||
|
||||
mAMapNaviView = (TextureMapView) smpView.findViewById(R.id.bus_p_line_amap_view);
|
||||
|
||||
initAMapView();
|
||||
|
||||
// 注册定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
// 注册定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.removeListener(TAG);
|
||||
}
|
||||
|
||||
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.bus_p_map_car))
|
||||
.anchor(0.5f, 0.5f));
|
||||
|
||||
mArrivedRes = BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_arrow_arrived);
|
||||
mUnArrivedRes = BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_arrow_un_arrive);
|
||||
|
||||
// 加载自定义样式
|
||||
CustomMapStyleOptions customMapStyleOptions = new CustomMapStyleOptions()
|
||||
.setEnable(true)
|
||||
.setStyleData(BusPassengerMapAssetStyleUtil.getAssetsStyle(getContext(), "map_style.data"))
|
||||
.setStyleExtraData(BusPassengerMapAssetStyleUtil.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_BUS_P + TAG, "smp---onMapLoaded");
|
||||
// 加载自定义样式
|
||||
CustomMapStyleOptions customMapStyleOptions = new CustomMapStyleOptions()
|
||||
.setEnable(true)
|
||||
.setStyleData(BusPassengerMapAssetStyleUtil.getAssetsStyle(getContext(), "map_style.data"))
|
||||
.setStyleExtraData(BusPassengerMapAssetStyleUtil.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 onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
|
||||
if (gnssInfo == null) {
|
||||
return;
|
||||
}
|
||||
// CallerLogger.INSTANCE.d(M_BUS_P + TAG, "onCarLocationChanged2 :" + location.getLatitude() + ":" + location.getLongitude());
|
||||
LatLng currentLatLng = new LatLng(gnssInfo.getLatitude(), gnssInfo.getLongitude());
|
||||
|
||||
//更新车辆位置
|
||||
if (mCarMarker != null) {
|
||||
// CallerLogger.INSTANCE.d(M_BUS_P + TAG, "location.getBearing() = " + location.getBearing());
|
||||
mCarMarker.setRotateAngle((float) (360 - gnssInfo.getHeading()));
|
||||
mCarMarker.setPosition(currentLatLng);
|
||||
mCarMarker.setToTop();
|
||||
}
|
||||
|
||||
//圈定地图显示范围
|
||||
LatLngBounds.Builder boundsBuilder = new LatLngBounds.Builder();
|
||||
|
||||
if (mCoordinatesLatLng.size() > 0){
|
||||
//存放经纬度
|
||||
for (int i = 0; i < mCoordinatesLatLng.size(); i++) {
|
||||
boundsBuilder.include(mCoordinatesLatLng.get(i));
|
||||
}
|
||||
//第二个参数为四周留空宽度
|
||||
}else if (mLineStationLatLng.size() > 0){
|
||||
for (int i = 0; i< mLineStationLatLng.size();i++){
|
||||
boundsBuilder.include(mLineStationLatLng.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
boundsBuilder.include(currentLatLng);
|
||||
mAMap.moveCamera(CameraUpdateFactory.newLatLngBoundsRect(boundsBuilder.build(),100,100,100,100));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void drawablePolyline() {
|
||||
if (mPolyline != null) {
|
||||
mPolyline.remove();
|
||||
}
|
||||
if (mAMap != null) {
|
||||
|
||||
addRouteColorList();
|
||||
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "mLinePointsLatLng.size() = " +mLineStationLatLng.size()
|
||||
+" mCoordinatesLatLng.size()= " + mCoordinatesLatLng.size());
|
||||
if (mLineStationLatLng.size() >= 2 && mCoordinatesLatLng.size() > 2) {
|
||||
//设置线段纹理
|
||||
PolylineOptions polylineOptions = new PolylineOptions();
|
||||
polylineOptions.addAll(mCoordinatesLatLng);
|
||||
polylineOptions.width(14); //线段宽度
|
||||
polylineOptions.setUseTexture(true);
|
||||
polylineOptions.lineCapType(PolylineOptions.LineCapType.LineCapRound);
|
||||
polylineOptions.setCustomTextureList(textureList);
|
||||
polylineOptions.setCustomTextureIndex(texIndexList);
|
||||
// polylineOptions.colorValues(colorList);
|
||||
// polylineOptions.setCustomTexture(BitmapDescriptorFactory.fromResource(R.drawable.taxi_p_map_arrow));
|
||||
|
||||
// 绘制线
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearPolyline() {
|
||||
if (mPolyline != null) {
|
||||
mPolyline.remove();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLineMarker() {
|
||||
|
||||
}
|
||||
|
||||
public void clearCoordinatesLatLng(){
|
||||
textureList.clear();
|
||||
texIndexList.clear();
|
||||
mCoordinatesLatLng.clear();
|
||||
mLineStationLatLng.clear();
|
||||
CallerLogger.INSTANCE.d(M_BUS_P + TAG, " mCoordinatesLatLng.clear " );
|
||||
}
|
||||
|
||||
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 setCoordinatesLatLng(List<LatLng> latLngs,int haveArrivedIndex) {
|
||||
mCoordinatesLatLng.clear();
|
||||
mCoordinatesLatLng.addAll(latLngs);
|
||||
mHaveArrivedIndex = haveArrivedIndex;
|
||||
}
|
||||
|
||||
public void clearLineMarkers(){
|
||||
for (int i =0; i< mLineMarkers.size();i++){
|
||||
mLineMarkers.get(i).setVisible(false);
|
||||
mLineMarkers.get(i).remove();
|
||||
}
|
||||
mLineMarkers.clear();
|
||||
}
|
||||
|
||||
public void setLinePointMarkerAndDraw(List<LatLng> mLineStationsList, int currentIndex) {
|
||||
clearLineMarkers();
|
||||
mLineStationLatLng.clear();
|
||||
mLineStationLatLng.addAll(mLineStationsList);
|
||||
|
||||
if (mLineStationsList.size() > 0){
|
||||
for (int i = 0; i < mLineStationsList.size(); i++) {
|
||||
if (currentIndex == i){
|
||||
Marker mEndMarker = mAMap.addMarker(new MarkerOptions()
|
||||
.icon(BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_view_dir_end_point)));
|
||||
mEndMarker.setPosition(mLineStationsList.get(i));
|
||||
mLineMarkers.add(i,mEndMarker);
|
||||
}else {
|
||||
Marker mStartMarker = mAMap.addMarker(new MarkerOptions()
|
||||
.icon(BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_view_dir_way_point)));
|
||||
mStartMarker.setPosition(mLineStationsList.get(i));
|
||||
mLineMarkers.add(i,mStartMarker);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCameraChange(CameraPosition cameraPosition) {
|
||||
mIBusPassengerMapViewCallback.onCameraChange(cameraPosition.bearing);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCameraChangeFinish(CameraPosition cameraPosition) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,7 @@ public class BusPassengerRouteFragment extends
|
||||
BusPassengerBaseFragment<BusPassengerRouteFragment, BaseBusPassengerPresenter>
|
||||
implements IBusPassengerMapViewCallback {
|
||||
|
||||
private final String TAG = "BusPassengerRouteFragment";
|
||||
public static final String TAG = "BusPassengerRouteFragment";
|
||||
|
||||
private final List<BusPassengerStation> mStationsList = new ArrayList<>();
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListen
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import kotlinx.android.synthetic.main.bus_p_traffic_light_view.view.*
|
||||
import kotlinx.android.synthetic.jinlvvan.bus_p_traffic_light_view.view.*
|
||||
|
||||
/**
|
||||
* bus乘客端:红绿灯view
|
||||
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 765 B After Width: | Height: | Size: 765 B |
|
Before Width: | Height: | Size: 797 B After Width: | Height: | Size: 797 B |
|
Before Width: | Height: | Size: 795 B After Width: | Height: | Size: 795 B |
|
Before Width: | Height: | Size: 765 B After Width: | Height: | Size: 765 B |
|
Before Width: | Height: | Size: 879 B After Width: | Height: | Size: 879 B |
|
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 628 B After Width: | Height: | Size: 628 B |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 594 B After Width: | Height: | Size: 594 B |
@@ -0,0 +1,173 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
android:id="@+id/mapBizView"
|
||||
android:layout_width="@dimen/dp_1860"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugViewTrigger
|
||||
android:layout_width="@dimen/dp_400"
|
||||
android:layout_height="@dimen/dp_100"
|
||||
android:longClickable="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.SteeringWheelView
|
||||
android:id="@+id/steering_wheel"
|
||||
android:layout_width="@dimen/dp_490"
|
||||
android:layout_height="@dimen/dp_490"
|
||||
android:layout_marginLeft="@dimen/dp_50"
|
||||
android:layout_marginTop="@dimen/dp_88"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bus_p_autopilot_iv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/bus_p_curent_station_panel_margin"
|
||||
android:layout_marginTop="@dimen/dp_112"
|
||||
android:scaleType="fitXY"
|
||||
android:visibility="gone"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:src="@drawable/bus_p_un_auto_nor"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<!--浓雾预警动画-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.V2XFogEventView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<!--pnc行为决策-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_100"
|
||||
android:layout_marginBottom="@dimen/dp_110"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<com.mogo.och.common.module.wigets.OCHBorderShadowLayout
|
||||
android:id="@+id/arrive_station_shadow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/bus_p_curent_station_panel_margin_left"
|
||||
android:layout_marginBottom="@dimen/bus_p_curent_station_panel_margin"
|
||||
app:bgColor="@android:color/transparent"
|
||||
app:blurRadius="@dimen/dp_30"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:shadowColor="@color/bus_p_panel_edge_shadow"
|
||||
app:shadowRadius="@dimen/dp_30"
|
||||
app:xOffset="0dp"
|
||||
app:yOffset="0dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="@dimen/bus_p_curent_station_panel_width"
|
||||
android:layout_height="@dimen/bus_p_curent_station_panel_height"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:background="@drawable/bus_p_panel_cur_station_panel">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bus_p_cur_station_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_56"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:text="@string/bus_p_cur_station_title"
|
||||
android:textColor="@color/bus_p_panel_cur_txt_color"
|
||||
android:textSize="@dimen/bus_p_curent_station_txt_size"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bus_p_cur_station_name"
|
||||
android:layout_width="@dimen/bus_p_curent_station_txt_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="-- --"
|
||||
android:textColor="@color/bus_p_panel_cur_station_txt_color"
|
||||
android:textSize="@dimen/bus_p_curent_station_txt_size1"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_cur_station_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bus_p_cur_station_title" />
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="@dimen/dp_20"
|
||||
android:layout_height="@dimen/dp_27"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_cur_station_name"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_cur_station_name"
|
||||
app:layout_constraintRight_toLeftOf="@+id/bus_p_cur_station_name"
|
||||
android:layout_marginRight="@dimen/dp_10"
|
||||
android:src="@drawable/station_arrow">
|
||||
|
||||
</androidx.appcompat.widget.AppCompatImageView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bus_p_cur_station_tip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:text="@string/bus_p_cur_station_arrived_tip"
|
||||
android:textColor="@color/bus_p_panel_cur_station_tips_color"
|
||||
android:textSize="@dimen/bus_p_curent_station_tip_size1"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_cur_station_name"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bus_p_cur_station_name" />
|
||||
|
||||
<androidx.core.widget.ContentLoadingProgressBar
|
||||
android:id="@+id/bus_progress_bar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_10"
|
||||
android:progress="0"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginLeft="@dimen/dp_12"
|
||||
android:layout_marginRight="@dimen/dp_15"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:progressDrawable="@drawable/bus_progress_bar_bg" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.mogo.och.common.module.wigets.OCHBorderShadowLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/bus_p_route_panel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_299"
|
||||
android:layout_height="@dimen/dp_75"
|
||||
android:layout_marginRight="@dimen/dp_40"
|
||||
android:layout_marginBottom="@dimen/dp_48"
|
||||
android:src="@drawable/bus_p_mogo_nor"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/bus_p_route_panel" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.BusPassengerMsgBoxBubbleView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintRight_toLeftOf="@+id/bus_p_route_panel"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginRight="@dimen/dp_40"
|
||||
android:layout_marginTop="@dimen/dp_100"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,182 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/transparent">
|
||||
|
||||
<com.mogo.och.common.module.wigets.OCHBorderShadowLayout
|
||||
android:id="@+id/edge_view"
|
||||
android:layout_width="725dp"
|
||||
android:layout_height="match_parent"
|
||||
app:shadowColor="@color/bus_p_route_view_left_edge_shadow"
|
||||
app:xOffset="0dp"
|
||||
app:yOffset="0dp"
|
||||
app:bgColor="@android:color/transparent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="@dimen/bus_p_route_info_panel_width"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/transparent" />
|
||||
</com.mogo.och.common.module.wigets.OCHBorderShadowLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="@dimen/bus_p_route_info_panel_width"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bus_p_route_bg"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bus_p_speed_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/bus_p_route_info_margin_left"
|
||||
android:layout_marginTop="@dimen/bus_p_route_info_margin_top"
|
||||
android:includeFontPadding="false"
|
||||
android:letterSpacing="-0.05"
|
||||
android:text="0"
|
||||
android:textColor="@color/bus_p_speed_txt_color"
|
||||
android:textSize="@dimen/bus_p_speed_txt_size"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bus_p_unit_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:layout_marginRight="@dimen/bus_p_route_info_margin_right"
|
||||
android:layout_marginBottom="@dimen/dp_20"
|
||||
android:includeFontPadding="false"
|
||||
android:textStyle="bold"
|
||||
android:text="@string/bus_p_speed_unit_txt"
|
||||
android:textColor="@color/bus_p_speed_txt_color"
|
||||
android:textSize="@dimen/bus_p_speed_unit_txt_size"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_speed_tv"
|
||||
app:layout_constraintLeft_toRightOf="@+id/bus_p_speed_tv" />
|
||||
|
||||
<com.mogo.och.bus.passenger.ui.BusPassengerTrafficLightView
|
||||
android:id="@+id/bus_p_traffic_light_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="@dimen/bus_p_route_info_margin_right"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_unit_tv"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/dividing_line_1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bus_p_route_line_dividing_view_height"
|
||||
android:background="@drawable/bus_p_dividing_line_bg"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bus_p_speed_tv" />
|
||||
|
||||
<include
|
||||
layout="@layout/bus_p_no_data_common_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@+id/bus_p_line_map_view"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/dividing_line_1" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/bus_p_line_cl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/bus_p_line_map_view"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/dividing_line_1">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bus_p_driver_num_plate_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/bus_p_route_info_margin_left"
|
||||
android:layout_marginTop="@dimen/bus_p_driver_number_plate_margin_top"
|
||||
android:text="----"
|
||||
android:textColor="@color/bus_p_driver_number_plate_color"
|
||||
android:textSize="@dimen/bus_p_driver_number_plate_size"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.mogo.och.common.module.wigets.MarqueeTextView
|
||||
android:id="@+id/bus_p_line_name_tv"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_20"
|
||||
android:layout_marginRight="@dimen/dp_20"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:text="----"
|
||||
app:customGap="0.5"
|
||||
app:useCustomGap="true"
|
||||
android:textColor="@color/bus_p_line_name_color"
|
||||
android:textSize="@dimen/bus_p_driver_number_plate_size"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toRightOf="@+id/bus_p_driver_num_plate_tv"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_driver_num_plate_tv"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_driver_num_plate_tv"
|
||||
app:layout_goneMarginLeft="0dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/line_operation_time_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/bus_p_line_operation_time_margin_top"
|
||||
android:text="-- --"
|
||||
android:textColor="@color/bus_p_line_operation_time_color"
|
||||
android:textSize="@dimen/bus_p_line_operation_time_size"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_driver_num_plate_tv"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/dividing_line_2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bus_p_route_line_dividing_view_height"
|
||||
android:layout_marginTop="@dimen/bus_p_route_dividing_line2_margin_top"
|
||||
android:background="@drawable/bus_p_dividing_line_bg"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/bus_p_line_stations_rl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_260"
|
||||
android:paddingBottom="@dimen/dp_20"
|
||||
android:paddingLeft="@dimen/dp_30"
|
||||
android:paddingRight="@dimen/bus_p_route_info_margin_right"
|
||||
android:requiresFadingEdge="vertical"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_driver_num_plate_tv"
|
||||
app:layout_constraintTop_toBottomOf="@+id/dividing_line_2" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.mogo.och.bus.passenger.ui.BusPassengerMapDirectionView
|
||||
android:id="@+id/bus_p_line_map_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bus_p_route_line_map_view_height"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bus_p_arrow_nor"
|
||||
android:layout_width="@dimen/dp_108"
|
||||
android:layout_height="@dimen/dp_107"
|
||||
android:layout_marginRight="@dimen/dp_20"
|
||||
android:layout_marginBottom="@dimen/dp_370"
|
||||
android:src="@drawable/bus_p_arrow_nor"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="bus_p_route_info_panel_width">700dp</dimen>
|
||||
<dimen name="bus_p_auto_icon_margin_top">40dp</dimen>
|
||||
<dimen name="bus_p_route_info_margin_right">40dp</dimen>
|
||||
<dimen name="bus_p_route_info_margin_left">40dp</dimen>
|
||||
<dimen name="bus_p_route_info_margin_bottom">40dp</dimen>
|
||||
<dimen name="bus_p_route_info_margin_top">110dp</dimen>
|
||||
<dimen name="bus_p_route_line_info_height">224dp</dimen>
|
||||
<dimen name="bus_p_route_line_map_view_height">510dp</dimen>
|
||||
<dimen name="bus_p_route_line_dividing_view_height">3dp</dimen>
|
||||
|
||||
<dimen name="bus_p_route_traffic_light_view_width">158dp</dimen>
|
||||
<dimen name="bus_p_route_traffic_light_view_height">90dp</dimen>
|
||||
<dimen name="bus_p_route_traffic_light_view_corner">45dp</dimen>
|
||||
<dimen name="bus_p_traffic_light_bg_width">158dp</dimen>
|
||||
<dimen name="bus_p_traffic_light_bg_height">90dp</dimen>
|
||||
<dimen name="bus_p_traffic_light_time_size">45dp</dimen>
|
||||
<dimen name="bus_p_traffic_light_time_view_width">90dp</dimen>
|
||||
<dimen name="bus_p_traffic_light_icon_size">90dp</dimen>
|
||||
<dimen name="bus_p_traffic_light_bg_stroke_width">3dp</dimen>
|
||||
|
||||
<dimen name="bus_p_route_dividing_line2_margin_top">224dp</dimen>
|
||||
<dimen name="bus_p_driver_number_plate_margin_top">50dp</dimen>
|
||||
<dimen name="bus_p_driver_number_plate_margin_bottom">50dp</dimen>
|
||||
<dimen name="bus_p_driver_number_plate_size">44dp</dimen>
|
||||
<dimen name="bus_p_line_operation_time_margin_top">130dp</dimen>
|
||||
<dimen name="bus_p_line_operation_time_size">38dp</dimen>
|
||||
|
||||
<dimen name="bus_p_no_data_size">36dp</dimen>
|
||||
|
||||
<dimen name="bus_p_speed_txt_size">110dp</dimen>
|
||||
<dimen name="bus_p_speed_unit_txt_size">42dp</dimen>
|
||||
|
||||
<dimen name="bus_p_station_circle_borner_size">4dp</dimen>
|
||||
<dimen name="bus_p_station_circle_radius_size">10dp</dimen>
|
||||
<dimen name="bus_p_station_circle_width_height">20dp</dimen>
|
||||
<dimen name="bus_p_station_tag_width_height">60dp</dimen>
|
||||
<dimen name="bus_p_station_tag_radius_size">30dp</dimen>
|
||||
<dimen name="bus_p_cur_station_circle_width">20dp</dimen>
|
||||
<dimen name="bus_p_cur_station_circle_height">50dp</dimen>
|
||||
<dimen name="bus_p_mid_station_circle_cor">6dp</dimen>
|
||||
<dimen name="bus_p_station_txt_size">50dp</dimen>
|
||||
<dimen name="bus_p_station_tag_txt_size">36dp</dimen>
|
||||
<dimen name="bus_p_station_item_height">80dp</dimen>
|
||||
<dimen name="bus_p_station_item_middle_height">100dp</dimen>
|
||||
<dimen name="bus_p_station_tag_line_height">80dp</dimen>
|
||||
<dimen name="bus_p_station_tag_line_height1">60dp</dimen>
|
||||
<dimen name="bus_p_station_tag_line_width">6dp</dimen>
|
||||
|
||||
<dimen name="bus_p_curent_station_panel_width">685dp</dimen>
|
||||
<dimen name="bus_p_curent_station_panel_height">309dp</dimen>
|
||||
<dimen name="bus_p_curent_station_panel_margin">50dp</dimen>
|
||||
<dimen name="bus_p_curent_station_panel_margin_left">10dp</dimen>
|
||||
<dimen name="bus_p_curent_station_txt_size">44dp</dimen>
|
||||
<dimen name="bus_p_curent_station_txt_size1">55dp</dimen>
|
||||
<dimen name="bus_p_curent_station_tip_size1">40dp</dimen>
|
||||
|
||||
<dimen name="bus_p_curent_station_txt_width">584dp</dimen>
|
||||
<dimen name="bus_p_station_txt_width">550dp</dimen>
|
||||
</resources>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="bus_p_speed_unit_txt">KM/H</string>
|
||||
<string name="bus_p_no_out">您已收车</string>
|
||||
<string name="bus_p_no_task">暂无班次</string>
|
||||
<string name="bus_p_start_station_txt_tag">起</string>
|
||||
<string name="bus_p_end_station_txt_tag">终</string>
|
||||
<string name="bus_p_cur_station_title">到达站:</string>
|
||||
<string name="bus_p_cur_next_station_title">下一站:</string>
|
||||
<string name="bus_p_cur_station_title_init">始发站:</string>
|
||||
<string name="bus_p_cur_station_arrived_tip">请携带好随身物品下车。</string>
|
||||
<string name="bus_p_cur_station_arrived_tip_init">欢迎乘坐\'蘑菇车联\'自动驾驶车。</string>
|
||||
</resources>
|
||||
@@ -8,20 +8,6 @@ import com.mogo.commons.debug.DebugConfig
|
||||
class BusPassengerConst {
|
||||
companion object {
|
||||
|
||||
private const val BASE_URL_OCH_DEV = "http://tech-dev.zhidaohulian.com"
|
||||
private const val BASE_URL_OCH_QA = "https://tech-qa.zhidaohulian.com"
|
||||
private const val BASE_URL_OCH_RELEASE = "https://tech.zhidaohulian.com"
|
||||
|
||||
@JvmStatic
|
||||
fun getBaseUrl(): String {
|
||||
return when (DebugConfig.getNetMode()) {
|
||||
DebugConfig.NET_MODE_DEV, DebugConfig.NET_MODE_DEMO -> BASE_URL_OCH_DEV
|
||||
DebugConfig.NET_MODE_QA -> BASE_URL_OCH_QA
|
||||
DebugConfig.NET_MODE_RELEASE -> BASE_URL_OCH_RELEASE
|
||||
else -> BASE_URL_OCH_RELEASE
|
||||
}
|
||||
}
|
||||
|
||||
// OCH arouter 路由path
|
||||
const val PATH = "/passenger/api"
|
||||
|
||||
@@ -41,6 +27,8 @@ class BusPassengerConst {
|
||||
|
||||
//bus平均速度 bus的平均里程:25km/h
|
||||
const val BUS_AVERAGE_SPEED = 25
|
||||
//接驳/B2平均速度 bus的平均里程:10km/h
|
||||
const val SHUTTLE_AVERAGE_SPEED = 10
|
||||
|
||||
// 订单总里程
|
||||
const val BUS_SP_KEY_ORDER_SUM_DIS = "BUS_SP_KEY_ORDER_SUM_DIS"
|
||||
|
||||
BIN
OCH/mogo-och-bus-passenger/src/main/res/raw/bus_di.mp3
Normal file
@@ -1,17 +1,15 @@
|
||||
//package com.mogo.och.bus.passenger;
|
||||
//
|
||||
//import org.junit.Test;
|
||||
//
|
||||
//import static org.junit.Assert.*;
|
||||
//
|
||||
///**
|
||||
// * Example local unit test, which will execute on the development machine (host).
|
||||
// *
|
||||
// * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
// */
|
||||
//public class ExampleUnitTest {
|
||||
// @Test
|
||||
// public void addition_isCorrect() {
|
||||
// assertEquals(4, 2 + 2);
|
||||
// }
|
||||
//}
|
||||
package com.mogo.och.bus.passenger;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -27,6 +27,10 @@ android {
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
@@ -37,6 +41,24 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
flavorDimensions "vehicle"
|
||||
productFlavors {
|
||||
|
||||
jinlvvan {
|
||||
dimension "vehicle"
|
||||
buildConfigField 'int', 'NEW_TEST', '0'
|
||||
}
|
||||
|
||||
// 小巴车 接驳车 这个维度应该放入的最外层 但是和小巴的代码耦合的太严重放到了这个地方
|
||||
// 乘客端删除了这个flavors 是因为乘客端这个地方比较简单
|
||||
shuttle {
|
||||
dimension "vehicle"
|
||||
buildConfigField 'int', 'NEW_TEST', '1'
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -6,36 +6,25 @@ package com.mogo.och.bus.bean;
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class BusStationBean {
|
||||
// private int lineId;
|
||||
// private int siteId;
|
||||
// private String siteName;
|
||||
// private String cityCode;
|
||||
// private String areaCode;
|
||||
// private String areaName;
|
||||
// private double lat;
|
||||
// private double lon;
|
||||
// private String siteDesc;
|
||||
// private int siteState;
|
||||
// private int isCurrentSite;// @see OchBusConst 是否是当前站 1:是 2:下一站 0:普通站
|
||||
// private int siteColor;
|
||||
// private String peoples;
|
||||
// private int ifStop; // 是否需要停靠、1需要、0不需要
|
||||
|
||||
|
||||
private int siteId;
|
||||
private String name;
|
||||
private String description;
|
||||
private String cityCode;
|
||||
private double lon; //高精坐标
|
||||
private double lat; //高精坐标
|
||||
private int businessType; //站点类型,9:taxi,10:bus
|
||||
private String nameKr;
|
||||
private int seq;
|
||||
private double gcjLon; //高德
|
||||
private double gcjLat; //高德
|
||||
private int status;
|
||||
private int siteId;
|
||||
private int seq;
|
||||
private double lon; //高精坐标
|
||||
private double lat; //高精坐标
|
||||
private int drivingStatus;//行驶信息,0初始值;1已经过;2当前站;3未到站
|
||||
private int ifStop = 1; // 是否需要停靠、1需要、0不需要 // TODO: 2021/10/19 原来站点里有设计是否需要停靠字段,现设计暂无,默认都需要停靠
|
||||
private boolean leaving;
|
||||
private String description;
|
||||
private String cityCode;
|
||||
private int businessType; //站点类型,9:taxi,10:bus
|
||||
private int status;
|
||||
private int ifStop = 1; // 是否需要停靠、1需要、0不需要 // TODO: 2021/10/19 原来站点里有设计是否需要停靠字段,现设计暂无,默认都需要停靠
|
||||
|
||||
public String getNameKr() {
|
||||
return nameKr;
|
||||
}
|
||||
|
||||
public double getGcjLon() {
|
||||
return gcjLon;
|
||||
@@ -48,7 +48,7 @@ import com.mogo.och.bus.callback.IPassengerCallback;
|
||||
import com.mogo.och.bus.callback.IRefreshBusStationsCallback;
|
||||
import com.mogo.och.bus.callback.ISlidePannelHideCallback;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
import com.mogo.och.bus.net.BusServiceManager;
|
||||
import com.mogo.och.bus.net.OrderServiceManager;
|
||||
import com.mogo.och.bus.presenter.BusModelLoopManager;
|
||||
import com.mogo.och.bus.util.BusAnalyticsManager;
|
||||
import com.mogo.och.bus.util.BusSendTripInfoManager;
|
||||
@@ -66,6 +66,7 @@ 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.ToastUtilsOch;
|
||||
import com.mogo.och.common.module.voice.VoiceManager;
|
||||
import com.mogo.och.common.module.voice.VoiceNotice;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -85,13 +86,13 @@ import mogo.telematics.pad.MessagePad;
|
||||
* <p>
|
||||
* 小巴订单管理
|
||||
*/
|
||||
public class BusOrderModel {
|
||||
private final String TAG = BusOrderModel.class.getSimpleName();
|
||||
public class OrderModel {
|
||||
private final String TAG = OrderModel.class.getSimpleName();
|
||||
private int currentLineId = -1;
|
||||
private int currentTaskId = -1;
|
||||
private int backgroundCurrentStationIndex = 0;//A->B 此处值是A站点索引
|
||||
|
||||
private static volatile BusOrderModel sInstance;
|
||||
private static volatile OrderModel sInstance;
|
||||
public double mLongitude = 0;
|
||||
public double mLatitude = 0;
|
||||
private Context mContext;
|
||||
@@ -132,18 +133,18 @@ public class BusOrderModel {
|
||||
}
|
||||
});
|
||||
|
||||
public static BusOrderModel getInstance() {
|
||||
public static OrderModel getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (BusOrderModel.class) {
|
||||
synchronized (OrderModel.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new BusOrderModel();
|
||||
sInstance = new OrderModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
private BusOrderModel() {
|
||||
private OrderModel() {
|
||||
|
||||
}
|
||||
|
||||
@@ -223,8 +224,8 @@ public class BusOrderModel {
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.i(M_BUS + TAG,"onMsgReceived = "+obj.getMessage());
|
||||
OCHSocketMessageManager.INSTANCE.pushAppOperationalMsgBox(obj.getPushTimeStamp(),
|
||||
obj.getMessage());
|
||||
OCHSocketMessageManager.INSTANCE.pushAppOperationalMsgBox(DateTimeUtil.getCurrentTimeStamp(),
|
||||
obj.getMessage(),OCHSocketMessageManager.OPERATION_SYSTEM);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -302,7 +303,7 @@ public class BusOrderModel {
|
||||
BusStationBean currentStation = stationList.get(backgroundCurrentStationIndex);
|
||||
BusStationBean nextStation = stationList.get(backgroundCurrentStationIndex + 1);
|
||||
|
||||
BusServiceManager.updateOrderRoute(mContext, currentLineId, currentStation.getSiteId()
|
||||
OrderServiceManager.updateOrderRoute(mContext, currentLineId, currentStation.getSiteId()
|
||||
, nextStation.getSiteId(), points, new OchCommonServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
@@ -421,7 +422,7 @@ public class BusOrderModel {
|
||||
*/
|
||||
public void queryBusRoutes() {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "查询小巴路线");
|
||||
BusServiceManager.queryBusRoutes(mContext, new OchCommonServiceCallback<BusRoutesResponse>() {
|
||||
OrderServiceManager.queryBusRoutes(mContext, new OchCommonServiceCallback<BusRoutesResponse>() {
|
||||
@Override
|
||||
public void onSuccess(BusRoutesResponse data) {
|
||||
if (data == null
|
||||
@@ -499,7 +500,7 @@ public class BusOrderModel {
|
||||
|
||||
String lineTime = DateTimeUtil.formatLongToString(
|
||||
busRoutesResult.getTaskTime(),
|
||||
DateTimeUtil.TAXI_HH_mm);
|
||||
DateTimeUtil.HH_mm);
|
||||
|
||||
if (arrivingOrArrivedStationIndex == 0 ||
|
||||
arrivingOrArrivedStation.getDrivingStatus() == STATION_STATUS_STOPPED
|
||||
@@ -523,7 +524,7 @@ public class BusOrderModel {
|
||||
*/
|
||||
public void abortTask() {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "结束当前路线abortTask");
|
||||
BusServiceManager.abortTask(mContext, currentTaskId
|
||||
OrderServiceManager.abortTask(mContext, currentTaskId
|
||||
, new OchCommonServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
@@ -533,7 +534,7 @@ public class BusOrderModel {
|
||||
clearBusStationDatas();
|
||||
queryBusRoutes();
|
||||
removeTipRunnables();
|
||||
// startOrStopQueryPassengerWriteOff(false);
|
||||
// startOrStopQueryPassengerWriteOff(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -580,11 +581,12 @@ public class BusOrderModel {
|
||||
* 服务端返回的OchBusRoutesResult逻辑, 离开站为当前站, 到达下一站后才会将下一站置为当前站,
|
||||
* 车机端展示是离开当前站,下一站设置为当前站, 所以服务端数据回来要做处理,不能直接渲染
|
||||
*/
|
||||
private void leaveStationSuccess(int leaveIndex, String leaveStation, String nextStation) {
|
||||
private void leaveStationSuccess(int leaveIndex, String leaveStation,
|
||||
String nextStation, String nextStationKr) {
|
||||
|
||||
onStartAutopilot(leaveIndex);
|
||||
|
||||
leaveTTSTips(nextStation);
|
||||
leaveTTSTips(nextStation,nextStationKr);
|
||||
|
||||
if (busRoutesResult != null) {
|
||||
boolean isLastStop = false;
|
||||
@@ -656,10 +658,11 @@ public class BusOrderModel {
|
||||
}
|
||||
int arrivedStationIndex = backgroundCurrentStationIndex + 1;
|
||||
String arriveStation = stationList.get(arrivedStationIndex).getName();
|
||||
String arriveStationKr = stationList.get(arrivedStationIndex).getNameKr();
|
||||
String departureStopName = stationList.get(backgroundCurrentStationIndex).getName();
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "arriveSiteStation-currentStationIndex = " + arrivedStationIndex);
|
||||
|
||||
BusServiceManager.arriveSiteStation(mContext,
|
||||
OrderServiceManager.arriveSiteStation(mContext,
|
||||
stationList.get(arrivedStationIndex).getSeq(),
|
||||
stationList.get(arrivedStationIndex).getSiteId(),
|
||||
currentTaskId,
|
||||
@@ -671,7 +674,8 @@ public class BusOrderModel {
|
||||
queryBusRoutes();
|
||||
isArrivedStation = true;
|
||||
isGoingToNextStation = false;
|
||||
arriveStationSuccess(arrivedStationIndex, departureStopName, arriveStation);
|
||||
arriveStationSuccess(arrivedStationIndex, departureStopName,
|
||||
arriveStation,arriveStationKr);
|
||||
}
|
||||
//5s轮询核销乘客
|
||||
// startOrStopQueryPassengerWriteOff(true);
|
||||
@@ -700,7 +704,8 @@ public class BusOrderModel {
|
||||
});
|
||||
}
|
||||
|
||||
private void arriveStationSuccess(int arrivedStationIndex, String departureStopName, String arriveStation) {
|
||||
private void arriveStationSuccess(int arrivedStationIndex, String departureStopName,
|
||||
String arriveStation, String arriveStationKr) {
|
||||
if (busRoutesResult != null) {
|
||||
boolean isLastStop = false;
|
||||
if (arrivedStationIndex == busRoutesResult.getSites().size() - 1) {
|
||||
@@ -713,10 +718,7 @@ public class BusOrderModel {
|
||||
, arriveStation
|
||||
, isLastStop);
|
||||
}
|
||||
|
||||
VoiceNotice.showNotice(String.format(mContext
|
||||
.getString(R.string.bus_arrived_station_tip),
|
||||
arriveStation));
|
||||
VoiceManager.INSTANCE.arrivedStationBus(arriveStation,arriveStationKr);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -725,12 +727,15 @@ public class BusOrderModel {
|
||||
public void leaveStation() {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "leaveStation-backgroundCurrentStationIndex = " + backgroundCurrentStationIndex);
|
||||
String nextStationName = "";
|
||||
String nextStationNameKr = "";
|
||||
if (backgroundCurrentStationIndex < stationList.size() - 1) {
|
||||
nextStationName = stationList.get(backgroundCurrentStationIndex + 1).getName();
|
||||
nextStationNameKr = stationList.get(backgroundCurrentStationIndex + 1).getNameKr();
|
||||
}
|
||||
final String currentStationName = stationList.get(backgroundCurrentStationIndex).getName();
|
||||
String finalNextStationName = nextStationName;
|
||||
BusServiceManager.leaveStation(mContext,
|
||||
String finalNextStationNameKr = nextStationNameKr;
|
||||
OrderServiceManager.leaveStation(mContext,
|
||||
stationList.get(backgroundCurrentStationIndex).getSeq(),
|
||||
stationList.get(backgroundCurrentStationIndex).getSiteId(),
|
||||
currentTaskId,
|
||||
@@ -742,7 +747,8 @@ public class BusOrderModel {
|
||||
//需要更改当前站和下一站的状态 然后渲染
|
||||
//startOrStopQueryPassengerWriteOff(false);
|
||||
queryBusRoutes();
|
||||
leaveStationSuccess(backgroundCurrentStationIndex, currentStationName, finalNextStationName);
|
||||
leaveStationSuccess(backgroundCurrentStationIndex, currentStationName,
|
||||
finalNextStationName,finalNextStationNameKr);
|
||||
}
|
||||
|
||||
|
||||
@@ -767,10 +773,14 @@ public class BusOrderModel {
|
||||
}
|
||||
|
||||
//车站10s后播报
|
||||
private void leaveTTSTips(String nextStation) {
|
||||
VoiceNotice.showNotice(String.format(mContext
|
||||
.getString(R.string.bus_leave_station_tip),
|
||||
nextStation), DELAY_10S);
|
||||
private void leaveTTSTips(String nextStation,String nextStationKr) {
|
||||
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
VoiceManager.INSTANCE.leaveStationBus(nextStation,nextStationKr);
|
||||
}
|
||||
},DELAY_10S);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -916,11 +926,11 @@ public class BusOrderModel {
|
||||
|
||||
private void tipStartTask(String s) {
|
||||
String tips = String.format(mContext
|
||||
.getString(R.string.bus_before_tips_s), s);
|
||||
.getString(R.string.bus_before_tips_s), s);
|
||||
//展示在运营消息
|
||||
OCHSocketMessageManager.INSTANCE.pushAppOperationalMsgBox(
|
||||
DateTimeUtil.getCurrentTimeStamp(),
|
||||
tips);
|
||||
tips,OCHSocketMessageManager.OPERATION_SYSTEM);
|
||||
//语音提示
|
||||
VoiceNotice.showNotice(tips);
|
||||
}
|
||||
@@ -931,7 +941,7 @@ public class BusOrderModel {
|
||||
if (backgroundCurrentStationIndex == 0 && stationList != null &&
|
||||
stationList.get(0).getDrivingStatus() == STATION_STATUS_STOPPED
|
||||
&& !stationList.get(0).isLeaving()){
|
||||
tipStartTask("1");
|
||||
tipStartTask("1");
|
||||
}else {
|
||||
removeTipRunnables();
|
||||
}
|
||||
@@ -1003,7 +1013,7 @@ public class BusOrderModel {
|
||||
*/
|
||||
private void endTask() {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "任务正常走完endTask()");
|
||||
BusServiceManager.endTask(mContext, currentTaskId
|
||||
OrderServiceManager.endTask(mContext, currentTaskId
|
||||
, new OchCommonServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
@@ -1014,7 +1024,7 @@ public class BusOrderModel {
|
||||
queryBusRoutes();// 重新获取任务
|
||||
removeTipRunnables();
|
||||
// startOrStopQueryPassengerWriteOff(false);
|
||||
VoiceNotice.showNotice(mContext.getString(R.string.bus_end_task_tip));
|
||||
ttsEndTask();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1038,6 +1048,10 @@ public class BusOrderModel {
|
||||
});
|
||||
}
|
||||
|
||||
private void ttsEndTask() {
|
||||
VoiceManager.INSTANCE.endOrderBus();
|
||||
}
|
||||
|
||||
/**
|
||||
* 到站
|
||||
*
|
||||
@@ -1079,9 +1093,12 @@ public class BusOrderModel {
|
||||
return isGoingToNextStation;
|
||||
}
|
||||
|
||||
public void sendWriteOffNumToClient(String msg){
|
||||
}
|
||||
|
||||
// 车机端上传心跳数据(只在出车状态时上传)
|
||||
public void runCarHeartbeat() {
|
||||
BusServiceManager.runCarHeartbeat(mContext, mLongitude, mLatitude,
|
||||
OrderServiceManager.runCarHeartbeat(mContext, mLongitude, mLatitude,
|
||||
new OchCommonServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData data) {
|
||||
@@ -30,7 +30,7 @@ import retrofit2.http.Query;
|
||||
* <p>
|
||||
* wiki: http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=48970072
|
||||
*/
|
||||
public interface IBusApiService {
|
||||
public interface IBascApiService {
|
||||
/**
|
||||
* 根据车机坐标获取所在区域全部站点信息
|
||||
*
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.mogo.och.bus.net
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.och.bus.constant.BusConst.Companion.getBaseUrl
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.och.bus.bean.*
|
||||
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.network.OchCommonSubscribeImpl
|
||||
import com.mogo.och.common.module.biz.network.interceptor.transformTry
|
||||
@@ -14,10 +14,10 @@ import com.mogo.och.common.module.biz.network.interceptor.transformTry
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/10/20
|
||||
*/
|
||||
object BusServiceManager {
|
||||
object OrderServiceManager {
|
||||
|
||||
private val mService: IBusApiService = MoGoRetrofitFactory.getInstance(getBaseUrl()).create(
|
||||
IBusApiService::class.java
|
||||
private val M_SERVICE: IBascApiService = MoGoRetrofitFactory.getInstance(OchCommonConst.getBaseUrl()).create(
|
||||
IBascApiService::class.java
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -28,7 +28,7 @@ object BusServiceManager {
|
||||
@JvmStatic
|
||||
fun queryBusRoutes(context: Context, callback: OchCommonServiceCallback<BusRoutesResponse>?) {
|
||||
//获取当前高德坐标
|
||||
mService.queryBusRoutes(
|
||||
M_SERVICE.queryBusRoutes(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
BusQueryLineStationsRequest()
|
||||
@@ -49,7 +49,7 @@ object BusServiceManager {
|
||||
taskId: Int,
|
||||
callback: OchCommonServiceCallback<BusRoutesResponse>?
|
||||
) {
|
||||
mService.switchLine(
|
||||
M_SERVICE.switchLine(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
BusResetDrivingLineRequest(taskId)
|
||||
@@ -66,7 +66,7 @@ object BusServiceManager {
|
||||
*/
|
||||
@JvmStatic
|
||||
fun abortTask(context: Context, taskId: Int, callback: OchCommonServiceCallback<BaseData>?) {
|
||||
mService.abortTask(
|
||||
M_SERVICE.abortTask(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
BusCloseTaskRequest(taskId)
|
||||
@@ -83,7 +83,7 @@ object BusServiceManager {
|
||||
*/
|
||||
@JvmStatic
|
||||
fun endTask(context: Context, taskId: Int, callback: OchCommonServiceCallback<BaseData>?) {
|
||||
mService.endTask(
|
||||
M_SERVICE.endTask(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
BusCloseTaskRequest(taskId)
|
||||
@@ -107,7 +107,7 @@ object BusServiceManager {
|
||||
taskId: Int,
|
||||
callback: OchCommonServiceCallback<BaseData>?
|
||||
) {
|
||||
mService.leaveStation(
|
||||
M_SERVICE.leaveStation(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
BusUpdateSiteStatusRequest(taskId, siteId, seq)
|
||||
@@ -128,7 +128,7 @@ object BusServiceManager {
|
||||
context: Context, seq: Int, siteId: Int, taskId: Int,
|
||||
callback: OchCommonServiceCallback<BaseData>?
|
||||
) {
|
||||
mService.arriveSiteStation(
|
||||
M_SERVICE.arriveSiteStation(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
BusUpdateSiteStatusRequest(taskId, siteId, seq)
|
||||
@@ -151,7 +151,7 @@ object BusServiceManager {
|
||||
siteId: Int,
|
||||
callback: OchCommonServiceCallback<QueryLeaveAwayPassengersResponse>?
|
||||
) {
|
||||
mService.queryStationLeaveAwayPassengers(
|
||||
M_SERVICE.queryStationLeaveAwayPassengers(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
QueryLeaveAwayPassengersRequest(seq, siteId)
|
||||
@@ -174,7 +174,7 @@ object BusServiceManager {
|
||||
prePassengerTime: Long,
|
||||
callback: OchCommonServiceCallback<BusQueryWriteOffPassengersResponse>?
|
||||
) {
|
||||
mService.queryWriteOffPassengers(
|
||||
M_SERVICE.queryWriteOffPassengers(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
BusWriteOffPassengersQueryRequest(taskId, siteId, prePassengerTime)
|
||||
@@ -190,7 +190,7 @@ object BusServiceManager {
|
||||
*/
|
||||
@JvmStatic
|
||||
fun queryBusOrders(context: Context, callback: OchCommonServiceCallback<BusOrdersResponse>?) {
|
||||
mService.queryBusOrders(
|
||||
M_SERVICE.queryBusOrders(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
MoGoAiCloudClientConfig.getInstance().sn
|
||||
@@ -200,7 +200,7 @@ object BusServiceManager {
|
||||
}
|
||||
@JvmStatic
|
||||
fun queryBusLines(context: Context, callback: OchCommonServiceCallback<BusQueryLinesResponse>?) {
|
||||
mService.queryBusLines(
|
||||
M_SERVICE.queryBusLines(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
MoGoAiCloudClientConfig.getInstance().sn
|
||||
@@ -214,7 +214,7 @@ object BusServiceManager {
|
||||
lineId: String?,
|
||||
callback: OchCommonServiceCallback<BusQueryLineTaskResponse>?
|
||||
) {
|
||||
mService.queryBusTaskByLineId(
|
||||
M_SERVICE.queryBusTaskByLineId(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
lineId
|
||||
@@ -231,7 +231,7 @@ object BusServiceManager {
|
||||
points: List<BusRoutePlanningUpdateReqBean.Result?>?,
|
||||
callback: OchCommonServiceCallback<BaseData>?
|
||||
) {
|
||||
mService.updateOrderRoute(
|
||||
M_SERVICE.updateOrderRoute(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
BusRoutePlanningUpdateReqBean(
|
||||
@@ -254,7 +254,7 @@ object BusServiceManager {
|
||||
context: Context, lon: Double, lat: Double,
|
||||
callback: OchCommonServiceCallback<BaseData>?
|
||||
) {
|
||||
mService.runCarHeartbeat(
|
||||
M_SERVICE.runCarHeartbeat(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
CarHeartbeatReqBean(
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.mogo.och.bus.net.login
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.och.common.module.biz.bean.TaxiLoginSmsReqBean
|
||||
import com.mogo.och.common.module.biz.bean.TaxiLoginReqBean
|
||||
import com.mogo.och.common.module.biz.bean.TaxiLoginRespBean
|
||||
import com.mogo.och.common.module.biz.bean.TaxiLogoutReqBean
|
||||
import com.mogo.och.common.module.biz.bean.DriverStatusQueryRespBean
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl
|
||||
import com.mogo.och.common.module.biz.network.interceptor.transformTry
|
||||
|
||||
/**
|
||||
* Created by pangfan on 2021/8/19
|
||||
*/
|
||||
object OchCommonServiceManager {
|
||||
|
||||
private const val TAG = "OchCommonServiceManager"
|
||||
|
||||
private val mLoginServiceApi: OchLoginServiceApi =
|
||||
MoGoRetrofitFactory.getInstance(OchCommonConst.getBaseUrl()).create(
|
||||
OchLoginServiceApi::class.java
|
||||
)
|
||||
|
||||
/**
|
||||
* 获取手机验证码
|
||||
* @param context
|
||||
* @param callback
|
||||
*/
|
||||
@JvmStatic
|
||||
fun getPhoneCode(
|
||||
context: Context, phone: String?,
|
||||
callback: OchCommonServiceCallback<BaseData>?
|
||||
) {
|
||||
mLoginServiceApi.getPhoneCode(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
TaxiLoginSmsReqBean(phone)
|
||||
).transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "getPhoneCode"))
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过验证码登录
|
||||
* @param context
|
||||
* @param callback
|
||||
*/
|
||||
@JvmStatic
|
||||
fun gotoLoginBycode(
|
||||
context: Context, phone: String?, code: String?,
|
||||
location4Login: TaxiLoginReqBean.Location4Login?,
|
||||
callback: OchCommonServiceCallback<TaxiLoginRespBean>?
|
||||
) {
|
||||
val sn = MoGoAiCloudClientConfig.getInstance().sn
|
||||
mLoginServiceApi.gotoLoginBycode4Bus(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
TaxiLoginReqBean(phone, code, sn, location4Login)
|
||||
).transformTry().subscribe(OchCommonSubscribeImpl(context, callback, "gotoLoginBycode"))
|
||||
}
|
||||
|
||||
/**
|
||||
* 登出
|
||||
*/
|
||||
@JvmStatic
|
||||
fun logout(
|
||||
context: Context,
|
||||
location4Login: TaxiLogoutReqBean.Location4Login?,
|
||||
callback: OchCommonServiceCallback<BaseData>?
|
||||
) {
|
||||
mLoginServiceApi.logout4Bus(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
TaxiLogoutReqBean(MoGoAiCloudClientConfig.getInstance().sn, location4Login)
|
||||
).transformTry().subscribe(OchCommonSubscribeImpl(context, callback, "logout"))
|
||||
}
|
||||
|
||||
/**
|
||||
* 接单状态和登录状态查询
|
||||
*
|
||||
* @param context
|
||||
* @param callback
|
||||
*/
|
||||
@JvmStatic
|
||||
fun queryDriverServiceStatus(
|
||||
context: Context,
|
||||
callback: OchCommonServiceCallback<DriverStatusQueryRespBean>?
|
||||
) {
|
||||
if (MoGoAiCloudClientConfig.getInstance().token.isEmpty()) {
|
||||
callback?.onFail(OchCommonConst.WAIT_TAKEN, "等待令牌中请稍等")
|
||||
MoGoAiCloudClient.getInstance().refreshToken()
|
||||
return
|
||||
}
|
||||
mLoginServiceApi.queryDriverServiceStatusAndLoginStatus(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
MoGoAiCloudClientConfig.getInstance().sn
|
||||
).transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryDriverServiceStatus"))
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.mogo.och.bus.net.login;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.och.common.module.biz.bean.DriverStatusQueryRespBean;
|
||||
import com.mogo.och.common.module.biz.bean.TaxiLoginReqBean;
|
||||
import com.mogo.och.common.module.biz.bean.TaxiLoginRespBean;
|
||||
import com.mogo.och.common.module.biz.bean.TaxiLoginSmsReqBean;
|
||||
import com.mogo.och.common.module.biz.bean.TaxiLogoutReqBean;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Header;
|
||||
import retrofit2.http.Headers;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Path;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
/**
|
||||
* Created by pangfan on 2021/8/19
|
||||
* <p>
|
||||
* 网约车-出租车接口定义
|
||||
*/
|
||||
interface OchLoginServiceApi {
|
||||
/**
|
||||
* 获取手机验证码
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
@POST("/autopilot-car-hailing/driver/v2/driver/taxi/sendSms")
|
||||
Observable<DriverStatusQueryRespBean> getPhoneCode(@Header("appId") String appId
|
||||
, @Header("ticket") String ticket, @Body TaxiLoginSmsReqBean data);
|
||||
|
||||
/**
|
||||
* 通过验证码登录
|
||||
*
|
||||
* @param appId
|
||||
* @param ticket
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
@POST("/autopilot-car-hailing/cab/flow/v1/bus/driver/bus/startOperation")
|
||||
Observable<TaxiLoginRespBean> gotoLoginBycode4Bus(@Header("appId") String appId
|
||||
, @Header("ticket") String ticket, @Body TaxiLoginReqBean data);
|
||||
|
||||
/**
|
||||
* 登出接口
|
||||
*/
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
@POST("/autopilot-car-hailing/cab/flow/v1/bus/driver/bus/endOperation")
|
||||
Observable<BaseData> logout4Bus(@Header("appId") String appId, @Header("ticket") String ticket,
|
||||
@Body TaxiLogoutReqBean data);
|
||||
|
||||
/**
|
||||
* 接单状态和登录状态查询 出租车司机端、小巴车司机端、小巴车乘客端
|
||||
*
|
||||
* @param sn
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
@GET("/autopilot-car-hailing/operation/v1/driver/bus/loginStatus")
|
||||
Observable<DriverStatusQueryRespBean> queryDriverServiceStatusAndLoginStatus(@Header("appId") String appId
|
||||
, @Header("ticket") String ticket, @Query("sn") String sn);
|
||||
|
||||
}
|
||||
@@ -11,55 +11,7 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
public class BusQueryLineStationsRequest {
|
||||
|
||||
private String sn;
|
||||
// private double lat;
|
||||
// private double lon;
|
||||
// private boolean markDrivingStatus; // 默认false;true:是否需要返回站点的行驶状态,对应返回的drivingStatus
|
||||
// 0 - 关闭、1 - 启动
|
||||
// public String status;
|
||||
// public BusQueryLineStationsRequest(double lon, double lat, boolean markDrivingStatus) {
|
||||
// this.sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
// this.lat = lat;
|
||||
// this.lon = lon;
|
||||
// this.markDrivingStatus = markDrivingStatus;
|
||||
// }
|
||||
public BusQueryLineStationsRequest() {
|
||||
this.sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
}
|
||||
|
||||
// public boolean isMarkDrivingStatus() {
|
||||
// return markDrivingStatus;
|
||||
// }
|
||||
//
|
||||
// public void setMarkDrivingStatus(boolean markDrivingStatus) {
|
||||
// this.markDrivingStatus = markDrivingStatus;
|
||||
// }
|
||||
//
|
||||
// public void setLat(double lat) {
|
||||
// this.lat = lat;
|
||||
// }
|
||||
//
|
||||
// public void setLon(double lon) {
|
||||
// this.lon = lon;
|
||||
// }
|
||||
//
|
||||
// public String getSn() {
|
||||
// return sn;
|
||||
// }
|
||||
//
|
||||
// public double getLat() {
|
||||
// return lat;
|
||||
// }
|
||||
//
|
||||
// public double getLon() {
|
||||
// return lon;
|
||||
// }
|
||||
// public BusOperationStatusRequest shutdown() {
|
||||
// status = "0";
|
||||
// return this;
|
||||
// }
|
||||
//
|
||||
// public BusOperationStatusRequest launch() {
|
||||
// status = "1";
|
||||
// return this;
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.mogo.och.bus.bean;
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 查询核销乘客
|
||||
@@ -21,4 +24,150 @@ public class BusWriteOffPassengersQueryRequest {
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/10/19
|
||||
*/
|
||||
public static class BusOrdersResponse extends BaseData {
|
||||
public com.mogo.och.bus.bean.BusOrdersResponse.Result data;
|
||||
public static class Result{
|
||||
public List<BusOrderBean> orders;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BusOrdersResponse{" +
|
||||
"data=" + data +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 网约车小巴路线接口请求响应结果
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public static class BusRoutesResponse extends BaseData {
|
||||
private BusRoutesResult data;
|
||||
|
||||
public BusRoutesResult getResult() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setResult(BusRoutesResult data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BusRoutesResponse{" +
|
||||
"data=" + data +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 单个网约车小巴车站信息
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public static class BusStationBean {
|
||||
private int siteId;
|
||||
private String name;
|
||||
private int seq;
|
||||
private double gcjLon; //高德
|
||||
private double gcjLat; //高德
|
||||
private double lon; //高精坐标
|
||||
private double lat; //高精坐标
|
||||
private int drivingStatus;//行驶信息,0初始值;1已经过;2当前站;3未到站
|
||||
private boolean leaving;
|
||||
|
||||
public int getSiteId() {
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public int getSeq() {
|
||||
return seq;
|
||||
}
|
||||
|
||||
public double getGcjLon() {
|
||||
return gcjLon;
|
||||
}
|
||||
|
||||
public double getGcjLat() {
|
||||
return gcjLat;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public int getDrivingStatus() {
|
||||
return drivingStatus;
|
||||
}
|
||||
|
||||
public boolean isLeaving() {
|
||||
return leaving;
|
||||
}
|
||||
|
||||
public void setSiteId(int siteId) {
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setSeq(int seq) {
|
||||
this.seq = seq;
|
||||
}
|
||||
|
||||
public void setGcjLon(double gcjLon) {
|
||||
this.gcjLon = gcjLon;
|
||||
}
|
||||
|
||||
public void setGcjLat(double gcjLat) {
|
||||
this.gcjLat = gcjLat;
|
||||
}
|
||||
|
||||
public void setLon(double lon) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
public void setLat(double lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public void setDrivingStatus(int drivingStatus) {
|
||||
this.drivingStatus = drivingStatus;
|
||||
}
|
||||
|
||||
public void setLeaving(boolean leaving) {
|
||||
this.leaving = leaving;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BusStationBean{" +
|
||||
"siteId=" + siteId +
|
||||
", name='" + name + '\'' +
|
||||
", seq=" + seq +
|
||||
", gcjLon=" + gcjLon +
|
||||
", gcjLat=" + gcjLat +
|
||||
", lon=" + lon +
|
||||
", lat=" + lat +
|
||||
", drivingStatus=" + drivingStatus +
|
||||
", leaving=" + leaving +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,21 +7,6 @@ import com.mogo.commons.debug.DebugConfig
|
||||
*/
|
||||
class BusConst {
|
||||
companion object {
|
||||
|
||||
private const val BASE_URL_OCH_DEV = "http://tech-dev.zhidaohulian.com"
|
||||
private const val BASE_URL_OCH_QA = "https://tech-qa.zhidaohulian.com"
|
||||
private const val BASE_URL_OCH_RELEASE = "https://tech.zhidaohulian.com"
|
||||
|
||||
@JvmStatic
|
||||
fun getBaseUrl(): String {
|
||||
return when (DebugConfig.getNetMode()) {
|
||||
DebugConfig.NET_MODE_DEV, DebugConfig.NET_MODE_DEMO -> BASE_URL_OCH_DEV
|
||||
DebugConfig.NET_MODE_QA -> BASE_URL_OCH_QA
|
||||
DebugConfig.NET_MODE_RELEASE -> BASE_URL_OCH_RELEASE
|
||||
else -> BASE_URL_OCH_RELEASE
|
||||
}
|
||||
}
|
||||
|
||||
// OCH arouter 路由path
|
||||
const val PATH = "/driver/api"
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.och.bus.R;
|
||||
import com.mogo.och.bus.bean.BusRoutesResult;
|
||||
import com.mogo.och.bus.model.BusOrderModel;
|
||||
import com.mogo.och.bus.model.OrderModel;
|
||||
import com.mogo.och.bus.util.BDRouteDataTestUtils;
|
||||
import com.mogo.och.bus.view.SlidePanelView;
|
||||
import com.mogo.och.common.module.utils.SoundPoolHelper;
|
||||
@@ -137,6 +137,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
mSwitchMapModeLayout.setOnClickListener(new OnPreventFastClickListener() {
|
||||
@Override
|
||||
public void onClickImpl(View v) {
|
||||
|
||||
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
|
||||
if (controller != null) {
|
||||
//切换地图的远近视图
|
||||
@@ -181,6 +182,10 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
debugAutoPilotStatus(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING)
|
||||
);
|
||||
|
||||
findViewById(R.id.btnAutopilotPingxing).setOnClickListener(view ->
|
||||
debugAutoPilotStatus(IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING)
|
||||
);
|
||||
|
||||
// 模拟 自动驾驶网约车回调数据
|
||||
findViewById(R.id.btnAutopilotArrive).setOnClickListener(view ->
|
||||
debugArrivedStation()
|
||||
@@ -377,19 +382,30 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_disable));
|
||||
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_runnig_tv));
|
||||
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_disable_autopilot_icon);
|
||||
ctvAutopilotStatus.setSelected(false);
|
||||
// ctvAutopilotStatus.setSelected(false);
|
||||
ctvAutopilotStatus.setClickable(true);
|
||||
ctvAutopilotStatus.setBackground(getContext().getDrawable(R.drawable.bus_autopilot_0_1_status_bg));
|
||||
|
||||
} else {
|
||||
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal));
|
||||
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_runnig_tv));
|
||||
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_ic_autopilot);
|
||||
ctvAutopilotStatus.setClickable(true);
|
||||
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == autopilotStatus) {//1可用
|
||||
ctvAutopilotStatus.setSelected(false);
|
||||
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == autopilotStatus) { //1可用
|
||||
// ctvAutopilotStatus.setSelected(false);
|
||||
ctvAutopilotStatus.setClickable(true);
|
||||
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_runnig_tv));
|
||||
ctvAutopilotStatus.setBackground(getContext().getDrawable(R.drawable.bus_autopilot_0_1_status_bg));
|
||||
} else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == autopilotStatus) {
|
||||
ctvAutopilotStatus.setSelected(true);
|
||||
ctvAutopilotStatusTv.setText(R.string.bus_loading_autopilot_runnig_tv);
|
||||
ctvAutopilotStatus.setClickable(true);
|
||||
ctvAutopilotStatus.setBackground(getContext().getDrawable(R.drawable.bus_autopilot_2_status_bg));
|
||||
// ctvAutopilotStatus.setSelected(true);
|
||||
} else if (IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING
|
||||
== autopilotStatus){
|
||||
ctvAutopilotStatusTv.setText(R.string.bus_pingxing_driver);
|
||||
ctvAutopilotStatus.setClickable(false);
|
||||
ctvAutopilotStatus.setBackground(getContext().getDrawable(R.drawable.pingxingjiashi));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -399,14 +415,14 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_right_autopilot_icon);
|
||||
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal));
|
||||
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_success_tv));
|
||||
ctvAutopilotStatus.setSelected(false);
|
||||
// ctvAutopilotStatus.setSelected(false);
|
||||
ctvAutopilotStatus.setClickable(false);
|
||||
} else {
|
||||
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_wrong_autopilot_icon);
|
||||
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal));
|
||||
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_failure_tv));
|
||||
ctvAutopilotStatus.setClickable(false);
|
||||
ctvAutopilotStatus.setSelected(false);
|
||||
// ctvAutopilotStatus.setSelected(false);
|
||||
}
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
@@ -484,7 +500,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
isAnimateRunning = true;
|
||||
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_tv));
|
||||
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal));
|
||||
ctvAutopilotStatus.setSelected(false);
|
||||
// ctvAutopilotStatus.setSelected(false);
|
||||
ctvAutopilotStatus.setClickable(true);
|
||||
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_loading_autopilot_icon);
|
||||
if (autopilotLoadingAnimator == null) {
|
||||
@@ -591,7 +607,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
if (busTestBar.getVisibility() == View.VISIBLE) {
|
||||
busTestBar.setVisibility(View.GONE);
|
||||
} else {
|
||||
BusRoutesResult routesResult = BusOrderModel.getInstance().getBusRoutesResult();
|
||||
BusRoutesResult routesResult = OrderModel.getInstance().getBusRoutesResult();
|
||||
lineIdTV.setText("lineId:" + (routesResult == null ? "" : String.valueOf(routesResult.getLineId())));
|
||||
trajMd5TV.setText("TMd5:" + (routesResult == null ? "" : routesResult.csvFileMd5));
|
||||
stopMd5TV.setText("SMd5:" + (routesResult == null ? "" : routesResult.txtFileMd5));
|
||||
@@ -603,7 +619,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
|
||||
public void updateBusTestBarInfo() {
|
||||
if (busTestBar != null && busTestBar.getVisibility() == View.VISIBLE) {
|
||||
BusRoutesResult routesResult = BusOrderModel.getInstance().getBusRoutesResult();
|
||||
BusRoutesResult routesResult = OrderModel.getInstance().getBusRoutesResult();
|
||||
lineIdTV.setText("lineId:" + (routesResult == null ? "" : String.valueOf(routesResult.getLineId())));
|
||||
trajMd5TV.setText("TMd5:" + (routesResult == null ? "" : routesResult.csvFileMd5));
|
||||
stopMd5TV.setText("SMd5:" + (routesResult == null ? "" : routesResult.txtFileMd5));
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.mogo.och.bus.fragment;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -14,7 +14,9 @@ import androidx.constraintlayout.widget.Group;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
import com.mogo.eagle.core.data.temp.EventLogout;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
@@ -28,6 +30,7 @@ import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.och.bus.R;
|
||||
import com.mogo.och.bus.bean.BusStationBean;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
import com.mogo.och.bus.net.login.LoginBusImpl;
|
||||
import com.mogo.och.bus.presenter.BusPresenter;
|
||||
import com.mogo.och.bus.ui.BusStationCommonItem;
|
||||
import com.mogo.och.bus.ui.BusSwitchLineActivity;
|
||||
@@ -36,6 +39,8 @@ import com.mogo.och.common.module.biz.constant.OchCommonConst;
|
||||
import com.mogo.och.common.module.biz.provider.LoginService;
|
||||
import com.mogo.och.common.module.utils.BlinkAnimationUtil;
|
||||
import com.mogo.och.common.module.utils.OCHThreadPoolManager;
|
||||
import com.mogo.och.common.module.utils.QRUtilsKt;
|
||||
import com.mogo.och.common.module.wigets.BindQRCodeDialog;
|
||||
import com.mogo.och.common.module.wigets.MarqueeTextView;
|
||||
import com.mogo.och.common.module.wigets.OCHCommitDialog;
|
||||
|
||||
@@ -45,6 +50,8 @@ import org.greenrobot.eventbus.ThreadMode;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils;
|
||||
|
||||
|
||||
/**
|
||||
* 网约车小巴界面
|
||||
@@ -79,7 +86,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
loginService = (LoginService) ARouter.getInstance().build(OchCommonConst.LOGINSERVICE).navigation();
|
||||
if(loginService!=null){
|
||||
loginService.registerFragment(this, getPresenter());
|
||||
loginService.registerFragment(this, getPresenter(),new LoginBusImpl());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
@@ -124,6 +131,22 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
if (eventLogout.getMessgae() == EventLogout.LOGOUT_TYPE){
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"changeOverview Event消息去登出");
|
||||
mPresenter.logout();
|
||||
}else if (eventLogout.getMessgae() == EventLogout.SHOW_QR_TYPE){ //显示二维码
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"changeOverview Event qrcode");
|
||||
String qrUrl = String.format(FunctionBuildConfig.urlJson.getBindDriverQRUrl(),
|
||||
MoGoAiCloudClientConfig.getInstance().getSn());
|
||||
Bitmap bmQr = QRUtilsKt.createQRCodeWithPicture(
|
||||
BitmapFactory.decodeResource(getResources(), R.drawable.icon_qr_center_logo)
|
||||
,qrUrl, AutoSizeUtils.dp2px(getContext(),340f),
|
||||
AutoSizeUtils.dp2px(getContext(),340f),true);
|
||||
if (bmQr != null){
|
||||
BindQRCodeDialog.Builder builder = new BindQRCodeDialog.Builder();
|
||||
builder.title(getString(R.string.bind_driver_qr_title))
|
||||
.cancelStr(getString(R.string.qr_cancel))
|
||||
.qrBm(bmQr).build(getContext()).show();
|
||||
}else {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"bmQr = null ");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -359,16 +382,16 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
}else {
|
||||
firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color));
|
||||
thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected));
|
||||
if (isArrived){ //到终点
|
||||
firstStationItem.setStationPointBg(0);
|
||||
firstStationItem.setStationArrowBg(0);
|
||||
thirdStationItem.setStationPointBg(1);
|
||||
if (isArrived){ //到终点
|
||||
firstStationItem.setStationPointBg(0);
|
||||
firstStationItem.setStationArrowBg(0);
|
||||
thirdStationItem.setStationPointBg(1);
|
||||
|
||||
}else { //到终点途中
|
||||
firstStationItem.setStationPointBg(0);
|
||||
firstStationItem.setStationArrowBg(1);
|
||||
thirdStationItem.setStationPointBg(1);
|
||||
}
|
||||
}else { //到终点途中
|
||||
firstStationItem.setStationPointBg(0);
|
||||
firstStationItem.setStationArrowBg(1);
|
||||
thirdStationItem.setStationPointBg(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,9 +12,8 @@ import com.mogo.och.bus.bean.BusQueryLineTaskResponse;
|
||||
import com.mogo.och.bus.bean.BusQueryLinesResponse;
|
||||
import com.mogo.och.bus.bean.BusRoutesResponse;
|
||||
import com.mogo.och.bus.callback.IBusLinesCallback;
|
||||
import com.mogo.och.bus.net.BusServiceManager;
|
||||
import com.mogo.och.bus.net.OrderServiceManager;
|
||||
import com.mogo.och.bus.ui.BusSwitchLineActivity;
|
||||
import com.mogo.och.bus.util.BusSendTripInfoManager;
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback;
|
||||
|
||||
/**
|
||||
@@ -45,7 +44,7 @@ public class BusLineModel {
|
||||
mBusLinesCallback = callback;
|
||||
}
|
||||
public void queryBusLines(){
|
||||
BusServiceManager.queryBusLines(mContext, new OchCommonServiceCallback<BusQueryLinesResponse>() {
|
||||
OrderServiceManager.queryBusLines(mContext, new OchCommonServiceCallback<BusQueryLinesResponse>() {
|
||||
@Override
|
||||
public void onSuccess(BusQueryLinesResponse data) {
|
||||
if (null == data && mBusLinesCallback != null) {
|
||||
@@ -84,7 +83,7 @@ public class BusLineModel {
|
||||
* @param position 位置
|
||||
*/
|
||||
public void queryBusLineTasksById(int lineId, int position,boolean autoRefresh){
|
||||
BusServiceManager.queryBusTaskByLineId(mContext, String.valueOf(lineId),new OchCommonServiceCallback<BusQueryLineTaskResponse>() {
|
||||
OrderServiceManager.queryBusTaskByLineId(mContext, String.valueOf(lineId),new OchCommonServiceCallback<BusQueryLineTaskResponse>() {
|
||||
@Override
|
||||
public void onSuccess(BusQueryLineTaskResponse data) {
|
||||
if (null == data && mBusLinesCallback != null) {
|
||||
@@ -118,7 +117,7 @@ public class BusLineModel {
|
||||
}
|
||||
|
||||
public void commitSwitchLineId(int taskId,int lineId){
|
||||
BusServiceManager.switchLine(mContext,taskId, new OchCommonServiceCallback<BusRoutesResponse>() {
|
||||
OrderServiceManager.switchLine(mContext,taskId, new OchCommonServiceCallback<BusRoutesResponse>() {
|
||||
@Override
|
||||
public void onSuccess(BusRoutesResponse o) {
|
||||
SharedPrefs.getInstance(mContext).putInt(BusSwitchLineActivity.LASTCOMMITLINEID,lineId);
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.mogo.och.bus.net.login
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.och.common.module.biz.bean.DriverStatusQueryRespBean
|
||||
import com.mogo.och.common.module.biz.bean.TaxiLoginReqBean
|
||||
import com.mogo.och.common.module.biz.bean.TaxiLoginRespBean
|
||||
import com.mogo.och.common.module.biz.bean.TaxiLogoutReqBean
|
||||
import com.mogo.och.common.module.biz.network.LoginDefaultManage
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
|
||||
|
||||
class LoginBusImpl: LoginDefaultManage {
|
||||
|
||||
override fun getPhoneCode(
|
||||
context: Context, phone: String?,
|
||||
callback: OchCommonServiceCallback<BaseData>?
|
||||
) {
|
||||
OchCommonServiceManager.getPhoneCode(context,phone,callback)
|
||||
}
|
||||
|
||||
override fun gotoLoginBycode(
|
||||
context: Context,
|
||||
phone: String?,
|
||||
code: String?,
|
||||
location4Login: TaxiLoginReqBean.Location4Login?,
|
||||
callback: OchCommonServiceCallback<TaxiLoginRespBean>?
|
||||
) {
|
||||
OchCommonServiceManager.gotoLoginBycode(context,phone,code,location4Login,callback)
|
||||
}
|
||||
|
||||
override fun logout(
|
||||
context: Context,
|
||||
location4Login: TaxiLogoutReqBean.Location4Login?,
|
||||
callback: OchCommonServiceCallback<BaseData>?
|
||||
) {
|
||||
OchCommonServiceManager.logout(context,location4Login,callback)
|
||||
}
|
||||
|
||||
override fun queryDriverServiceStatus(
|
||||
context: Context,
|
||||
callback: OchCommonServiceCallback<DriverStatusQueryRespBean>?
|
||||
) {
|
||||
OchCommonServiceManager.queryDriverServiceStatus(context,callback)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -11,7 +11,7 @@ import com.mogo.och.bus.bean.BusQueryLineTaskResponse;
|
||||
import com.mogo.och.bus.bean.BusQueryLinesResponse;
|
||||
import com.mogo.och.bus.callback.IBusLinesCallback;
|
||||
import com.mogo.och.bus.model.BusLineModel;
|
||||
import com.mogo.och.bus.model.BusOrderModel;
|
||||
import com.mogo.och.bus.model.OrderModel;
|
||||
import com.mogo.och.bus.ui.BusSwitchLineView;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -30,7 +30,7 @@ public class BusLinePresenter extends Presenter<BusSwitchLineView> implements IB
|
||||
public BusLinePresenter(BusSwitchLineView view) {
|
||||
super(view);
|
||||
BusLineModel.getInstance().init();
|
||||
BusOrderModel.getInstance().init();
|
||||
OrderModel.getInstance().init();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -61,7 +61,7 @@ public class BusLinePresenter extends Presenter<BusSwitchLineView> implements IB
|
||||
|
||||
@Override
|
||||
public void onChangeLineIdSuccess() {
|
||||
BusOrderModel.getInstance().clearBusStationDatas();
|
||||
OrderModel.getInstance().clearBusStationDatas();
|
||||
runOnUIThread(() -> mView.onChangeLineIdSuccess());
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ public class BusLinePresenter extends Presenter<BusSwitchLineView> implements IB
|
||||
}
|
||||
|
||||
public void queryBusRoutes(){
|
||||
BusOrderModel.getInstance().queryBusRoutes();
|
||||
OrderModel.getInstance().queryBusRoutes();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
package com.mogo.och.bus.presenter;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS;
|
||||
import static com.mogo.och.bus.constant.BusConst.LOOP_DELAY_500;
|
||||
import static com.mogo.och.bus.constant.BusConst.LOOP_PASSENGER_5S;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
import com.mogo.och.bus.model.BusOrderModel;
|
||||
import com.mogo.och.bus.model.OrderModel;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@@ -66,7 +64,7 @@ public class BusModelLoopManager {
|
||||
.map((aLong -> aLong + 1))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(aLong -> BusOrderModel.getInstance().runCarHeartbeat());
|
||||
.subscribe(aLong -> OrderModel.getInstance().runCarHeartbeat());
|
||||
}
|
||||
|
||||
public void stopHeartbeatLoop() {
|
||||
|
||||
@@ -26,7 +26,7 @@ import com.mogo.och.bus.callback.IPassengerCallback;
|
||||
import com.mogo.och.bus.callback.IRefreshBusStationsCallback;
|
||||
import com.mogo.och.bus.callback.ISlidePannelHideCallback;
|
||||
import com.mogo.och.bus.fragment.BusFragment;
|
||||
import com.mogo.och.bus.model.BusOrderModel;
|
||||
import com.mogo.och.bus.model.OrderModel;
|
||||
import com.mogo.och.bus.util.BusTrajectoryManager;
|
||||
import com.mogo.och.common.module.biz.bean.DriverStatusQueryRespBean;
|
||||
import com.mogo.och.common.module.biz.callback.ILoginCallback;
|
||||
@@ -62,7 +62,7 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
super(view);
|
||||
//2021.11.1 鹰眼架构整合,由IMoGoAutopilotStatusListener逐步替代IMogoAdasOCHCallback接口
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, this);
|
||||
BusOrderModel.getInstance().init();
|
||||
OrderModel.getInstance().init();
|
||||
OCHAdasAbilityManager.getInstance().init(AbsMogoApplication.getApp());
|
||||
}
|
||||
|
||||
@@ -75,48 +75,48 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
@Override
|
||||
public void onDestroy(@NonNull LifecycleOwner owner) {
|
||||
super.onDestroy(owner);
|
||||
BusOrderModel.getInstance().release();
|
||||
OrderModel.getInstance().release();
|
||||
releaseListener();
|
||||
}
|
||||
|
||||
public void initModelListener() {
|
||||
BusOrderModel.getInstance().setRefreshBusStationsCallback(this);
|
||||
BusOrderModel.getInstance().setSlidePanelHideCallback(this);
|
||||
BusOrderModel.getInstance().setControllerStatusCallback(this);
|
||||
BusOrderModel.getInstance().setPassengerCallback(this);
|
||||
BusOrderModel.getInstance().setAdasStatusCallback(this);
|
||||
OrderModel.getInstance().setRefreshBusStationsCallback(this);
|
||||
OrderModel.getInstance().setSlidePanelHideCallback(this);
|
||||
OrderModel.getInstance().setControllerStatusCallback(this);
|
||||
OrderModel.getInstance().setPassengerCallback(this);
|
||||
OrderModel.getInstance().setAdasStatusCallback(this);
|
||||
}
|
||||
|
||||
public void releaseListener() {
|
||||
BusOrderModel.getInstance().setRefreshBusStationsCallback(null);
|
||||
BusOrderModel.getInstance().setSlidePanelHideCallback(null);
|
||||
BusOrderModel.getInstance().setControllerStatusCallback(null);
|
||||
BusOrderModel.getInstance().setPassengerCallback(null);
|
||||
BusOrderModel.getInstance().setAdasStatusCallback(null);
|
||||
OrderModel.getInstance().setRefreshBusStationsCallback(null);
|
||||
OrderModel.getInstance().setSlidePanelHideCallback(null);
|
||||
OrderModel.getInstance().setControllerStatusCallback(null);
|
||||
OrderModel.getInstance().setPassengerCallback(null);
|
||||
OrderModel.getInstance().setAdasStatusCallback(null);
|
||||
OCHAdasAbilityManager.getInstance().release();
|
||||
}
|
||||
|
||||
public void abortTask() {
|
||||
BusOrderModel.getInstance().abortTask();
|
||||
OrderModel.getInstance().abortTask();
|
||||
}
|
||||
|
||||
public void autoDriveToNextStation() {
|
||||
currentAutopilotStatus = -1;
|
||||
BusOrderModel.getInstance().autoDriveToNextStation();
|
||||
OrderModel.getInstance().autoDriveToNextStation();
|
||||
// isRestartAutopilot = false;
|
||||
}
|
||||
|
||||
public void restartAutopilot() {
|
||||
if (BusOrderModel.getInstance().isGoingToNextStation()){
|
||||
if (OrderModel.getInstance().isGoingToNextStation()){
|
||||
currentAutopilotStatus = -1;
|
||||
BusOrderModel.getInstance().restartAutopilot();
|
||||
OrderModel.getInstance().restartAutopilot();
|
||||
// isRestartAutopilot = true;
|
||||
}
|
||||
}
|
||||
|
||||
// 登出
|
||||
public void logout() {
|
||||
BusOrderModel.getInstance().logout();
|
||||
OrderModel.getInstance().logout();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -151,15 +151,15 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
@Override
|
||||
public void hideSlidePanel() {
|
||||
if (mView != null) {
|
||||
runOnUIThread(() -> mView.hideSlidePanel());
|
||||
runOnUIThread(()-> mView.setArrivedClikable(true));
|
||||
mView.hideSlidePanel();
|
||||
mView.setArrivedClikable(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotArriveAtStation(MessagePad.ArrivalNotification arrivalNotification) {
|
||||
CallerLogger.INSTANCE.e( M_BUS + TAG, "行程日志-onAutopilotArriveAtStation arrive");
|
||||
BusOrderModel.getInstance().onArriveAt(arrivalNotification);
|
||||
OrderModel.getInstance().onArriveAt(arrivalNotification);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -180,7 +180,7 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
if (FunctionBuildConfig.isDemoMode
|
||||
&& (
|
||||
(mCurrentStation >= 0 && mCurrentStation <= mStationList.size() - 1)
|
||||
&& BusOrderModel.getInstance().isGoingToNextStation()
|
||||
&& OrderModel.getInstance().isGoingToNextStation()
|
||||
)
|
||||
) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + "BusOrderModel=", "有美化功能");
|
||||
@@ -195,8 +195,8 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING:
|
||||
if (currentAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
currentAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING;
|
||||
BusOrderModel.getInstance().triggerStartServiceEvent(
|
||||
BusOrderModel.getInstance().isRestartAutopilot(), true);
|
||||
OrderModel.getInstance().triggerStartServiceEvent(
|
||||
OrderModel.getInstance().isRestartAutopilot(), true);
|
||||
}
|
||||
// 改变UI自动驾驶状态
|
||||
runOnUIThread(() -> mView.onAutopilotStatusChanged(currentAutopilotStatus));
|
||||
@@ -205,7 +205,7 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
if (FunctionBuildConfig.isDemoMode
|
||||
&& (
|
||||
(mCurrentStation >= 0 && mCurrentStation <= mStationList.size() - 1)
|
||||
&& BusOrderModel.getInstance().isGoingToNextStation()
|
||||
&& OrderModel.getInstance().isGoingToNextStation()
|
||||
|
||||
)
|
||||
) {
|
||||
@@ -220,6 +220,24 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
mView.onAutopilotStatusChanged(currentAutopilotStatus);
|
||||
});
|
||||
break;
|
||||
case IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING:
|
||||
if (FunctionBuildConfig.isDemoMode
|
||||
&& (
|
||||
(mCurrentStation >= 0 && mCurrentStation <= mStationList.size() - 1)
|
||||
&& OrderModel.getInstance().isGoingToNextStation()
|
||||
|
||||
)
|
||||
) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + "BusOrderModel=", "有美化功能");
|
||||
return;
|
||||
}
|
||||
if (currentAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING) {
|
||||
currentAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING;
|
||||
}
|
||||
runOnUIThread(() -> {
|
||||
mView.onAutopilotStatusChanged(currentAutopilotStatus);
|
||||
});
|
||||
break;
|
||||
default:
|
||||
runOnUIThread(() -> mView.onAutopilotEnableChange(false));
|
||||
break;
|
||||
@@ -288,15 +306,15 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
public void loginSuccess(DriverStatusQueryRespBean data) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, " loginStatus =" + LoginStatusManager.isLogin());
|
||||
if(LoginStatusManager.isLogin()){
|
||||
BusOrderModel.getInstance().startOrStopOrderLoop(true);
|
||||
BusOrderModel.getInstance().queryBusRoutes();
|
||||
OrderModel.getInstance().startOrStopOrderLoop(true);
|
||||
OrderModel.getInstance().queryBusRoutes();
|
||||
}else {
|
||||
BusTrajectoryManager.getInstance().stopTrajReqLoop();
|
||||
BusOrderModel.getInstance().startOrStopOrderLoop(false);
|
||||
OrderModel.getInstance().startOrStopOrderLoop(false);
|
||||
BusTrajectoryManager.getInstance().stopTrajReqLoop();
|
||||
clearBusStationsMarkers();
|
||||
mView.hideSlidePanel();
|
||||
BusOrderModel.getInstance().closeBeautificationMode();
|
||||
OrderModel.getInstance().closeBeautificationMode();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -310,9 +328,11 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
int passengerNum = passenger.passengerSize;
|
||||
if (passengerNum > 1){ //多人播报 "x人" ---》x人核验通过
|
||||
VoiceNotice.showNotice(passengerNum+"人核验通过", AIAssist.LEVEL3);
|
||||
OrderModel.getInstance().sendWriteOffNumToClient(passengerNum+"人核验通过");
|
||||
}else { //是 1 播放 "滴" 2022.11.09 改为: "核验通过"
|
||||
// mView.playDI();
|
||||
VoiceNotice.showNotice("核验通过", AIAssist.LEVEL3);
|
||||
OrderModel.getInstance().sendWriteOffNumToClient("核验通过");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,14 +64,15 @@ class SwitchLineAdapter(
|
||||
object : SwitchLineTaskAdapter.TaskItemClickListener {
|
||||
override fun onItemClick(position: Int,isCheck:Boolean) {
|
||||
try {
|
||||
if(isCheck) {
|
||||
if (isCheck) {
|
||||
checkLineId = line.lineId
|
||||
checkTaskId = line.taskList[position].id
|
||||
}else{
|
||||
checkLineId=-1
|
||||
checkTaskId=-1
|
||||
} else {
|
||||
checkLineId = -1
|
||||
checkTaskId = -1
|
||||
}
|
||||
}catch (e: Exception){
|
||||
}catch (e:Exception){
|
||||
e.printStackTrace()
|
||||
checkLineId=-1
|
||||
checkTaskId=-1
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.och.bus.util;
|
||||
|
||||
import com.mogo.och.bus.model.BusOrderModel;
|
||||
import com.mogo.och.bus.model.OrderModel;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
@@ -37,7 +37,7 @@ public class BDRouteDataTestUtils {
|
||||
builder.setLongitude(s.getDouble("lon"));
|
||||
list.add(builder.build());
|
||||
}
|
||||
BusOrderModel.getInstance().debugUpdateOrderRoute(list);
|
||||
OrderModel.getInstance().debugUpdateOrderRoute(list);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -8,7 +8,8 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils;
|
||||
import com.mogo.och.bus.bean.BusRoutesResult;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
import com.mogo.och.bus.model.BusOrderModel;
|
||||
import com.mogo.och.bus.model.OrderModel;
|
||||
import com.mogo.och.common.module.biz.constant.LoginStatusManager;
|
||||
import com.zhidao.socket.utils.LoginStatusUtil;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -49,10 +50,10 @@ public class BusTrajectoryManager {
|
||||
* 同步Bus路线信息
|
||||
*/
|
||||
public void syncTrajectoryInfo() {
|
||||
BusRoutesResult routesResult = BusOrderModel.getInstance().getBusRoutesResult();
|
||||
if (LoginStatusUtil.isLogin() && routesResult != null
|
||||
&& BusOrderModel.getInstance().getCurrentStationIndex() == 0
|
||||
&& !BusOrderModel.getInstance().isGoingToNextStation()) {
|
||||
BusRoutesResult routesResult = OrderModel.getInstance().getBusRoutesResult();
|
||||
if (LoginStatusManager.isLogin() && routesResult != null
|
||||
&& OrderModel.getInstance().getCurrentStationIndex() == 0
|
||||
&& !OrderModel.getInstance().isGoingToNextStation()) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "syncTrajectoryInfo() start.");
|
||||
startTrajReqLoop();
|
||||
} else {
|
||||
@@ -96,7 +97,7 @@ public class BusTrajectoryManager {
|
||||
}
|
||||
|
||||
private void setupAutoPilotLine() {
|
||||
BusRoutesResult routesResult = BusOrderModel.getInstance().getBusRoutesResult();
|
||||
BusRoutesResult routesResult = OrderModel.getInstance().getBusRoutesResult();
|
||||
if (routesResult == null) {
|
||||
CallerLogger.INSTANCE.e(M_BUS + TAG,
|
||||
"setupAutoPilotLine(): routesResult is null.");
|
||||
|
||||
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 34 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi/icon_ai_collect.png
Executable file
|
After Width: | Height: | Size: 7.4 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi/icon_bad_case.png
Executable file
|
After Width: | Height: | Size: 6.9 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi/pingxingjiashi.png
Normal file
|
After Width: | Height: | Size: 102 KiB |
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true" android:drawable="@drawable/press_start_status">
|
||||
</item>
|
||||
<item android:drawable="@drawable/start_failure">
|
||||
</item>
|
||||
</selector>
|
||||
|
||||