Merge branch 'dev_robobus_network_weak_230323' into 'dev_robobus-d_230322_3.0.0'
Dev robobus network weak 230323 See merge request SCA/L4HA/AndroidApp/MoGoEagleEye!747
@@ -55,7 +55,10 @@ 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.AppConnectMsg;
|
||||
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;
|
||||
@@ -319,12 +322,16 @@ public class BusPassengerModel {
|
||||
public void onReceivedMsg(int type, @NonNull byte[] byteArray) {
|
||||
if (OchCommonConst.BUSINESS_STRING == type){
|
||||
|
||||
AppConnectMsg msg = GsonUtils.fromJson(new String(byteArray), AppConnectMsg.class);
|
||||
Logger.d(SceneConstant.M_BUS_P+TAG,"onReceivedMsg = "+GsonUtils.toJson(msg));
|
||||
if (msg.isViewShow()){ //消息盒子显示内容
|
||||
OCHSocketMessageManager.INSTANCE.pushAppOperationalMsgBox(
|
||||
DateTimeUtil.getCurrentTimeStamp(),msg.getMsg(),
|
||||
OCHSocketMessageManager.OPERATION_SYSTEM);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -718,7 +718,7 @@ public class OrderModel {
|
||||
, arriveStation
|
||||
, isLastStop);
|
||||
}
|
||||
VoiceManager.INSTANCE.arrivedStation(arriveStation,arriveStationKr);
|
||||
VoiceManager.INSTANCE.arrivedStationBus(arriveStation,arriveStationKr);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -778,7 +778,7 @@ public class OrderModel {
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
VoiceManager.INSTANCE.leaveStation(nextStation,nextStationKr);
|
||||
VoiceManager.INSTANCE.leaveStationBus(nextStation,nextStationKr);
|
||||
}
|
||||
},DELAY_10S);
|
||||
}
|
||||
@@ -1049,7 +1049,7 @@ public class OrderModel {
|
||||
}
|
||||
|
||||
private void ttsEndTask() {
|
||||
VoiceManager.INSTANCE.endOrder();
|
||||
VoiceManager.INSTANCE.endOrderBus();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,9 +21,6 @@ import com.mogo.och.bus.passenger.model.CharterPassengerModel
|
||||
import com.mogo.och.bus.passenger.model.IOrderStatusChangeListener
|
||||
import com.mogo.och.bus.passenger.model.OrderStatusEnum
|
||||
import com.mogo.och.bus.passenger.ui.MainFragment
|
||||
import com.mogo.och.common.module.bean.dpmsg.BaseDPMsg
|
||||
import com.mogo.och.common.module.bean.dpmsg.ChangeDestMsg
|
||||
import com.mogo.och.common.module.bean.dpmsg.DPCommonOperationMsg
|
||||
import com.mogo.och.common.module.bean.dpmsg.DPMsgType
|
||||
import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst
|
||||
@@ -33,6 +30,8 @@ import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
import com.mogo.och.common.module.utils.NumberFormatUtil
|
||||
import com.mogo.och.common.module.utils.SoundPoolHelper
|
||||
import com.mogo.och.common.module.voice.VoiceNotice
|
||||
import com.mogo.och.common.module.bean.dpmsg.BaseDPMsg
|
||||
import com.mogo.och.common.module.bean.dpmsg.DPCommonOperationMsg
|
||||
import io.reactivex.disposables.Disposable
|
||||
import java.util.*
|
||||
|
||||
|
||||
@@ -25,17 +25,16 @@ import com.mogo.och.bus.passenger.bean.response.SiteInfoResponse
|
||||
import com.mogo.och.bus.passenger.model.CharterPassengerModel
|
||||
import com.mogo.och.bus.passenger.net.BusPassengerModelLoopManager
|
||||
import com.mogo.och.bus.passenger.net.BusPassengerServiceManager
|
||||
import com.mogo.och.bus.passenger.presenter.BusPassengerFunctionDevicePresenter
|
||||
import com.mogo.och.bus.passenger.ui.M1ContainFragment
|
||||
import com.mogo.och.bus.passenger.ui.adapter.OrderLineItemAdapter
|
||||
import com.mogo.och.bus.passenger.ui.adapter.OrderSiteItemAdapter
|
||||
import com.mogo.och.bus.passenger.utils.RxUtils
|
||||
import com.mogo.och.bus.passenger.view.BottomDecoration
|
||||
import com.mogo.och.common.module.bean.dpmsg.ChangeDestMsg
|
||||
import com.mogo.och.common.module.bean.dpmsg.DPMsgType
|
||||
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.OCHPlanningStopSideStatusManager
|
||||
import com.mogo.och.common.module.bean.dpmsg.ChangeDestMsg
|
||||
import io.reactivex.disposables.Disposable
|
||||
import kotlinx.android.synthetic.m1.m1_order_lineside.view.*
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
@@ -52,6 +52,7 @@ import com.mogo.och.common.module.manager.CharterSendTripInfoManager.END_TRIP
|
||||
import com.mogo.och.common.module.manager.CharterSendTripInfoManager.START_TRIP
|
||||
import com.mogo.och.common.module.manager.OCHAdasAbilityManager
|
||||
import com.mogo.och.common.module.utils.*
|
||||
import com.mogo.och.data.bean.*
|
||||
import io.reactivex.exceptions.UndeliverableException
|
||||
import io.reactivex.functions.Consumer
|
||||
import io.reactivex.plugins.RxJavaPlugins
|
||||
@@ -206,6 +207,8 @@ class DriverM1Model {
|
||||
OCHSocketMessageManager.msgWriteOffPassengerType
|
||||
)
|
||||
stopLoopAbnormalFactors()
|
||||
|
||||
CallerTelematicListenerManager.removeListener(TAG)
|
||||
}
|
||||
/**
|
||||
* 接收乘客屏发来确认信息
|
||||
@@ -255,7 +258,7 @@ class DriverM1Model {
|
||||
val list = obj.screenList
|
||||
d(SceneConstant.M_CHARTER_D + TAG, "onMsgReceived = " + GsonUtils.toJson(list))
|
||||
if (list != null && list.contains(1)){ // 司机端
|
||||
pushOperationalToMsgBox(obj.pushTimeStamp, obj.context)
|
||||
pushOperationalToMsgBox(DateTimeUtil.getCurrentTimeStamp(), obj.context)
|
||||
}
|
||||
if (list != null && list.contains(2)){ //发送乘客屏
|
||||
sendMsgToClient(DPCommonOperationMsg(obj.context))
|
||||
|
||||
@@ -59,6 +59,8 @@ dependencies {
|
||||
|
||||
implementation rootProject.ext.dependencies.litezxing
|
||||
|
||||
api project(":OCH:mogo-och-data")
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
api rootProject.ext.dependencies.mogoutils
|
||||
api rootProject.ext.dependencies.mogocommons
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.mogo.och.common.module.bean
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2023/2/14
|
||||
*/
|
||||
data class AppConnectMsg(var isViewShow: Boolean,var isPlay: Boolean,var msg: String)
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.mogo.och.common.module.bean.dpmsg
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2023/2/24
|
||||
*/
|
||||
open class BaseDPMsg(var type: Int) // 0: 常规 1:确认路线/站点 2:开/关车门 3:结束订单
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.mogo.och.common.module.bean.dpmsg
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2023/2/24
|
||||
*/
|
||||
data class ChangeDestMsg(
|
||||
var lineId: Int, //线路id
|
||||
var lineName: String = "", //线路名称
|
||||
var startSiteId: Int= 0, //当前站点
|
||||
var startSiteName: String = "",
|
||||
var destSiteId: Int= 0, //目的地
|
||||
var destSiteName: String = "",
|
||||
var isConfirmed: Boolean = false //司机端是否同意
|
||||
): BaseDPMsg(DPMsgType.TYPE_CHANGE_DEST.type)
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.mogo.och.common.module.bean.dpmsg
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2023/2/24
|
||||
*/
|
||||
data class DPCommonOperationMsg(
|
||||
var msg: String
|
||||
): BaseDPMsg(DPMsgType.TYPE_COMMON.type)
|
||||
@@ -8,5 +8,7 @@ enum class DPMsgType(val type: Int) {
|
||||
TYPE_COMMON(0), //常规
|
||||
TYPE_CHANGE_DEST(1),// 变更目的地确认
|
||||
TYPE_OPEN_CLOSE_DOOR(2),//开关门
|
||||
TYPE_ORDER_CLOSED(3) // 订单结束
|
||||
TYPE_ORDER_CLOSED(3), // 订单结束
|
||||
TYPE_TASK_DETAILS(4), //路线任务详情
|
||||
TYPE_LOGIN_STATUS(5) //login status
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.mogo.och.common.module.bean.dpmsg
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2023/2/24
|
||||
*/
|
||||
data class DPOperateDoorMsg(
|
||||
var open: Boolean = false // true: 开门, false: 关门
|
||||
): BaseDPMsg(DPMsgType.TYPE_OPEN_CLOSE_DOOR.type)
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.mogo.och.common.module.bean.dpmsg
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2023/2/24
|
||||
*/
|
||||
data class DPOrderClosedMsg(
|
||||
var closed: Boolean = true // true: 开门, false: 关门
|
||||
): BaseDPMsg(DPMsgType.TYPE_ORDER_CLOSED.type)
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.mogo.och.common.module.bean.dpmsg
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2023/3/27
|
||||
*/
|
||||
|
||||
object BusCacheKey{
|
||||
const val BUS_LINE_CACHE = "bus_line_cache"
|
||||
const val BUS_LOGIN_STATUS_CACHE = "bus_login_status_cache"
|
||||
}
|
||||
|
||||
open class BaseDPMsg(open var type: Int) // 0: 常规 1:确认路线/站点 2:开/关车门 3:结束订单
|
||||
|
||||
data class LoginCacheStatus(
|
||||
var loginStatus: Int,
|
||||
var updateTime: Long
|
||||
): BaseDPMsg(DPMsgType.TYPE_LOGIN_STATUS.type)
|
||||
|
||||
data class ChangeDestMsg(
|
||||
var lineId: Int, //线路id
|
||||
var lineName: String = "", //线路名称
|
||||
var startSiteId: Int= 0, //当前站点
|
||||
var startSiteName: String = "",
|
||||
var destSiteId: Int= 0, //目的地
|
||||
var destSiteName: String = "",
|
||||
var isConfirmed: Boolean = false //司机端是否同意
|
||||
): BaseDPMsg(DPMsgType.TYPE_CHANGE_DEST.type)
|
||||
|
||||
data class DPCommonOperationMsg(
|
||||
var msg: String
|
||||
): BaseDPMsg(DPMsgType.TYPE_COMMON.type)
|
||||
|
||||
data class DPOperateDoorMsg(
|
||||
var open: Boolean = false // true: 开门, false: 关门
|
||||
): BaseDPMsg(DPMsgType.TYPE_OPEN_CLOSE_DOOR.type)
|
||||
|
||||
data class DPOrderClosedMsg(
|
||||
var closed: Boolean = true // true: 开门, false: 关门
|
||||
): BaseDPMsg(DPMsgType.TYPE_ORDER_CLOSED.type)
|
||||
|
||||
data class AppConnectMsg(var isViewShow: Boolean, var isPlay: Boolean, var msg: String,
|
||||
): BaseDPMsg(DPMsgType.TYPE_COMMON.type)
|
||||
|
||||
data class TaskDetailsMsg(
|
||||
var msg: String?,
|
||||
): BaseDPMsg(DPMsgType.TYPE_TASK_DETAILS.type)
|
||||
@@ -3,11 +3,18 @@ package com.mogo.och.common.module.biz.model
|
||||
import android.annotation.SuppressLint
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.eagle.core.utilcode.util.SharedPrefs
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import com.mogo.och.common.module.bean.dpmsg.BusCacheKey
|
||||
import com.mogo.och.common.module.bean.dpmsg.LoginCacheStatus
|
||||
import com.mogo.och.common.module.biz.bean.DriverStatusQueryRespBean
|
||||
import com.mogo.och.common.module.biz.callback.ILoginCallback
|
||||
import com.mogo.och.common.module.biz.callback.ILoginViewCallback
|
||||
import com.mogo.och.common.module.biz.constant.LoginStatusManager
|
||||
import com.mogo.och.common.module.biz.constant.LoginStatusManager.isLogin
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
import com.mogo.och.data.manager.cache.CacheDataManager
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
object OchCommonLoginStatusDefaultModel : OchCommonLoginStatusModel() {
|
||||
@@ -29,6 +36,19 @@ object OchCommonLoginStatusDefaultModel : OchCommonLoginStatusModel() {
|
||||
loginViewCallback?.showLoginDialogFragment()
|
||||
}
|
||||
loginCallback?.loginSuccess(data)
|
||||
|
||||
updateLoginLocalStatus(isLogin())
|
||||
|
||||
}
|
||||
|
||||
private fun updateLoginLocalStatus(isLogin: Boolean) {
|
||||
var loginCacheStatus = LoginCacheStatus(if (isLogin){
|
||||
1
|
||||
}else {
|
||||
0
|
||||
},DateTimeUtil.getCurrentTimeStamp())
|
||||
CacheDataManager.instance.putCacheData(mContext, BusCacheKey.BUS_LOGIN_STATUS_CACHE,
|
||||
GsonUtils.toJson(loginCacheStatus))
|
||||
}
|
||||
|
||||
override fun loginFail(isLogin: Boolean) {
|
||||
@@ -39,6 +59,8 @@ object OchCommonLoginStatusDefaultModel : OchCommonLoginStatusModel() {
|
||||
loginViewCallback?.showLoginDialogFragment()
|
||||
}
|
||||
loginCallback?.loginFail(isLogin)
|
||||
|
||||
updateLoginLocalStatus(isLogin)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import com.mogo.eagle.core.utilcode.util.DateTimeUtils;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.TimeZone;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
@@ -101,4 +102,12 @@ public class DateTimeUtil {
|
||||
public static long getCurrentTimeStamp(){
|
||||
return System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public static long getTodayStartTime(){
|
||||
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT+8"));
|
||||
calendar.set(Calendar.HOUR_OF_DAY,0);
|
||||
calendar.set(Calendar.MINUTE,0);
|
||||
calendar.set(Calendar.SECOND,0);
|
||||
return calendar.getTimeInMillis();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,4 +102,65 @@ object VoiceManager {
|
||||
list.add(koreanTTS)
|
||||
VoiceNotice.showNotice(list, AIAssist.LEVEL0,callBack)
|
||||
}
|
||||
|
||||
fun arrivedStationBus(siteNameCN: String?, siteNameKR: String?) {
|
||||
val context = AbsMogoApplication.getApp()
|
||||
val list: MutableList<LangTtsEntity> = ArrayList()
|
||||
siteNameCN?.let {
|
||||
val chineseTTS = LangTtsEntity(
|
||||
context.getString(R.string.bus_arrived_station_tip, it),
|
||||
LanguageType.CHINESE
|
||||
)
|
||||
val engTTS = LangTtsEntity(
|
||||
context.getString(R.string.bus_arrived_station_english_tip, it),
|
||||
LanguageType.CHINESE
|
||||
)
|
||||
val koreanTTS = LangTtsEntity(
|
||||
context.getString(R.string.bus_arrived_station_korean_tip, siteNameKR?:it),
|
||||
LanguageType.KOREAN
|
||||
)
|
||||
list.add(chineseTTS)
|
||||
list.add(engTTS)
|
||||
list.add(koreanTTS)
|
||||
}
|
||||
|
||||
VoiceNotice.showNotice(list, AIAssist.LEVEL1,null)
|
||||
}
|
||||
|
||||
fun leaveStationBus(siteNameCN: String?, siteNameKR: String?) {
|
||||
val list: MutableList<LangTtsEntity> = ArrayList()
|
||||
val context = AbsMogoApplication.getApp()
|
||||
siteNameCN?.let {
|
||||
val chineseTTS = LangTtsEntity(
|
||||
context.getString(R.string.bus_leave_station_tip, it),
|
||||
LanguageType.CHINESE
|
||||
)
|
||||
val engTTS = LangTtsEntity(
|
||||
context.getString(R.string.bus_leave_station_english_tip, it),
|
||||
LanguageType.CHINESE
|
||||
)
|
||||
list.add(chineseTTS)
|
||||
list.add(engTTS)
|
||||
|
||||
val koreanTTS = LangTtsEntity(
|
||||
context.getString(R.string.bus_leave_station_korean_tip, siteNameKR ?: it),
|
||||
LanguageType.KOREAN
|
||||
)
|
||||
list.add(koreanTTS)
|
||||
}
|
||||
VoiceNotice.showNotice(list, AIAssist.LEVEL1,null)
|
||||
}
|
||||
|
||||
fun endOrderBus() {
|
||||
val context = AbsMogoApplication.getApp()
|
||||
val list: MutableList<LangTtsEntity> = ArrayList()
|
||||
val chineseTTS = LangTtsEntity(context.getString(R.string.bus_end_task_tip), LanguageType.CHINESE)
|
||||
val engTTS = LangTtsEntity(context.getString(R.string.bus_end_task_english_tip), LanguageType.ENGLISH)
|
||||
val koreanTTS = LangTtsEntity(context.getString(R.string.bus_end_task_korean_tip), LanguageType.KOREAN)
|
||||
list.add(chineseTTS)
|
||||
list.add(engTTS)
|
||||
list.add(koreanTTS)
|
||||
VoiceNotice.showNotice(list, AIAssist.LEVEL0,null)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,6 +22,8 @@
|
||||
android:id="@+id/common_tips"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="@dimen/dp_40"
|
||||
android:paddingRight="@dimen/dp_40"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/common_title"
|
||||
|
||||
@@ -31,6 +31,18 @@
|
||||
<string name="end_order_en">Thank you for experiencing the self-driving minibus. See you next time</string>
|
||||
<string name="end_order_ko">자율주행 버스를 체험해 주셔서 감사합니다. 다음에 또 뵙겠습니다</string>
|
||||
|
||||
<string name="bus_arrived_station_tip">已到达%1$s,带好随身物品,下车请注意安全。</string>
|
||||
<string name="bus_arrived_station_english_tip">We are arriving at %1$s ,get off with your belongings</string>
|
||||
<string name="bus_arrived_station_korean_tip">%1$s 역에 도착했습니다 , 소지품 챙겨서 내리세요</string>
|
||||
|
||||
<string name="bus_leave_station_tip">车辆起步,请扶稳坐好,前方到站是%1$s,请下车的乘客做好准备。</string>
|
||||
<string name="bus_leave_station_english_tip">The next station is %1$s ,please get ready for your arrival</string>
|
||||
<string name="bus_leave_station_korean_tip">전방에서 역에 도착하는 %1$s ,차에서 내리는 승객은 준비하세요</string>
|
||||
|
||||
<string name="bus_end_task_tip">感谢您体验\'蘑菇车联\'自动驾驶小巴车,我们下次再见。</string>
|
||||
<string name="bus_end_task_english_tip">Thank you for experiencing the self-driving minibus. See you next time</string>
|
||||
<string name="bus_end_task_korean_tip">자율주행 버스를 체험해 주셔서 감사합니다. 다음에 또 뵙겠습니다</string>
|
||||
|
||||
<string name="qr_cancel">取消</string>
|
||||
<string name="bind_driver_qr_title">扫描二维码完成车辆绑定</string>
|
||||
</resources>
|
||||
1
OCH/mogo-och-data/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
46
OCH/mogo-och-data/build.gradle
Normal file
@@ -0,0 +1,46 @@
|
||||
plugins {
|
||||
id 'com.android.library'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 31
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles "consumer-rules.pro"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation fileTree(dir: "libs", include: ["*.jar"])
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
implementation rootProject.ext.dependencies.androidxccorektx
|
||||
implementation rootProject.ext.dependencies.androidxappcompat
|
||||
implementation rootProject.ext.dependencies.material
|
||||
implementation rootProject.ext.dependencies.rxandroid
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
api rootProject.ext.dependencies.mogoutils
|
||||
}else {
|
||||
api project(":core:mogo-core-utils")
|
||||
}
|
||||
}
|
||||
0
OCH/mogo-och-data/consumer-rules.pro
Normal file
21
OCH/mogo-och-data/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.mogo.och.data
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
import org.junit.Assert.*
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class ExampleInstrumentedTest {
|
||||
@Test
|
||||
fun useAppContext() {
|
||||
// Context of the app under test.
|
||||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
||||
assertEquals("com.mogo.och.data.test", appContext.packageName)
|
||||
}
|
||||
}
|
||||
5
OCH/mogo-och-data/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.och.data">
|
||||
|
||||
</manifest>
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.bean;
|
||||
package com.mogo.och.data.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -16,6 +16,8 @@ public class BusRoutesResult {
|
||||
private int status;
|
||||
private long taskTime; //线路时间班次
|
||||
private int taskId;// 线路班次id
|
||||
private String runningDur; //运营时间
|
||||
private long writeVersion; //更新时间戳
|
||||
|
||||
//线路轨迹相关字段
|
||||
public String csvFileUrl = ""; //轨迹文件下载的cos url,默认“”
|
||||
@@ -30,6 +32,14 @@ public class BusRoutesResult {
|
||||
public String txtFileMd5DPQP = ""; //轨迹文件md5,默认“”
|
||||
public long contrailSaveTimeDPQP; //上传轨迹完成时间戳ms:用于MEC本地手动导入轨迹验证时不会被云端轨迹覆盖
|
||||
|
||||
public String getRunningDur() {
|
||||
return runningDur;
|
||||
}
|
||||
|
||||
public void setRunningDur(String runningDur) {
|
||||
this.runningDur = runningDur;
|
||||
}
|
||||
|
||||
public int getLineId() {
|
||||
return lineId;
|
||||
}
|
||||
@@ -54,16 +64,40 @@ public class BusRoutesResult {
|
||||
return taskTime;
|
||||
}
|
||||
|
||||
public long getWriteVersion() {
|
||||
return writeVersion;
|
||||
}
|
||||
|
||||
public void setWriteVersion(long writeVersion) {
|
||||
this.writeVersion = writeVersion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
BusRoutesResult that = (BusRoutesResult) o;
|
||||
return lineId == that.lineId
|
||||
&& lineType == that.lineType
|
||||
&& status == that.status
|
||||
&& sites.equals(that.sites)
|
||||
&& name.equals(that.name)
|
||||
&& writeVersion == that.writeVersion
|
||||
&& runningDur.equals(that.runningDur);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BusRoutesResult{" +
|
||||
"sites=" + sites +
|
||||
", lineId=" + lineId +
|
||||
", name='" + name + '\'' +
|
||||
", taskTime='" + taskTime + '\'' +
|
||||
", lineType=" + lineType +
|
||||
", description='" + description + '\'' +
|
||||
", status=" + status +
|
||||
", taskTime=" + taskTime +
|
||||
", taskId=" + taskId +
|
||||
", writeVersion=" + writeVersion +
|
||||
", csvFileUrl='" + csvFileUrl + '\'' +
|
||||
", csvFileMd5='" + csvFileMd5 + '\'' +
|
||||
", txtFileUrl='" + txtFileUrl + '\'' +
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.bus.bean;
|
||||
package com.mogo.och.data.bean;
|
||||
|
||||
/**
|
||||
* 单个网约车小巴车站信息
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.mogo.och.data.bean
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2023/3/31
|
||||
*/
|
||||
data class BusTransferData (
|
||||
var loginStatus: Int,
|
||||
var routesResult: BusRoutesResult?,
|
||||
)
|
||||
28
OCH/mogo-och-data/src/main/java/com/mogo/och/data/manager/cache/CacheDataManager.kt
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
package com.mogo.och.data.manager.cache
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2023/3/27
|
||||
*/
|
||||
class CacheDataManager private constructor(){
|
||||
companion object{
|
||||
val instance: CacheDataManager by lazy (mode = LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
CacheDataManager()
|
||||
}
|
||||
}
|
||||
|
||||
fun putCacheData(context: Context, key:String, jsonStr: String){
|
||||
SharedPrefsMgr.getInstance(context).putString(key,jsonStr)
|
||||
}
|
||||
|
||||
fun getCacheData(context: Context, key: String) : String{
|
||||
return SharedPrefsMgr.getInstance(context).getString(key)
|
||||
}
|
||||
|
||||
fun clearCacheData(context: Context, key: String){
|
||||
SharedPrefsMgr.getInstance(context).remove(key)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.mogo.och.data
|
||||
|
||||
import org.junit.Test
|
||||
|
||||
import org.junit.Assert.*
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
class ExampleUnitTest {
|
||||
@Test
|
||||
fun addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2)
|
||||
}
|
||||
}
|
||||
@@ -73,7 +73,7 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.rxandroid
|
||||
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
||||
implementation rootProject.ext.dependencies.amapnavi3dmap
|
||||
implementation project(":OCH:mogo-och-common-module")
|
||||
api project(":OCH:mogo-och-common-module")
|
||||
compileOnly project(":libraries:mogo-map")
|
||||
implementation project(':core:mogo-core-res')
|
||||
testImplementation 'junit:junit:4.12'
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.mogo.och.bus.passenger.R;
|
||||
import com.mogo.och.bus.passenger.bean.BusPassengerStation;
|
||||
import com.mogo.och.common.module.utils.BlinkAnimationUtil;
|
||||
import com.mogo.och.common.module.wigets.MarqueeTextView;
|
||||
import com.mogo.och.data.bean.BusStationBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -30,9 +31,9 @@ import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STAT
|
||||
public class BusPassengerLineStationsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||
|
||||
private Context mContext;
|
||||
private List<BusPassengerStation> mStations;
|
||||
private List<BusStationBean> mStations;
|
||||
|
||||
public BusPassengerLineStationsAdapter(Context context, List<BusPassengerStation> stations){
|
||||
public BusPassengerLineStationsAdapter(Context context, List<BusStationBean> stations){
|
||||
this.mContext = context;
|
||||
this.mStations = stations;
|
||||
}
|
||||
@@ -47,7 +48,7 @@ public class BusPassengerLineStationsAdapter extends RecyclerView.Adapter<Recycl
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
BusPassengerStation station = mStations.get(position);
|
||||
BusStationBean station = mStations.get(position);
|
||||
StationViewHolder viewHolder = (StationViewHolder)holder;
|
||||
viewHolder.stationName.setText(station.getName());
|
||||
BlinkAnimationUtil.clearAnimation(viewHolder.stationCircle);
|
||||
@@ -75,7 +76,7 @@ public class BusPassengerLineStationsAdapter extends RecyclerView.Adapter<Recycl
|
||||
viewHolder.groupStationTagPanel.setVisibility(View.GONE);
|
||||
}
|
||||
viewHolder.curArrowBg.setVisibility(View.VISIBLE);
|
||||
BusPassengerStation preStation = mStations.get(position -1);
|
||||
BusStationBean preStation = mStations.get(position -1);
|
||||
if (station.getDrivingStatus() == STATION_STATUS_LEAVING ||
|
||||
(station.getDrivingStatus() == STATION_STATUS_STOPPED && station.isLeaving())){ //过站
|
||||
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_station_txt_color));
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.och.bus.passenger.bean;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.och.data.bean.BusRoutesResult;
|
||||
|
||||
/**
|
||||
* 网约车小巴路线接口请求响应结果 返回的是对应司机屏的线路信息
|
||||
@@ -8,13 +9,13 @@ import com.mogo.eagle.core.data.BaseData;
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class BusPassengerRoutesResponse extends BaseData {
|
||||
private BusPassengerRoutesResult data;
|
||||
private BusRoutesResult data;
|
||||
|
||||
public BusPassengerRoutesResult getResult() {
|
||||
public BusRoutesResult getResult() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setResult(BusPassengerRoutesResult data) {
|
||||
public void setResult(BusRoutesResult data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ public class BusPassengerRoutesResult {
|
||||
private int status;
|
||||
private String runningDur; //运营时间
|
||||
private long taskTime; //线路时间班次
|
||||
private long writeVersion;//更新时间戳
|
||||
|
||||
public List<BusPassengerStation> getSites() {
|
||||
return sites;
|
||||
@@ -46,6 +47,10 @@ public class BusPassengerRoutesResult {
|
||||
return runningDur;
|
||||
}
|
||||
|
||||
public long getWriteVersion() {
|
||||
return writeVersion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BusPassengerRoutesResult{" +
|
||||
@@ -55,6 +60,7 @@ public class BusPassengerRoutesResult {
|
||||
", lineType=" + lineType +
|
||||
", description='" + description + '\'' +
|
||||
", status=" + status +
|
||||
", writeVersion="+ writeVersion+
|
||||
", runningDur='" + runningDur + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.och.bus.passenger.callback;
|
||||
|
||||
import com.mogo.och.bus.passenger.bean.BusPassengerStation;
|
||||
import com.mogo.och.data.bean.BusStationBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -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<BusStationBean> stations, int currentStationIndex, boolean isArrived);
|
||||
void showNoTaskView();
|
||||
void hideNoTaskView();
|
||||
}
|
||||
|
||||
@@ -20,6 +20,24 @@ import com.mogo.commons.module.intent.IMogoIntentListener;
|
||||
import com.mogo.commons.module.intent.IntentManager;
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener;
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager;
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager;
|
||||
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.util.GsonUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.och.bus.passenger.R;
|
||||
import com.mogo.och.bus.passenger.bean.BusPassengerOperationStatusResponse;
|
||||
import com.mogo.och.bus.passenger.bean.BusPassengerRoutesResponse;
|
||||
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.bean.dpmsg.TaskDetailsMsg;
|
||||
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.utils.DateTimeUtil;
|
||||
import com.mogo.commons.module.status.StatusDescriptor;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
@@ -36,12 +54,6 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.CoordinateUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.och.bus.passenger.R;
|
||||
import com.mogo.och.bus.passenger.bean.BusPassengerOperationStatusResponse;
|
||||
import com.mogo.och.bus.passenger.bean.BusPassengerRoutesResponse;
|
||||
import com.mogo.och.bus.passenger.bean.BusPassengerRoutesResult;
|
||||
import com.mogo.och.bus.passenger.bean.BusPassengerStation;
|
||||
import com.mogo.och.bus.passenger.callback.IBusPassegerDriverStatusCallback;
|
||||
import com.mogo.och.bus.passenger.callback.IBusPassengerADASStatusCallback;
|
||||
import com.mogo.och.bus.passenger.callback.IBusPassengerAutopilotPlanningCallback;
|
||||
@@ -53,6 +65,9 @@ import com.mogo.och.bus.passenger.network.BusPassengerServiceManager;
|
||||
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.data.bean.BusRoutesResult;
|
||||
import com.mogo.och.data.bean.BusStationBean;
|
||||
import com.mogo.och.data.bean.BusTransferData;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -91,9 +106,9 @@ public class BusPassengerModel {
|
||||
|
||||
private MogoLocation mLocation = null;
|
||||
|
||||
private BusPassengerRoutesResult routesResult = null;
|
||||
private BusRoutesResult routesResult = null;
|
||||
|
||||
List<BusPassengerStation> mStations = new ArrayList<>();
|
||||
List<BusStationBean> mStations = new ArrayList<>();
|
||||
private int mNextStationIndex = 0;// 要到达站的index
|
||||
private List<MogoLocation> mTwoStationsRouts = new ArrayList<>();
|
||||
private int mPreRouteIndex = 0;
|
||||
@@ -117,11 +132,26 @@ public class BusPassengerModel {
|
||||
public void init( Context context ) {
|
||||
mContext = context.getApplicationContext();
|
||||
initListeners();
|
||||
// TODO: 2022/3/31
|
||||
queryDriverOperationStatus();
|
||||
queryDriverByLocalDriver();
|
||||
startOrStopOrderLoop(true);
|
||||
}
|
||||
|
||||
private void queryDriverByLocalDriver() {
|
||||
//本地去请求司机端
|
||||
TaskDetailsMsg msg = new TaskDetailsMsg("task");
|
||||
|
||||
sendMsgToServer(GsonUtils.toJson(msg));
|
||||
}
|
||||
|
||||
private void queryLoginStatusByLocal() {
|
||||
//本地去请求司机端
|
||||
LoginCacheStatus msg = new LoginCacheStatus(0,
|
||||
DPMsgType.TYPE_LOGIN_STATUS.getType());
|
||||
|
||||
sendMsgToServer(GsonUtils.toJson(msg));
|
||||
}
|
||||
|
||||
public void setDriverStatusCallback(IBusPassegerDriverStatusCallback callback){
|
||||
this.mDriverStatusCallback = callback;
|
||||
}
|
||||
@@ -134,6 +164,13 @@ public class BusPassengerModel {
|
||||
handler.sendEmptyMessageDelayed( MSG_QUERY_BUS_P_STATION, QUERY_BUS_P_STATION_DELAY );
|
||||
}
|
||||
|
||||
private void sendMsgToServer(String msg){
|
||||
CallerTelematicManager.INSTANCE.sendMsgToServer(
|
||||
OchCommonConst.BUSINESS_STRING,
|
||||
msg.getBytes()
|
||||
);
|
||||
}
|
||||
|
||||
private void queryDriverOperationStatus() {
|
||||
BusPassengerServiceManager.queryDriverOperationStatus(mContext
|
||||
, new OchCommonServiceCallback<BusPassengerOperationStatusResponse>() {
|
||||
@@ -154,7 +191,6 @@ public class BusPassengerModel {
|
||||
} else {
|
||||
ToastUtils.showShort(mContext.getString(R.string.request_error_tip));
|
||||
}
|
||||
queryDriverOperationDelay();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -172,23 +208,31 @@ public class BusPassengerModel {
|
||||
public void onSuccess(BusPassengerRoutesResponse data) {
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
clearLocalRouteResult();
|
||||
return;
|
||||
}
|
||||
if (routesResult != null && data.getResult().equals(routesResult)){
|
||||
CallerLogger.INSTANCE.d( M_BUS_P + TAG, "queryDriverSiteByCoordinate = not update");
|
||||
return;
|
||||
}
|
||||
routesResult = data.getResult();
|
||||
updatePassengerRouteInfo(data.getResult());
|
||||
|
||||
if (routesResult != null &&
|
||||
routesResult.getWriteVersion() < data.getResult().getWriteVersion()){
|
||||
routesResult = data.getResult();
|
||||
}
|
||||
|
||||
if (routesResult == null){
|
||||
routesResult = data.getResult();
|
||||
}
|
||||
|
||||
updatePassengerRouteInfo(routesResult);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError() {
|
||||
CallerLogger.INSTANCE.d( M_BUS_P + TAG, "queryDriverSiteByCoordinate = onError ="
|
||||
+ ", sn = " +BusPassengerServiceManager.INSTANCE.getDriverAppSn());
|
||||
queryDriverByLocalDriver();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -207,20 +251,40 @@ public class BusPassengerModel {
|
||||
startOrStopCalculateRouteInfo(false);
|
||||
return;
|
||||
}
|
||||
queryDriverByLocalDriver();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void updatePassengerRouteInfo(BusPassengerRoutesResult result) {
|
||||
private void clearLocalRouteResult() {
|
||||
if (routesResult != null) {
|
||||
routesResult = null;
|
||||
}
|
||||
mNextStationIndex = 0;
|
||||
startOrStopCalculateRouteInfo(false);
|
||||
|
||||
if (mRouteLineInfoCallback != null){
|
||||
mRouteLineInfoCallback.showNoTaskView();
|
||||
}
|
||||
}
|
||||
|
||||
private void updatePassengerRouteInfo(BusRoutesResult result) {
|
||||
if (result == null){
|
||||
clearLocalRouteResult();
|
||||
return;
|
||||
}
|
||||
|
||||
routesResult = result;
|
||||
|
||||
if (mRouteLineInfoCallback != null){
|
||||
mRouteLineInfoCallback.updateLineInfo(result.getName(),result.getRunningDur());
|
||||
mRouteLineInfoCallback.hideNoTaskView();
|
||||
if (result.getSites() != null){
|
||||
List<BusPassengerStation> stations = result.getSites();
|
||||
List<BusStationBean> stations = result.getSites();
|
||||
mStations.clear();
|
||||
mStations.addAll(stations);
|
||||
for (int i = 0; i< stations.size(); i++){
|
||||
BusPassengerStation station = stations.get(i);
|
||||
BusStationBean station = stations.get(i);
|
||||
if (station.getDrivingStatus() == STATION_STATUS_STOPPED && station.isLeaving() && i+1 < stations.size()){
|
||||
mRouteLineInfoCallback.updateStationsInfo(stations,i+1,false);
|
||||
if(mNextStationIndex != i+1){
|
||||
@@ -283,6 +347,9 @@ public class BusPassengerModel {
|
||||
//2021.11.1 自动驾驶路线规划接口
|
||||
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG,moGoAutopilotPlanningListener);
|
||||
|
||||
//监听司机端消息
|
||||
CallerTelematicListenerManager.INSTANCE.addListener(TAG,mReceivedMsgListener);
|
||||
|
||||
AbnormalFactorsLoopManager.INSTANCE.startLoopAbnormalFactors(mContext);
|
||||
}
|
||||
|
||||
@@ -299,8 +366,48 @@ public class BusPassengerModel {
|
||||
CallerPlanningRottingListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener);
|
||||
|
||||
AbnormalFactorsLoopManager.INSTANCE.stopLoopAbnormalFactors();
|
||||
|
||||
CallerTelematicListenerManager.INSTANCE.removeListener(TAG);
|
||||
CallerTelematicListenerManager.INSTANCE.removeListener(TAG);
|
||||
}
|
||||
|
||||
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 != null && msg.isViewShow()) { //消息盒子显示内容
|
||||
OCHSocketMessageManager.INSTANCE.pushAppOperationalMsgBox(
|
||||
DateTimeUtil.getCurrentTimeStamp(), msg.getMsg(),
|
||||
OCHSocketMessageManager.OPERATION_SYSTEM);
|
||||
}
|
||||
} else if (baseMsg != null && baseMsg.getType() == DPMsgType.TYPE_TASK_DETAILS.getType()) {
|
||||
TaskDetailsMsg msg = GsonUtils.fromJson(new String(byteArray), TaskDetailsMsg.class);
|
||||
|
||||
Logger.d(SceneConstant.M_BUS_P + TAG, "onReceivedMsg = " + GsonUtils.toJson(msg));
|
||||
if (msg == null || msg.getMsg().isEmpty()) {
|
||||
clearLocalRouteResult();
|
||||
return;
|
||||
}
|
||||
BusTransferData result = GsonUtils.fromJson(msg.getMsg(), BusTransferData.class);
|
||||
if (msg != null && mDriverStatusCallback != null) {
|
||||
mDriverStatusCallback.changeOperationStatus(result.getLoginStatus() == 1);
|
||||
}
|
||||
if (result != null) { //已司机端传来的为准
|
||||
routesResult = result.getRoutesResult();
|
||||
updatePassengerRouteInfo(routesResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//监听网络变化,避免启动机器时无网导致无法更新订单信息
|
||||
private final IMogoIntentListener mNetWorkIntentListener = new IMogoIntentListener() {
|
||||
@Override
|
||||
@@ -437,8 +544,8 @@ public class BusPassengerModel {
|
||||
if (mStations.size() > 1){ //两个站点及以上要计算两个站点间的轨迹路线
|
||||
if (mNextStationIndex <= mStations.size()-1 && mNextStationIndex - 1 >=0){
|
||||
mTwoStationsRouts.clear();
|
||||
BusPassengerStation stationNext = mStations.get(mNextStationIndex);
|
||||
BusPassengerStation stationCur = mStations.get(mNextStationIndex - 1);
|
||||
BusStationBean stationNext = mStations.get(mNextStationIndex);
|
||||
BusStationBean stationCur = mStations.get(mNextStationIndex - 1);
|
||||
//当前站在轨迹中对应的点
|
||||
int currentRouteIndex = CoordinateCalculateRouteUtil.getArrivedPointIndexNew(0
|
||||
,mRoutePoints
|
||||
@@ -487,7 +594,7 @@ public class BusPassengerModel {
|
||||
float lastSumLength = 0;
|
||||
if (lastPoints.size() == 1){ //只是最后一个点,计算当前位置和最后一个点的距离
|
||||
if (mNextStationIndex <= mStations.size()-1 && mNextStationIndex >= 0){
|
||||
BusPassengerStation stationNext = mStations.get(mNextStationIndex);
|
||||
BusStationBean stationNext = mStations.get(mNextStationIndex);
|
||||
lastSumLength = CoordinateUtils.calculateLineDistance(
|
||||
stationNext.getGcjLon(), stationNext.getGcjLat(),
|
||||
mLocation.getLongitude(), mLocation.getLatitude());
|
||||
|
||||
@@ -4,8 +4,6 @@ import android.content.Context
|
||||
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.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||
import com.mogo.och.bus.passenger.bean.BusPassengerQueryLineRequest
|
||||
import com.mogo.och.bus.passenger.bean.BusPassengerOperationStatusResponse
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.mogo.och.bus.passenger.callback.IBusPassengerControllerStatusCallback
|
||||
import com.mogo.och.bus.passenger.callback.IBusPassengerRouteLineInfoCallback;
|
||||
import com.mogo.och.bus.passenger.model.BusPassengerModel;
|
||||
import com.mogo.och.bus.passenger.ui.BusPassengerRouteFragment;
|
||||
import com.mogo.och.data.bean.BusStationBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -131,7 +132,7 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStationsInfo(List<BusPassengerStation> stations,int currentStationIndex,boolean isArrived) {
|
||||
public void updateStationsInfo(List<BusStationBean> stations, int currentStationIndex, boolean isArrived) {
|
||||
runOnUIThread(() -> mView.updateStationsInfo(stations,currentStationIndex, isArrived));
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.mogo.och.bus.passenger.presenter.BaseBusPassengerPresenter;
|
||||
import com.mogo.och.bus.passenger.ui.layoutmanager.CenterLayoutManager;
|
||||
import com.mogo.och.bus.passenger.utils.BPRouteDataTestUtils;
|
||||
import com.mogo.och.common.module.wigets.MarqueeTextView;
|
||||
import com.mogo.och.data.bean.BusStationBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -42,7 +43,7 @@ public class BusPassengerRouteFragment extends
|
||||
|
||||
private final String TAG = "BusPassengerRouteFragment";
|
||||
|
||||
private final List<BusPassengerStation> mStationsList = new ArrayList<>();
|
||||
private final List<BusStationBean> mStationsList = new ArrayList<>();
|
||||
|
||||
private TextView mSpeedTv;
|
||||
private ConstraintLayout mNoLineInfoView;
|
||||
@@ -236,7 +237,7 @@ public class BusPassengerRouteFragment extends
|
||||
* @param currentStationIndex
|
||||
* @param isArrived 是否到站并离开,true 到达当前站 currentStationIndex 未离开, false 正在前往此站 currentStationIndex
|
||||
*/
|
||||
public void updateStationsInfo(List<BusPassengerStation> stations, int currentStationIndex,boolean isArrived) {
|
||||
public void updateStationsInfo(List<BusStationBean> stations, int currentStationIndex, boolean isArrived) {
|
||||
updateArrivedStation(stations.get(currentStationIndex).getName(),currentStationIndex,isArrived);
|
||||
mStationsList.clear();
|
||||
mStationsList.addAll(stations);
|
||||
@@ -257,7 +258,7 @@ public class BusPassengerRouteFragment extends
|
||||
}
|
||||
}
|
||||
|
||||
private void updateWayPointList(List<BusPassengerStation> stations,int currentStationIndex) {
|
||||
private void updateWayPointList(List<BusStationBean> stations,int currentStationIndex) {
|
||||
List<LatLng> mLineStationsList = new ArrayList<>();
|
||||
for (int i = 0; i< stations.size(); i++) {//站点集合
|
||||
// LatLng latLng = CoordinateCalculateRouteUtil.coordinateConverterWgsToGcj(getContext()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.och.bus.passenger.bean;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.och.data.bean.BusRoutesResult;
|
||||
|
||||
/**
|
||||
* 网约车小巴路线接口请求响应结果 返回的是对应司机屏的线路信息
|
||||
@@ -8,13 +9,13 @@ import com.mogo.eagle.core.data.BaseData;
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class PM2RoutesResponse extends BaseData {
|
||||
private PM2RoutesResult data;
|
||||
private BusRoutesResult data;
|
||||
|
||||
public PM2RoutesResult getResult() {
|
||||
public BusRoutesResult getResult() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setResult(PM2RoutesResult data) {
|
||||
public void setResult(BusRoutesResult data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.och.bus.passenger.callback
|
||||
|
||||
import com.mogo.och.bus.passenger.bean.PM2Station
|
||||
import com.mogo.och.data.bean.BusStationBean
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
@@ -13,6 +13,6 @@ interface DrivingInfoCallback {
|
||||
fun updateRemainMT(meters : Long, timeInSecond : Long) // 米,秒
|
||||
fun changeOperationStatus(loginStatus : Boolean)
|
||||
fun showNoTaskView(isTrue : Boolean)
|
||||
fun updateLineStations(stations: MutableList<PM2Station>)
|
||||
fun updateStationsInfo(stations: MutableList<PM2Station>, i: Int, isArrived: Boolean)
|
||||
fun updateLineStations(stations: MutableList<BusStationBean>)
|
||||
fun updateStationsInfo(stations: MutableList<BusStationBean>, i: Int, isArrived: Boolean)
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
package com.mogo.och.bus.passenger.model
|
||||
|
||||
import android.content.Context
|
||||
import com.amap.api.maps.model.LatLng
|
||||
import com.mogo.och.bus.passenger.bean.PM2Station
|
||||
import com.mogo.och.bus.passenger.callback.ADASCallback
|
||||
import com.mogo.och.data.bean.BusStationBean
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
@@ -29,7 +28,7 @@ class PM2ADASModel private constructor() {
|
||||
this.mAdasCallback = adasCallback
|
||||
}
|
||||
|
||||
fun updateHDMapStations(stations: MutableList<PM2Station>){
|
||||
fun updateHDMapStations(stations: MutableList<BusStationBean>){
|
||||
var stationsList = mutableListOf<MutableList<Double>>()
|
||||
for (i in stations.indices){
|
||||
var listLatLng = mutableListOf<Double>() // 0: long 1:lat
|
||||
|
||||
@@ -23,6 +23,8 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
|
||||
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.function.call.telematic.CallerTelematicManager.sendMsgToServer
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
@@ -33,18 +35,20 @@ import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.bean.PM2OperationStatusResponse
|
||||
import com.mogo.och.bus.passenger.bean.PM2RoutesResponse
|
||||
import com.mogo.och.bus.passenger.bean.PM2RoutesResult
|
||||
import com.mogo.och.bus.passenger.bean.PM2Station
|
||||
import com.mogo.och.bus.passenger.callback.AutoPilotStatusCallback
|
||||
import com.mogo.och.bus.passenger.callback.DrivingInfoCallback
|
||||
import com.mogo.och.bus.passenger.constant.BusPassengerConst
|
||||
import com.mogo.och.bus.passenger.model.PM2ServiceManager.driverAppSn
|
||||
import com.mogo.och.bus.passenger.network.PM2ModelLoopManager
|
||||
import com.mogo.och.common.module.bean.AppConnectMsg
|
||||
import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.bean.dpmsg.*
|
||||
import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager.pushAppOperationalMsgBox
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
import com.mogo.och.data.bean.BusRoutesResult
|
||||
import com.mogo.och.data.bean.BusStationBean
|
||||
import com.mogo.och.data.bean.BusTransferData
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import kotlin.math.abs
|
||||
|
||||
@@ -58,11 +62,11 @@ class PM2DrivingModel private constructor() {
|
||||
private var mLocation: MogoLocation? = null
|
||||
|
||||
private var mRoutePoints = mutableListOf<MogoLocation>()
|
||||
private var routesResult: PM2RoutesResult? = null
|
||||
private var routesResult: BusRoutesResult? = null
|
||||
|
||||
private var mCurrentAutoStatus = -1
|
||||
|
||||
var mStations = mutableListOf<PM2Station>()
|
||||
var mStations = mutableListOf<BusStationBean>()
|
||||
private var mNextStationIndex = 0 // A-B要到达站的index
|
||||
private var isGoingToNextStation = false //是否前往下一站过程中
|
||||
|
||||
@@ -94,11 +98,17 @@ class PM2DrivingModel private constructor() {
|
||||
fun init(context : Context){
|
||||
mContext = context
|
||||
initListener()
|
||||
// TODO: 2022/3/31
|
||||
queryDriverByLocalDriver()
|
||||
queryDriverOperationStatus()
|
||||
startOrStopOrderLoop(true)
|
||||
}
|
||||
|
||||
private fun queryDriverByLocalDriver() {
|
||||
//本地去请求司机端
|
||||
val msg = TaskDetailsMsg("task")
|
||||
sendMsgToServer(GsonUtils.toJson(msg))
|
||||
}
|
||||
|
||||
private fun initListener() {
|
||||
//自动驾驶状态监听
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, mAutoPilotStatusListener)
|
||||
@@ -118,6 +128,13 @@ class PM2DrivingModel private constructor() {
|
||||
|
||||
}
|
||||
|
||||
private fun sendMsgToServer(msg: String) {
|
||||
sendMsgToServer(
|
||||
OchCommonConst.BUSINESS_STRING,
|
||||
GsonUtils.toJson(msg).toByteArray()
|
||||
)
|
||||
}
|
||||
|
||||
fun releaseListener(){
|
||||
//自动驾驶状态监听
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
@@ -152,14 +169,43 @@ class PM2DrivingModel private constructor() {
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
override fun onReceivedMsg(type: Int, byteArray: ByteArray) {//接收司机端发来的信息
|
||||
if (OchCommonConst.BUSINESS_STRING == type){
|
||||
val msg = GsonUtils.fromJson(String(byteArray),AppConnectMsg::class.java) as AppConnectMsg
|
||||
Logger.d(SceneConstant.M_BUS_P+TAG,"onReceivedMsg = "+GsonUtils.toJson(msg))
|
||||
if (msg.isPlay){ //播报
|
||||
speakTTS(msg.msg)
|
||||
}
|
||||
if (msg.isViewShow){ //消息盒子显示内容
|
||||
OCHSocketMessageManager.pushAppOperationalMsgBox(
|
||||
DateTimeUtil.getCurrentTimeStamp(),msg.msg)
|
||||
val baseMsg = GsonUtils.fromJson(String(byteArray), BaseDPMsg::class.java)
|
||||
Logger.d(
|
||||
SceneConstant.M_BUS_P + TAG, "onReceivedMsg = " + GsonUtils.toJson(baseMsg)
|
||||
)
|
||||
|
||||
if (baseMsg != null && baseMsg.type == DPMsgType.TYPE_COMMON.type) {
|
||||
val msg = GsonUtils.fromJson(String(byteArray), AppConnectMsg::class.java)
|
||||
|
||||
if (msg != null && msg.isPlay){ //播报
|
||||
speakTTS(msg.msg)
|
||||
}
|
||||
|
||||
if (msg != null && msg.isViewShow) { //消息盒子显示内容
|
||||
pushAppOperationalMsgBox(
|
||||
DateTimeUtil.getCurrentTimeStamp(),msg.msg)
|
||||
}
|
||||
}else if (baseMsg != null && baseMsg.type == DPMsgType.TYPE_TASK_DETAILS.type) {
|
||||
val msg = GsonUtils.fromJson(String(byteArray), TaskDetailsMsg::class.java)
|
||||
Logger.d(
|
||||
SceneConstant.M_BUS_P + TAG, "onReceivedMsg = " + GsonUtils.toJson(msg)
|
||||
)
|
||||
if (msg == null || msg.msg?.isEmpty() == true) {
|
||||
updateLocalOrder()
|
||||
return
|
||||
}
|
||||
val result = GsonUtils.fromJson(msg.msg, BusTransferData::class.java)
|
||||
mDrivingInfoCallback?.changeOperationStatus(result.loginStatus == 1)
|
||||
if (result != null && result.routesResult == null){
|
||||
updateLocalOrder()
|
||||
}
|
||||
|
||||
if (routesResult == null ||
|
||||
(result != null && result.routesResult?.writeVersion!! > routesResult!!.writeVersion)) {
|
||||
routesResult = result.routesResult
|
||||
updatePassengerRouteInfo(routesResult!!)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -288,7 +334,8 @@ class PM2DrivingModel private constructor() {
|
||||
} else {
|
||||
ToastUtils.showShort(mContext!!.getString(R.string.request_error_tip))
|
||||
}
|
||||
queryDriverOperationDelay()
|
||||
// queryDriverOperationDelay()
|
||||
queryDriverByLocalDriver()
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String) {
|
||||
@@ -319,10 +366,27 @@ class PM2DrivingModel private constructor() {
|
||||
return
|
||||
}
|
||||
|
||||
routesResult = data.result
|
||||
if (routesResult != null &&
|
||||
routesResult!!.writeVersion < data.result.writeVersion
|
||||
) {
|
||||
routesResult = data.result
|
||||
}
|
||||
|
||||
if (routesResult == null) {
|
||||
routesResult = data.result
|
||||
}
|
||||
updatePassengerRouteInfo(data.result)
|
||||
}
|
||||
|
||||
override fun onError() {
|
||||
CallerLogger.d(
|
||||
SceneConstant.Companion.M_BUS_P + TAG,
|
||||
"queryDriverSiteByCoordinate = onError ="
|
||||
+ ", sn = " + driverAppSn
|
||||
)
|
||||
queryDriverByLocalDriver()
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String?) {
|
||||
d(SceneConstant.M_BUS_P+TAG, "queryDriverSiteByCoordinate = %s", msg)
|
||||
if (code == 1003){
|
||||
@@ -351,19 +415,27 @@ class PM2DrivingModel private constructor() {
|
||||
mDrivingInfoCallback?.showNoTaskView(true)
|
||||
}
|
||||
|
||||
private fun updatePassengerRouteInfo(result: PM2RoutesResult) {
|
||||
private fun updatePassengerRouteInfo(result: BusRoutesResult) {
|
||||
|
||||
if (result == null) {
|
||||
updateLocalOrder()
|
||||
return
|
||||
}
|
||||
|
||||
routesResult = result
|
||||
|
||||
mDrivingInfoCallback?.updateLine(result.name, result.runningDur)
|
||||
if (result.sites != null) {
|
||||
mDrivingInfoCallback?.showNoTaskView(false)
|
||||
val stations: List<PM2Station> = result.sites
|
||||
val stations: List<BusStationBean> = result.sites
|
||||
mStations.clear()
|
||||
mStations.addAll(stations)
|
||||
mDrivingInfoCallback?.updateLineStations(mStations)
|
||||
for (i in stations.indices) {
|
||||
val station: PM2Station = stations[i]
|
||||
val station: BusStationBean = stations[i]
|
||||
if (station.drivingStatus == BusPassengerConst.STATION_STATUS_STOPPED
|
||||
&& station.isLeaving && i + 1 < stations.size) {
|
||||
mDrivingInfoCallback?.updateStationsInfo(stations as MutableList<PM2Station>, i + 1, false)
|
||||
mDrivingInfoCallback?.updateStationsInfo(stations as MutableList<BusStationBean>, i + 1, false)
|
||||
if (mNextStationIndex != i + 1) {
|
||||
d(SceneConstant.M_BUS_P+TAG,"och-rotting--start ")
|
||||
mTwoStationsRouts.clear()
|
||||
@@ -376,7 +448,7 @@ class PM2DrivingModel private constructor() {
|
||||
mPreRouteIndex = 0
|
||||
isGoingToNextStation = false
|
||||
startOrStopCalculateRouteInfo(false)
|
||||
mDrivingInfoCallback?.updateStationsInfo(stations as MutableList<PM2Station>, i, true)
|
||||
mDrivingInfoCallback?.updateStationsInfo(stations as MutableList<BusStationBean>, i, true)
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -431,7 +503,7 @@ class PM2DrivingModel private constructor() {
|
||||
var lastSumLength = 0f
|
||||
lastSumLength = if (lastPoints.size == 1) { //只是最后一个点,计算当前位置和最后一个点的距离
|
||||
if (mNextStationIndex <= mStations.size - 1 && mNextStationIndex >= 0) {
|
||||
val stationNext: PM2Station = mStations[mNextStationIndex]
|
||||
val stationNext: BusStationBean = mStations[mNextStationIndex]
|
||||
CoordinateUtils.calculateLineDistance(
|
||||
stationNext.gcjLon, stationNext.gcjLat,
|
||||
mLocation!!.longitude, mLocation!!.latitude
|
||||
@@ -462,8 +534,8 @@ class PM2DrivingModel private constructor() {
|
||||
if (mStations.size > 1) { //两个站点及以上要计算两个站点间的轨迹路线
|
||||
if (mNextStationIndex <= mStations.size - 1 && mNextStationIndex - 1 >= 0) {
|
||||
mTwoStationsRouts.clear()
|
||||
val stationNext: PM2Station = mStations[mNextStationIndex]
|
||||
val stationCur: PM2Station = mStations[mNextStationIndex - 1]
|
||||
val stationNext: BusStationBean = mStations[mNextStationIndex]
|
||||
val stationCur: BusStationBean = mStations[mNextStationIndex - 1]
|
||||
//当前站在轨迹中对应的点
|
||||
val currentRouteIndex = CoordinateCalculateRouteUtil.getArrivedPointIndexNew(
|
||||
0, mRoutePoints, stationCur.gcjLon, stationCur.gcjLat
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.och.bus.passenger.presenter
|
||||
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import com.amap.api.maps.model.LatLng
|
||||
import com.mogo.commons.mvp.Presenter
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
@@ -11,6 +12,7 @@ import com.mogo.och.bus.passenger.callback.DrivingInfoCallback
|
||||
import com.mogo.och.bus.passenger.model.PM2ADASModel
|
||||
import com.mogo.och.bus.passenger.model.PM2DrivingModel
|
||||
import com.mogo.och.bus.passenger.ui.PM2DrivingInfoFragment
|
||||
import com.mogo.och.data.bean.BusStationBean
|
||||
|
||||
class PM2DrivingPresenter(view: PM2DrivingInfoFragment?) :
|
||||
Presenter<PM2DrivingInfoFragment?>(view), DrivingInfoCallback, AutoPilotStatusCallback {
|
||||
@@ -80,14 +82,35 @@ class PM2DrivingPresenter(view: PM2DrivingInfoFragment?) :
|
||||
}
|
||||
}
|
||||
|
||||
override fun updateLineStations(stations: MutableList<PM2Station>) {
|
||||
override fun updateLineStations(stations: MutableList<BusStationBean>) {
|
||||
|
||||
val stationsList = mutableListOf<LatLng>()
|
||||
val stationsListPass = mutableListOf<LatLng>()
|
||||
|
||||
for (i in stations.indices){
|
||||
val station = stations[i]
|
||||
val latLng = LatLng(station.gcjLat,station.gcjLon)
|
||||
if(station.drivingStatus==1){//行驶信息,0初始值;1已经过;2当前站;3未到站
|
||||
stationsListPass.add(latLng)
|
||||
}else if(station.drivingStatus==2){
|
||||
if(station.isLeaving){
|
||||
stationsListPass.add(latLng)
|
||||
}else{
|
||||
stationsList.add(latLng)
|
||||
}
|
||||
}else{
|
||||
stationsList.add(latLng)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ThreadUtils.runOnUiThread {
|
||||
mView?.updateLineStations(stations)
|
||||
mView?.updateLineStations(stationsList,stationsListPass)
|
||||
}
|
||||
PM2ADASModel.INSTANCE.updateHDMapStations(stations)
|
||||
}
|
||||
|
||||
override fun updateStationsInfo(stations: MutableList<PM2Station>, i: Int, isArrived: Boolean) {
|
||||
override fun updateStationsInfo(stations: MutableList<BusStationBean>, i: Int, isArrived: Boolean) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
mView?.updateStationsInfo(stations,i,isArrived)
|
||||
}
|
||||
|
||||
@@ -2,24 +2,21 @@ package com.mogo.och.bus.passenger.ui
|
||||
|
||||
import android.graphics.BitmapFactory
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.os.Message
|
||||
import android.view.View
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.amap.api.maps.model.LatLng
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.eagle.core.function.view.SiteMarkerBean
|
||||
import com.mogo.eagle.core.widget.media.video.TextureVideoViewOutlineProvider
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.bean.PM2Station
|
||||
import com.mogo.och.bus.passenger.presenter.PM2DrivingPresenter
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil.*
|
||||
import com.mogo.och.common.module.utils.NumberFormatUtil
|
||||
import com.mogo.och.data.bean.BusStationBean
|
||||
import kotlinx.android.synthetic.m2.p_m2_driving_info_fragment.*
|
||||
import java.lang.ref.WeakReference
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
import kotlin.math.ceil
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
@@ -53,6 +50,12 @@ class PM2DrivingInfoFragment :
|
||||
|
||||
line_name_tv.setTextColor(resources.getColor(R.color.m2_line_name_tv_color))
|
||||
station_name_tv.setTextColor(resources.getColor(R.color.m2_line_name_tv_color))
|
||||
speed_tv.setVertrial(true)
|
||||
val intArrayOf = intArrayOf(
|
||||
requireContext().resources.getColor(R.color.shuttle_color_43cefe),
|
||||
requireContext().resources.getColor(R.color.shuttle_color_1466fb)
|
||||
)
|
||||
speed_tv.setmColorList(intArrayOf)
|
||||
|
||||
// current_time_tv.onClick {
|
||||
|
||||
@@ -77,13 +80,15 @@ class PM2DrivingInfoFragment :
|
||||
// )
|
||||
// BPRouteDataTestUtils.converToRouteData()
|
||||
// }
|
||||
updateCurrentTime()
|
||||
}
|
||||
|
||||
override fun initViews(savedInstanceState: Bundle?) {
|
||||
super.initViews(savedInstanceState)
|
||||
overMapView?.let {
|
||||
it.onCreateView(savedInstanceState)
|
||||
val radius = AutoSizeUtils.dp2px(requireContext(), 38f)
|
||||
it.outlineProvider = TextureVideoViewOutlineProvider(radius.toFloat())
|
||||
it.clipToOutline = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,18 +130,6 @@ class PM2DrivingInfoFragment :
|
||||
line_during_tv.text = time
|
||||
}
|
||||
|
||||
private fun updateCurrentTime(){
|
||||
current_time_tv.text = formatCalendarToString(
|
||||
DateTimeUtils.getCurrentDateTime(),HH_mm)
|
||||
|
||||
val date = formatCalendarToString(
|
||||
DateTimeUtils.getCurrentDateTime(), yy_MM_dd)
|
||||
val weekDay = DateTimeUtils.getWeekDayFromCalendar1(DateTimeUtils.getCurrentDateTime())
|
||||
"$date $weekDay".also { current_weekday_tv.text = it }
|
||||
|
||||
sendUpdateTimeTask() // 每10s更新一次
|
||||
}
|
||||
|
||||
fun changeOperationStatus(status:Boolean){
|
||||
if (!status){
|
||||
updateNoOrderUI()
|
||||
@@ -149,18 +142,14 @@ class PM2DrivingInfoFragment :
|
||||
|
||||
private fun setLineInfoView(isShow: Boolean){
|
||||
if (isShow){
|
||||
line_name_tv.visibility = View.VISIBLE
|
||||
line_during_tv.visibility = View.VISIBLE
|
||||
no_line_tv.visibility = View.GONE
|
||||
|
||||
}else{
|
||||
updateNoOrderUI()
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateNoOrderUI() {
|
||||
line_name_tv.visibility = View.GONE
|
||||
line_during_tv.visibility = View.GONE
|
||||
no_line_tv.visibility = View.VISIBLE
|
||||
line_name_tv.text = resources.getString(R.string.m2_p_not_select_line_content)
|
||||
updateNoStationView()
|
||||
overMapView?.let {
|
||||
it.clearSiteMarkers()
|
||||
@@ -172,9 +161,10 @@ class PM2DrivingInfoFragment :
|
||||
|
||||
private fun updateNoStationView(){
|
||||
station_name_tv.setTextColor(resources.getColor(R.color.m2_next_tv_color))
|
||||
station_name_title_tv.text = resources.getString(R.string.m2_p_station_title_tv)
|
||||
station_name_tv.text = resources.getString(R.string.m2_p_empty_tv)
|
||||
remain_mt.text = resources.getString(R.string.m2_p_empty_remain_km_minute)
|
||||
tv_distance.text = resources.getString(R.string.m2_p_empty_remain_km)
|
||||
tv_left_time.text = resources.getString(R.string.m2_p_empty_remain_minute)
|
||||
noLineShow()
|
||||
}
|
||||
|
||||
override fun createPresenter(): PM2DrivingPresenter {
|
||||
@@ -191,30 +181,35 @@ class PM2DrivingInfoFragment :
|
||||
}
|
||||
}
|
||||
|
||||
fun updateLineStations(stations: MutableList<PM2Station>){
|
||||
var stationsList = mutableListOf<LatLng>()
|
||||
for (i in stations.indices){
|
||||
val station = stations[i]
|
||||
var latLng = LatLng(station.gcjLat,station.gcjLon)
|
||||
stationsList.add(latLng)
|
||||
}
|
||||
fun updateLineStations(stations: MutableList<LatLng>,stationsPass: MutableList<LatLng>){
|
||||
overMapView?.let {
|
||||
it.drawSiteMarkers(stationsList,
|
||||
BitmapFactory.decodeResource(resources,R.drawable.m2_map_staton_icon),0.5f,0.9f)
|
||||
val stationsList: MutableList<SiteMarkerBean> = mutableListOf()
|
||||
val stationIcon = BitmapFactory.decodeResource(resources, R.drawable.m2_map_staton_icon)
|
||||
val stationPassIcon = BitmapFactory.decodeResource(resources, R.drawable.m2_map_staton_arrived_icon)
|
||||
for (stationsPass in stationsPass) {
|
||||
stationsList.add(SiteMarkerBean(stationsPass,stationPassIcon,0.5f,0.5f))
|
||||
}
|
||||
for (stationsPass in stations) {
|
||||
stationsList.add(SiteMarkerBean(stationsPass,stationIcon,0.5f,0.5f))
|
||||
}
|
||||
it.drawSiteMarkers(stationsList)
|
||||
}
|
||||
}
|
||||
|
||||
fun updateStationsInfo(stations: MutableList<PM2Station>, i: Int, isArrived: Boolean){
|
||||
fun updateStationsInfo(stations: MutableList<BusStationBean>, i: Int, isArrived: Boolean){
|
||||
if (stations.size == 0) return
|
||||
if (0<= i && i<stations.size){
|
||||
station_name_tv.setTextColor(resources.getColor(R.color.m2_next_tv_color))
|
||||
station_name_tv.text = stations[i].name
|
||||
}
|
||||
if (isArrived){//到站
|
||||
station_name_title_tv.text = resources.getString(R.string.m2_p_station_title_arrived_tv)
|
||||
remain_mt.text = resources.getString(R.string.m2_p_empty_remain_km_minute)
|
||||
tv_distance.text = resources.getString(R.string.m2_p_empty_remain_km)
|
||||
tv_left_time.text = resources.getString(R.string.m2_p_empty_remain_minute)
|
||||
tv_next_station_title.text = resources.getString(R.string.m2_p_station_title_arrived_tv)
|
||||
haveLineAndArrivedStation()
|
||||
}else{ //前往目的地中
|
||||
station_name_title_tv.text = resources.getString(R.string.m2_p_station_title_tv)
|
||||
tv_next_station_title.text = resources.getString(R.string.shuttle_p_next_station_title)
|
||||
haveLineAndArriveingStation()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,13 +232,33 @@ class PM2DrivingInfoFragment :
|
||||
|
||||
val time = ceil(timeInSecond / 60f).toInt()
|
||||
|
||||
"$remainDis$disUnit | $time 分钟".also { remain_mt.text = it }
|
||||
"$remainDis$disUnit".also { tv_distance.text = it }
|
||||
"$time 分钟".also { tv_left_time.text = it }
|
||||
}
|
||||
|
||||
private fun sendUpdateTimeTask() {
|
||||
UiThreadHandler.postDelayed({
|
||||
updateCurrentTime()
|
||||
},LOOP_TIME_TEXT)
|
||||
fun noLineShow(){
|
||||
// 没有线路展示
|
||||
group_not_select_line.visibility = View.VISIBLE
|
||||
// 下一个站点
|
||||
group_stationinfo.visibility = View.GONE
|
||||
// 距离和剩余大概时间
|
||||
clg_distance_left_time.visibility = View.GONE
|
||||
// 到达站点
|
||||
tv_arrived_notice.visibility = View.GONE
|
||||
}
|
||||
// 有线路正在到站点
|
||||
fun haveLineAndArriveingStation(){
|
||||
group_not_select_line.visibility = View.GONE
|
||||
group_stationinfo.visibility = View.VISIBLE
|
||||
clg_distance_left_time.visibility = View.VISIBLE
|
||||
tv_arrived_notice.visibility = View.GONE
|
||||
}
|
||||
// 有线路到达站点
|
||||
fun haveLineAndArrivedStation(){
|
||||
group_not_select_line.visibility = View.GONE
|
||||
group_stationinfo.visibility = View.VISIBLE
|
||||
clg_distance_left_time.visibility = View.GONE
|
||||
tv_arrived_notice.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
|
After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 973 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1018 B |
|
After Width: | Height: | Size: 276 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 818 B |
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="@dimen/dp_24" />
|
||||
<solid android:color="@color/shuttle_color_b9e7c0"/>
|
||||
</shape>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="@dimen/dp_24" />
|
||||
<solid android:color="@color/shuttle_color_99afc9e7"/>
|
||||
</shape>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:bottomLeftRadius="@dimen/dp_38"
|
||||
android:topLeftRadius="@dimen/dp_38"/>
|
||||
<gradient android:startColor="@android:color/white"
|
||||
android:endColor="@color/shuttle_color_c8efff"
|
||||
android:angle="315"
|
||||
/>
|
||||
</shape>
|
||||
@@ -2,234 +2,354 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_driving_selector">
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<!-- 全览地图带站点-->
|
||||
<com.mogo.eagle.core.function.view.OverMapView
|
||||
android:id="@+id/overMapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:mapStyleExtraPath="@string/m2_over_map_style_extra_path"
|
||||
app:mapStylePath="@string/m2_over_map_style_path"
|
||||
app:isClearArrived="true"
|
||||
app:resetDrawableMarginRight="@dimen/dp_34"
|
||||
app:resetDrawableMarginBottom="@dimen/dp_54"
|
||||
app:carDrawable = "@drawable/m2_map_car_icon"
|
||||
app:startPointDrawable="@drawable/m2_map_start_icon"
|
||||
app:endPointDrawable="@drawable/m2_map_end_icon"
|
||||
app:leftPadding="400"
|
||||
/>
|
||||
<!-- 全览地图带站点-->
|
||||
<com.mogo.eagle.core.function.view.OverMapView
|
||||
android:id="@+id/overMapView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
app:carDrawable="@drawable/m2_map_car_icon"
|
||||
app:endPointDrawable="@drawable/m2_map_end_icon"
|
||||
app:isClearArrived="true"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintWidth_percent="0.6"
|
||||
app:mapStyleExtraPath="@string/m2_over_map_style_extra_path"
|
||||
app:mapStylePath="@string/m2_over_map_style_path"
|
||||
app:resetDrawableMarginBottom="@dimen/dp_54"
|
||||
app:resetDrawableMarginRight="@dimen/dp_34"
|
||||
app:startPointDrawable="@drawable/m2_map_start_icon" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/img_drive_bg"
|
||||
android:layout_width="@dimen/dp_350"
|
||||
android:layout_height="@dimen/dp_210"
|
||||
android:layout_marginTop="@dimen/dp_36"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/img_drive_bg"/>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_left_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_driving_info"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintWidth_percent="0.5">
|
||||
|
||||
<!-- 行车卡片-->
|
||||
<TextView
|
||||
android:id="@+id/speed_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textColor="@color/m2_p_speed_tv_color"
|
||||
android:textSize="@dimen/dp_56"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="@dimen/dp_36"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/img_drive_bg"
|
||||
android:layout_marginLeft="@dimen/dp_48"
|
||||
app:layout_constraintTop_toTopOf="@+id/img_drive_bg"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_12"
|
||||
android:textSize="@dimen/dp_18"
|
||||
android:textColor="@color/m2_line_during_tv_color"
|
||||
android:text="@string/m2_p_speed_unit_txt"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/speed_tv"
|
||||
app:layout_constraintLeft_toRightOf="@+id/speed_tv" />
|
||||
<ImageView
|
||||
android:id="@+id/iv_line_name_container"
|
||||
android:layout_width="@dimen/dp_661"
|
||||
android:layout_height="@dimen/dp_95"
|
||||
android:src="@drawable/shuttle_p_line_name"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/auto_tv"
|
||||
android:layout_width="@dimen/dp_66"
|
||||
android:layout_height="@dimen/dp_38"
|
||||
android:background="@drawable/bg_p_m2_auto"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:text="@string/m2_p_auto_tv"
|
||||
android:textSize="@dimen/dp_18"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/m2_button_auto_tv_color"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/speed_tv"
|
||||
app:layout_constraintTop_toBottomOf="@+id/speed_tv" />
|
||||
<ImageView
|
||||
android:id="@+id/iv_line_icon"
|
||||
android:layout_width="@dimen/dp_26"
|
||||
android:layout_height="@dimen/dp_26"
|
||||
android:layout_marginEnd="@dimen/dp_14"
|
||||
android:src="@drawable/shuttle_p_line_tile"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/line_name_tv"
|
||||
app:layout_constraintEnd_toStartOf="@+id/line_name_tv"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_line_name_container"
|
||||
app:layout_constraintTop_toTopOf="@+id/line_name_tv" />
|
||||
|
||||
<!-- 转向灯 IMoGoChassisLamplightListener-->
|
||||
<com.mogo.och.bus.passenger.ui.widget.M2TurnLightView
|
||||
android:id="@+id/turn_light_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_12"
|
||||
app:layout_constraintLeft_toRightOf="@+id/auto_tv"
|
||||
app:layout_constraintTop_toTopOf="@+id/auto_tv"
|
||||
app:visible="true"
|
||||
app:day_light_mode="true"/>
|
||||
|
||||
<!-- 红绿灯-->
|
||||
<com.mogo.och.bus.passenger.ui.widget.M2PTrafficLightView
|
||||
android:id="@+id/traffic_light_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_12"
|
||||
app:layout_constraintLeft_toRightOf="@+id/turn_light_view"
|
||||
app:layout_constraintTop_toTopOf="@+id/auto_tv" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/img_line_bg"
|
||||
android:layout_width="@dimen/dp_350"
|
||||
android:layout_height="@dimen/dp_210"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
app:layout_constraintTop_toBottomOf="@+id/auto_tv"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/img_drive_bg"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/img_line_bg"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/img_line_location_bg"
|
||||
android:layout_width="@dimen/dp_77"
|
||||
android:layout_height="@dimen/dp_96"
|
||||
android:layout_marginRight="@dimen/dp_60"
|
||||
android:scaleType="fitXY"
|
||||
app:layout_constraintTop_toTopOf="@+id/img_line_bg"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/img_line_bg"
|
||||
app:layout_constraintRight_toRightOf="@+id/img_line_bg"
|
||||
android:src="@drawable/m2_line_location_bg"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/station_name_title_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/m2_p_station_title_tv"
|
||||
android:textSize="@dimen/dp_18"
|
||||
app:layout_constraintTop_toTopOf="@+id/img_line_location_bg"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/speed_tv"
|
||||
android:textColor="@color/m2_next_tv_color"/>
|
||||
|
||||
<com.mogo.och.common.module.wigets.MarqueeTextView
|
||||
android:id="@+id/station_name_tv"
|
||||
android:layout_width="@dimen/dp_240"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
app:customGap="0.2"
|
||||
app:useCustomGap="true"
|
||||
android:text="@string/m2_p_empty_tv"
|
||||
android:textSize="@dimen/dp_22"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
app:layout_constraintTop_toBottomOf="@+id/station_name_title_tv"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/speed_tv"
|
||||
android:textColor="@color/m2_line_name_tv_color"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/remain_mt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/m2_p_empty_remain_km_minute"
|
||||
android:textSize="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/img_line_location_bg"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/speed_tv"
|
||||
android:textColor="@color/m2_next_tv_color"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/img_time_bg"
|
||||
android:layout_width="@dimen/dp_350"
|
||||
android:layout_height="@dimen/dp_210"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
app:layout_constraintTop_toBottomOf="@+id/remain_mt"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/img_drive_bg"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/img_time_bg"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/dashed_line"
|
||||
android:layout_width="@dimen/dp_251"
|
||||
android:layout_height="@dimen/dp_10"
|
||||
android:background="@drawable/bg_dashed_line"
|
||||
android:layout_marginTop="@dimen/dp_104"
|
||||
app:layout_constraintTop_toTopOf="@+id/img_time_bg"
|
||||
app:layout_constraintStart_toStartOf="@+id/speed_tv"
|
||||
app:layout_constraintEnd_toEndOf="@+id/img_line_location_bg"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/no_line_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
android:text="@string/m2_p_no_line"
|
||||
android:textSize="@dimen/dp_22"
|
||||
android:layout_marginTop="@dimen/dp_28"
|
||||
app:layout_constraintTop_toTopOf="@+id/img_time_bg"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/dashed_line"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/speed_tv"
|
||||
android:textColor="@color/m2_next_tv_color"/>
|
||||
<com.mogo.och.common.module.wigets.MarqueeTextView
|
||||
android:id="@+id/line_name_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:ellipsize="marquee"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:maxWidth="@dimen/dp_600"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/m2_line_name_tv_color"
|
||||
android:textSize="@dimen/dp_26"
|
||||
android:textStyle="bold"
|
||||
app:customGap="0.2"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_line_name_container"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_line_icon"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_line_name_container"
|
||||
app:useCustomGap="true" />
|
||||
|
||||
|
||||
<com.mogo.och.common.module.wigets.MarqueeTextView
|
||||
android:id="@+id/line_name_tv"
|
||||
android:layout_width="@dimen/dp_240"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
app:customGap="0.2"
|
||||
app:useCustomGap="true"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:textSize="@dimen/dp_22"
|
||||
app:layout_constraintTop_toTopOf="@+id/img_time_bg"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/speed_tv"
|
||||
android:textColor="@color/m2_line_name_tv_color"/>
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/group_not_select_line"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="visible"
|
||||
app:constraint_referenced_ids="aciv_not_select_line,m2_p_not_select_line_content" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/line_during_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:textSize="@dimen/dp_16"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/line_name_tv"
|
||||
app:layout_constraintTop_toBottomOf="@+id/line_name_tv"
|
||||
android:textColor="@color/m2_line_during_tv_color"/>
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/aciv_not_select_line"
|
||||
android:layout_width="@dimen/dp_100"
|
||||
android:layout_height="@dimen/dp_105"
|
||||
app:layout_constraintStart_toStartOf="@+id/m2_p_not_select_line_content"
|
||||
app:layout_constraintEnd_toEndOf="@+id/m2_p_not_select_line_content"
|
||||
app:layout_constraintBottom_toTopOf="@+id/m2_p_not_select_line_content"
|
||||
android:layout_marginBottom="@dimen/dp_14"
|
||||
android:src="@drawable/shuttle_p_line_noselect" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/current_time_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/dp_36"
|
||||
android:textStyle="bold"
|
||||
android:text="--"
|
||||
app:layout_constraintTop_toBottomOf="@+id/dashed_line"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/speed_tv"
|
||||
android:textColor="@color/m2_current_time_tv_color"/>
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/m2_p_not_select_line_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/m2_p_not_select_line_content"
|
||||
android:textColor="@color/m2_line_during_tv_color"
|
||||
android:textSize="@dimen/dp_18"
|
||||
android:layout_marginBottom="@dimen/dp_43"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/cl_left_container"
|
||||
app:layout_constraintBottom_toTopOf="@+id/aciv_speed_time_bg"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/current_weekday_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
app:layout_constraintLeft_toRightOf="@+id/current_time_tv"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/current_time_tv"
|
||||
android:layout_marginBottom="@dimen/dp_6"
|
||||
android:textSize="@dimen/dp_16"
|
||||
android:text="--"
|
||||
android:textColor="@color/m2_text_time_tv_color"/>
|
||||
<!-- region 站点信息 -->
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/group_stationinfo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="bg_distance_lefttime,bg_distance_lefttime_split,tv_distance,tv_left_time,tv_next_station_title,station_name_tv" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_next_station_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_50"
|
||||
android:layout_marginTop="@dimen/dp_96"
|
||||
android:text="@string/shuttle_p_next_station_title"
|
||||
android:textColor="@color/shuttle_color_203555"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.mogo.och.common.module.wigets.MarqueeTextView
|
||||
android:id="@+id/station_name_tv"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_18"
|
||||
android:ellipsize="marquee"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:gravity="left"
|
||||
android:singleLine="true"
|
||||
android:text="@string/m2_p_empty_tv"
|
||||
android:textColor="@color/shuttle_color_17417B"
|
||||
android:textSize="@dimen/dp_34"
|
||||
android:textStyle="bold"
|
||||
app:customGap="0.2"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_next_station_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_next_station_title"
|
||||
app:layout_constraintEnd_toEndOf="@+id/cl_left_container"
|
||||
app:useCustomGap="true" />
|
||||
|
||||
<!-- region 到下一站距离和时间 -->
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/clg_distance_left_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="bg_distance_lefttime,bg_distance_lefttime_split,tv_distance,tv_left_time" />
|
||||
|
||||
<View
|
||||
android:id="@+id/bg_distance_lefttime"
|
||||
android:layout_width="@dimen/dp_182"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_marginTop="@dimen/dp_22"
|
||||
android:background="@drawable/bg_driving_distance_lefttime"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_next_station_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/station_name_tv" />
|
||||
|
||||
<View
|
||||
android:id="@+id/bg_distance_lefttime_split"
|
||||
android:layout_width="@dimen/dp_1"
|
||||
android:layout_height="@dimen/dp_23"
|
||||
android:background="@color/shuttle_color_6617417B"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bg_distance_lefttime"
|
||||
app:layout_constraintEnd_toEndOf="@+id/bg_distance_lefttime"
|
||||
app:layout_constraintStart_toStartOf="@+id/bg_distance_lefttime"
|
||||
app:layout_constraintTop_toTopOf="@+id/bg_distance_lefttime" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_distance"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textColor="@color/shuttle_color_2d3e5f"
|
||||
android:textSize="@dimen/dp_20"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bg_distance_lefttime"
|
||||
app:layout_constraintEnd_toStartOf="@+id/bg_distance_lefttime_split"
|
||||
app:layout_constraintStart_toStartOf="@+id/bg_distance_lefttime"
|
||||
app:layout_constraintTop_toTopOf="@+id/bg_distance_lefttime" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_left_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textColor="@color/shuttle_color_2d3e5f"
|
||||
android:textSize="@dimen/dp_20"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bg_distance_lefttime"
|
||||
app:layout_constraintEnd_toEndOf="@+id/bg_distance_lefttime"
|
||||
app:layout_constraintStart_toEndOf="@+id/bg_distance_lefttime_split"
|
||||
app:layout_constraintTop_toTopOf="@+id/bg_distance_lefttime" />
|
||||
|
||||
<!-- endregion -->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_arrived_notice"
|
||||
android:layout_width="@dimen/dp_147"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:background="@drawable/bg_driving_arrived_notice"
|
||||
android:gravity="center"
|
||||
android:text="@string/m2_p_arrived_station_title"
|
||||
android:textColor="@color/shuttle_color_1f860d"
|
||||
android:layout_marginTop="@dimen/dp_22"
|
||||
android:textSize="@dimen/dp_18"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_next_station_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/station_name_tv" />
|
||||
|
||||
<!-- endregion -->
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/aciv_speed_time_bg"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_181"
|
||||
android:src="@drawable/shuttle_p_card_split"
|
||||
app:layout_constraintEnd_toEndOf="@+id/cl_left_container"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
|
||||
<!-- 行车卡片-->
|
||||
<com.mogo.och.common.module.wigets.OCHGradientTextView
|
||||
android:id="@+id/speed_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_50"
|
||||
android:layout_marginTop="@dimen/dp_27"
|
||||
android:text="0"
|
||||
android:textColor="@color/m2_p_speed_tv_color"
|
||||
android:textSize="@dimen/dp_60"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="@+id/aciv_speed_time_bg"
|
||||
app:layout_constraintTop_toTopOf="@+id/aciv_speed_time_bg" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_speed_unit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_8"
|
||||
android:text="@string/m2_p_speed_unit_txt"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/speed_tv"
|
||||
android:textColor="@color/m2_line_during_tv_color"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/speed_tv"
|
||||
android:textSize="@dimen/dp_18"
|
||||
app:layout_constraintStart_toEndOf="@+id/speed_tv" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/auto_tv"
|
||||
android:layout_width="@dimen/dp_66"
|
||||
android:layout_height="@dimen/dp_38"
|
||||
android:layout_marginTop="@dimen/dp_21"
|
||||
android:background="@drawable/bg_p_m2_auto"
|
||||
android:gravity="center"
|
||||
android:text="@string/m2_p_auto_tv"
|
||||
android:textColor="@color/m2_button_auto_tv_color"
|
||||
android:layout_marginBottom="@dimen/dp_34"
|
||||
android:textSize="@dimen/dp_18"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/speed_tv"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<!-- 转向灯 IMoGoChassisLamplightListener-->
|
||||
<com.mogo.och.bus.passenger.ui.widget.M2TurnLightView
|
||||
android:id="@+id/turn_light_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_12"
|
||||
app:day_light_mode="true"
|
||||
app:layout_constraintLeft_toRightOf="@+id/auto_tv"
|
||||
app:layout_constraintTop_toTopOf="@+id/auto_tv"
|
||||
app:visible="true" />
|
||||
|
||||
<!-- 红绿灯-->
|
||||
<!-- <com.mogo.och.bus.passenger.ui.widget.M2PTrafficLightView-->
|
||||
<!-- android:id="@+id/traffic_light_view"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginLeft="@dimen/dp_12"-->
|
||||
<!-- app:layout_constraintLeft_toRightOf="@+id/turn_light_view"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="@+id/auto_tv" />-->
|
||||
|
||||
<!-- 被删除的 -->
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/line_during_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:textColor="@color/m2_line_during_tv_color"
|
||||
android:textSize="@dimen/dp_16"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/line_name_tv"
|
||||
app:layout_constraintTop_toBottomOf="@+id/line_name_tv" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_split"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
app:layout_constraintTop_toTopOf="@+id/aciv_speed_time_bg"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/turn_light_view"
|
||||
app:layout_constraintStart_toStartOf="@+id/aciv_speed_time_bg"
|
||||
app:layout_constraintEnd_toEndOf="@+id/aciv_speed_time_bg"
|
||||
android:background="@color/shuttle_color_6617417B"
|
||||
android:layout_width="@dimen/dp_1"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
<TextClock
|
||||
android:layout_marginStart="@dimen/dp_21"
|
||||
android:id="@+id/viewTextClockHouerMin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:format12Hour="HH:mm"
|
||||
android:format24Hour="HH:mm"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="@dimen/dp_25"
|
||||
app:layout_constraintTop_toTopOf="@+id/aciv_speed_time_bg"
|
||||
app:layout_constraintStart_toEndOf="@+id/view_split"
|
||||
android:layout_marginEnd="@dimen/dp_90"
|
||||
android:textColor="@color/shuttle_color_17417B"
|
||||
android:includeFontPadding="false"
|
||||
android:textSize="@dimen/dp_46" />
|
||||
|
||||
<TextClock
|
||||
android:layout_marginStart="@dimen/dp_21"
|
||||
android:id="@+id/viewTextClockDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:format12Hour="yyyy年MM月dd日"
|
||||
android:format24Hour="yyyy年MM月dd日"
|
||||
android:gravity="center"
|
||||
app:layout_constraintBottom_toTopOf="@+id/viewTextClockWeek"
|
||||
app:layout_constraintStart_toEndOf="@+id/view_split"
|
||||
android:layout_marginEnd="@dimen/dp_90"
|
||||
android:textColor="@color/shuttle_color_17417B"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:includeFontPadding="false"
|
||||
android:textSize="@dimen/dp_18" />
|
||||
|
||||
|
||||
<TextClock
|
||||
android:layout_marginStart="@dimen/dp_21"
|
||||
android:id="@+id/viewTextClockWeek"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:format12Hour="EEEE"
|
||||
android:format24Hour="EEEE"
|
||||
android:gravity="center"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/view_split"
|
||||
app:layout_constraintStart_toEndOf="@+id/view_split"
|
||||
android:layout_marginEnd="@dimen/dp_90"
|
||||
android:textColor="@color/shuttle_color_17417B"
|
||||
android:includeFontPadding="false"
|
||||
android:textSize="@dimen/dp_18" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -2,28 +2,68 @@
|
||||
<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:background="@android:color/white"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<!-- 行车卡片--><!-- 全览地图带站点-->
|
||||
<FrameLayout
|
||||
android:id="@+id/driving_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintHeight_percent="0.295"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/hd_map_fragment"
|
||||
app:layout_constraintLeft_toLeftOf="parent"/>
|
||||
|
||||
<!-- 高精地图-->
|
||||
<FrameLayout
|
||||
android:id="@+id/hd_map_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintHeight_percent="0.415"
|
||||
app:layout_constraintTop_toBottomOf="@+id/driving_fragment"
|
||||
app:layout_constraintBottom_toTopOf="@+id/video_fragment"
|
||||
app:layout_constraintTop_toBottomOf="@+id/och_shadow_layout"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"/>
|
||||
|
||||
<ImageView
|
||||
android:src="@drawable/m2_sky_bg"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="1080dp"
|
||||
android:layout_height="@dimen/dp_612"/>
|
||||
<ImageView
|
||||
android:src="@drawable/m2_bottom_bg"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="1080dp"
|
||||
android:layout_height="@dimen/dp_563"/>
|
||||
|
||||
|
||||
|
||||
<com.mogo.och.common.module.wigets.OCHBorderShadowLayout
|
||||
android:id="@+id/och_shadow_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_520"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_61"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_marginEnd="@dimen/dp_20"
|
||||
app:blurRadius="@dimen/dp_20"
|
||||
app:shadowColor="#80000000"
|
||||
app:shadowRadius="@dimen/dp_38"
|
||||
app:shadow_position="outer"
|
||||
app:xOffset="0dp"
|
||||
app:yOffset="0dp"/>
|
||||
|
||||
<!-- 行车卡片--><!-- 全览地图带站点-->
|
||||
<FrameLayout
|
||||
android:id="@+id/driving_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginStart="@dimen/dp_40"
|
||||
android:layout_marginEnd="@dimen/dp_40"
|
||||
android:layout_marginBottom="@dimen/dp_20"
|
||||
android:layout_height="@dimen/dp_480"
|
||||
app:layout_constraintTop_toTopOf="@+id/och_shadow_layout"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/och_shadow_layout"
|
||||
app:layout_constraintEnd_toEndOf="@+id/och_shadow_layout"
|
||||
app:layout_constraintStart_toStartOf="@+id/och_shadow_layout"/>
|
||||
|
||||
|
||||
<!-- 图片或视频广告-->
|
||||
|
||||
@@ -31,8 +71,10 @@
|
||||
android:id="@+id/video_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:paddingBottom="@dimen/dp_40"
|
||||
android:paddingEnd="@dimen/dp_40"
|
||||
android:paddingStart="@dimen/dp_40"
|
||||
app:layout_constraintHeight_percent="0.290"
|
||||
app:layout_constraintTop_toBottomOf="@+id/hd_map_fragment"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"/>
|
||||
|
||||
|
||||
@@ -23,4 +23,16 @@
|
||||
<color name="bus_traffic_light_yellow_color_down">#FFFF9B00</color>
|
||||
<color name="bus_arrived_btn_un_clickable_color">#59FFFFFF</color>
|
||||
<color name="bus_dashed_line_color">#8895B7</color>
|
||||
|
||||
|
||||
<color name="shuttle_color_c8efff">#C8EFFF</color>
|
||||
<color name="shuttle_color_203555">#203555</color>
|
||||
<color name="shuttle_color_99afc9e7">#99AFC9E7</color>
|
||||
<color name="shuttle_color_6617417B">#6617417B</color>
|
||||
<color name="shuttle_color_17417B">#17417B</color>
|
||||
<color name="shuttle_color_2d3e5f">#2D3E5F</color>
|
||||
<color name="shuttle_color_1f860d">#1F860D</color>
|
||||
<color name="shuttle_color_b9e7c0">#B9E7C0</color>
|
||||
<color name="shuttle_color_43cefe">#43CEFE</color>
|
||||
<color name="shuttle_color_1466fb">#1466FB</color>
|
||||
</resources>
|
||||
@@ -15,9 +15,15 @@
|
||||
<string name="m2_over_map_style_extra_path">m2_map_style_extra.data</string>
|
||||
<string name="m2_p_auto_tv">Auto</string>
|
||||
<string name="m2_p_station_title_tv">下一站:</string>
|
||||
<string name="m2_p_station_title_arrived_tv">已到站:</string>
|
||||
<string name="m2_p_station_title_arrived_tv">已到站</string>
|
||||
<string name="m2_p_empty_tv">暂无站点</string>
|
||||
<string name="m2_p_empty_remain_km_minute">—公里 | —分钟</string>
|
||||
<string name="shuttle_p_next_station_title">前方到站</string>
|
||||
<string name="m2_p_empty_remain_km">—公里</string>
|
||||
<string name="m2_p_empty_remain_minute">—分钟</string>
|
||||
<string name="m2_p_arrived_station_title">请按秩序下车</string>
|
||||
<string name="m2_p_not_select_line_content">路线加载中…</string>
|
||||
|
||||
|
||||
|
||||
</resources>
|
||||
@@ -56,6 +56,7 @@ dependencies {
|
||||
compileOnly rootProject.ext.dependencies.recyclerviewadapterhelper
|
||||
|
||||
implementation project(":OCH:mogo-och-common-module")
|
||||
implementation project(":OCH:mogo-och-data")
|
||||
compileOnly project(":libraries:mogo-map")
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.och.bus.bean;
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil;
|
||||
|
||||
/**
|
||||
* 中止/结束任务请求
|
||||
@@ -9,9 +10,11 @@ public class BusCloseTaskRequest {
|
||||
|
||||
private String sn;
|
||||
private int taskId;
|
||||
private long writeVersion;
|
||||
public BusCloseTaskRequest(int taskId) {
|
||||
this.sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
this.taskId = taskId;
|
||||
this.writeVersion = DateTimeUtil.getCurrentTimeStamp();
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.och.bus.bean;
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
@@ -9,9 +10,11 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
public class BusResetDrivingLineRequest {
|
||||
public String sn;
|
||||
public int taskId; //切换到的线路id
|
||||
public long writeVersion; //更新时间戳
|
||||
|
||||
public BusResetDrivingLineRequest(int taskId) {
|
||||
this.sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
this.taskId = taskId;
|
||||
this.writeVersion = DateTimeUtil.getCurrentTimeStamp();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.och.bus.bean;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.och.data.bean.BusRoutesResult;
|
||||
|
||||
/**
|
||||
* 网约车小巴路线接口请求响应结果
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.och.bus.bean;
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -14,11 +15,13 @@ public class BusUpdateSiteStatusRequest {
|
||||
public int taskId;
|
||||
public int seq;//站点序号
|
||||
public int siteId;//站点id
|
||||
public long writeVersion; //更新时间戳
|
||||
|
||||
public BusUpdateSiteStatusRequest(int taskId,int siteId,int seq) {
|
||||
this.sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
this.seq = seq;
|
||||
this.siteId = siteId;
|
||||
this.taskId = taskId;
|
||||
this.writeVersion = DateTimeUtil.getCurrentTimeStamp();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.och.bus.callback;
|
||||
|
||||
import com.mogo.och.bus.bean.BusStationBean;
|
||||
import com.mogo.och.data.bean.BusStationBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -36,16 +36,14 @@ import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView;
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView;
|
||||
import com.mogo.eagle.core.function.smp.view.SmallMapView;
|
||||
import com.mogo.eagle.core.function.view.MapBizView;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.MogoMapUIController;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.listener.MogoMapListenerHandler;
|
||||
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.data.bean.BusRoutesResult;
|
||||
import com.mogo.och.bus.model.OrderModel;
|
||||
import com.mogo.och.bus.util.BDRouteDataTestUtils;
|
||||
import com.mogo.och.bus.view.SlidePanelView;
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.och.bus.R;
|
||||
import com.mogo.och.bus.bean.BusStationBean;
|
||||
import com.mogo.och.data.bean.BusStationBean;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
import com.mogo.och.bus.net.login.LoginBusImpl;
|
||||
import com.mogo.och.bus.presenter.BusPresenter;
|
||||
|
||||
@@ -16,6 +16,8 @@ import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.elegant.network.utils.GsonUtil;
|
||||
import com.mogo.aicloud.services.socket.IMogoOnMessageListener;
|
||||
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener;
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.util.CoordinateUtils;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
||||
@@ -26,7 +28,13 @@ import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.och.bus.bean.BusRoutesResponse;
|
||||
import com.mogo.och.bus.bean.BusStationBean;
|
||||
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.bean.dpmsg.TaskDetailsMsg;
|
||||
import com.mogo.och.common.module.biz.constant.LoginStatusManager;
|
||||
import com.mogo.och.data.bean.BusStationBean;
|
||||
import com.mogo.och.common.module.biz.common.socketmessage.data.SystemMsg;
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
@@ -44,7 +52,7 @@ import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.och.bus.R;
|
||||
import com.mogo.och.bus.bean.BusRoutePlanningUpdateReqBean;
|
||||
import com.mogo.och.bus.bean.BusRoutesResult;
|
||||
import com.mogo.och.data.bean.BusRoutesResult;
|
||||
import com.mogo.och.bus.bean.WriteOffPassenger;
|
||||
import com.mogo.och.bus.callback.IBusADASStatusCallback;
|
||||
import com.mogo.och.bus.callback.IBusControllerStatusCallback;
|
||||
@@ -56,7 +64,6 @@ import com.mogo.och.bus.net.OrderServiceManager;
|
||||
import com.mogo.och.bus.util.BusAnalyticsManager;
|
||||
import com.mogo.och.bus.util.BusSendTripInfoManager;
|
||||
import com.mogo.och.bus.util.BusTrajectoryManager;
|
||||
import com.mogo.och.common.module.bean.AppConnectMsg;
|
||||
import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager;
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback;
|
||||
import com.mogo.och.common.module.biz.provider.LoginService;
|
||||
@@ -67,9 +74,12 @@ import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil;
|
||||
import com.mogo.och.common.module.utils.NumberFormatUtil;
|
||||
import com.mogo.och.common.module.utils.PinYinUtil;
|
||||
import com.mogo.och.common.module.utils.ToastUtilsOch;
|
||||
import com.mogo.och.common.module.voice.VoiceManager;
|
||||
import com.mogo.och.common.module.voice.VoiceNotice;
|
||||
import com.mogo.och.common.module.bean.dpmsg.BusCacheKey;
|
||||
import com.mogo.och.data.bean.BusTransferData;
|
||||
import com.mogo.och.data.manager.cache.CacheDataManager;
|
||||
import com.zhidao.socket.utils.LoginStatusUtil;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -175,6 +185,9 @@ public class OrderModel {
|
||||
|
||||
AbnormalFactorsLoopManager.INSTANCE.startLoopAbnormalFactors(mContext);
|
||||
|
||||
//监听乘客屏发来的消息
|
||||
CallerTelematicListenerManager.INSTANCE.addListener(TAG,mReceivedMsgListener);
|
||||
|
||||
//2022.1.28
|
||||
// 调用Disposable.dispose() 时候会出现InterruptedException 导致出现崩溃
|
||||
// The exception could not be delivered to the consumer because it has already canceled/disposed
|
||||
@@ -213,6 +226,19 @@ public class OrderModel {
|
||||
});
|
||||
}
|
||||
|
||||
private final IReceivedMsgListener mReceivedMsgListener =
|
||||
new IReceivedMsgListener() {
|
||||
@Override
|
||||
public void onReceivedMsg(int type, @NonNull byte[] byteArray) {
|
||||
if (OchCommonConst.BUSINESS_STRING == type){
|
||||
BaseDPMsg msg = GsonUtils.fromJson(new String(byteArray),BaseDPMsg.class);
|
||||
if (msg!=null && msg.getType() == DPMsgType.TYPE_TASK_DETAILS.getType()){
|
||||
sendTaskDetailsToClients();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private final IMogoOnMessageListener<SystemMsg> mMogoOnMessageListener =
|
||||
new IMogoOnMessageListener<SystemMsg>() {
|
||||
@Override
|
||||
@@ -330,6 +356,8 @@ public class OrderModel {
|
||||
OCHSocketMessageManager.msgWriteOffPassengerType);
|
||||
|
||||
AbnormalFactorsLoopManager.INSTANCE.stopLoopAbnormalFactors();
|
||||
//监听乘客屏发来的消息
|
||||
CallerTelematicListenerManager.INSTANCE.removeListener(TAG);
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
@@ -402,6 +430,45 @@ public class OrderModel {
|
||||
}
|
||||
}
|
||||
|
||||
public void queryBusCacheRoutes(){
|
||||
|
||||
String loginStr = CacheDataManager.Companion.getInstance().getCacheData(
|
||||
mContext, BusCacheKey.BUS_LOGIN_STATUS_CACHE);
|
||||
if (!loginStr.isEmpty()){
|
||||
LoginCacheStatus status = GsonUtils.fromJson(loginStr,LoginCacheStatus.class);
|
||||
LoginStatusManager.setLoginStatus(status.getLoginStatus());
|
||||
if (status.getUpdateTime() > DateTimeUtil.getTodayStartTime() &&
|
||||
status.getLoginStatus() == 1){//登陆
|
||||
|
||||
String cacheData = CacheDataManager.Companion.getInstance().getCacheData(mContext,
|
||||
BusCacheKey.BUS_LINE_CACHE);
|
||||
|
||||
if (cacheData == null || cacheData.isEmpty()){
|
||||
queryBusRoutes();
|
||||
}else {
|
||||
BusTransferData data = GsonUtils.fromJson(cacheData,BusTransferData.class);
|
||||
getCacheRouteSuccess(data.getRoutesResult());
|
||||
}
|
||||
}else{ // 未登陆
|
||||
CacheDataManager.Companion.getInstance().clearCacheData(mContext,BusCacheKey.BUS_LOGIN_STATUS_CACHE);
|
||||
sendTaskDetailsToClients();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void getCacheRouteSuccess(BusRoutesResult data){
|
||||
if (data == null || data.getSites() == null
|
||||
|| data.getSites().isEmpty()
|
||||
|| data.getWriteVersion() < DateTimeUtil.getTodayStartTime()) {
|
||||
//当为空时,显示无绑定路线图
|
||||
queryBusRoutes();
|
||||
CacheDataManager.Companion.getInstance().clearCacheData(mContext, BusCacheKey.BUS_LINE_CACHE);
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据: " + GsonUtils.toJson(data));
|
||||
updateBusStatus(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询小巴路线
|
||||
*/
|
||||
@@ -414,7 +481,7 @@ public class OrderModel {
|
||||
|| data.getResult() == null
|
||||
|| data.getResult().getSites() == null
|
||||
|| data.getResult().getSites().isEmpty()) {
|
||||
//当为空时,显示无绑定路线图
|
||||
// //当为空时,显示无绑定路线图
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据:空 ");
|
||||
if (refreshBusStationsCallback != null) {
|
||||
refreshBusStationsCallback.updateEmptyUi();
|
||||
@@ -423,10 +490,15 @@ public class OrderModel {
|
||||
closeBeautificationMode();
|
||||
clearStartAutopilotTag();
|
||||
removeTipRunnables();
|
||||
CacheDataManager.Companion.getInstance().clearCacheData(mContext,BusCacheKey.BUS_LINE_CACHE);
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据: " + data);
|
||||
updateBusStatus(data.getResult());
|
||||
|
||||
if (busRoutesResult == null || busRoutesResult.getWriteVersion() < data.getResult().getWriteVersion()){
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "更新小巴路线数据: " + data);
|
||||
updateBusStatus(data.getResult());
|
||||
pushCacheTransferData(data.getResult());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -559,6 +631,11 @@ public class OrderModel {
|
||||
, ""
|
||||
, false);
|
||||
}
|
||||
|
||||
CacheDataManager.Companion.getInstance().clearCacheData(mContext, BusCacheKey.BUS_LINE_CACHE);
|
||||
busRoutesResult = null;
|
||||
|
||||
sendTaskDetailsToClients();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -587,6 +664,30 @@ public class OrderModel {
|
||||
, nextStation
|
||||
, isLastStop);
|
||||
}
|
||||
|
||||
reBuildCacheRouteData(leaveIndex,BusConst.STATION_STATUS_STOPPED,true);
|
||||
}
|
||||
|
||||
private void reBuildCacheRouteData(int currentIndex, int currentDrivingStatus, boolean isLeaving) {
|
||||
if (busRoutesResult != null){
|
||||
busRoutesResult.setWriteVersion(DateTimeUtil.getCurrentTimeStamp());
|
||||
List<BusStationBean> sites = busRoutesResult.getSites();
|
||||
BusStationBean bean = sites.get(currentIndex);
|
||||
bean.setDrivingStatus(currentDrivingStatus);
|
||||
bean.setLeaving(isLeaving);
|
||||
sites.set(currentIndex,bean);
|
||||
if (currentDrivingStatus == STATION_STATUS_STOPPED && !isLeaving){
|
||||
BusStationBean beanPre = sites.get(currentIndex -1);
|
||||
beanPre.setDrivingStatus(BusConst.STATION_STATUS_LEAVING);
|
||||
beanPre.setLeaving(false);
|
||||
sites.set(currentIndex -1,beanPre);
|
||||
}
|
||||
busRoutesResult.setSite(sites);
|
||||
|
||||
pushCacheTransferData(busRoutesResult);
|
||||
|
||||
updateBusStatus(busRoutesResult);
|
||||
}
|
||||
}
|
||||
|
||||
private void onStartAutopilot(int leaveIndex) {
|
||||
@@ -649,6 +750,11 @@ public class OrderModel {
|
||||
String departureStopName = stationList.get(backgroundCurrentStationIndex).getName();
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "arriveSiteStation-currentStationIndex = " + arrivedStationIndex);
|
||||
|
||||
isArrivedStation = true;
|
||||
isGoingToNextStation = false;
|
||||
arriveStationSuccess(arrivedStationIndex, departureStopName,
|
||||
arriveStation,arriveStationKr);
|
||||
|
||||
OrderServiceManager.arriveSiteStation(mContext,
|
||||
stationList.get(arrivedStationIndex).getSeq(),
|
||||
stationList.get(arrivedStationIndex).getSiteId(),
|
||||
@@ -657,36 +763,35 @@ public class OrderModel {
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-arriveSiteStation success");
|
||||
if (o != null && o.code == 0){
|
||||
queryBusRoutes();
|
||||
isArrivedStation = true;
|
||||
isGoingToNextStation = false;
|
||||
arriveStationSuccess(arrivedStationIndex, departureStopName,
|
||||
arriveStation,arriveStationKr);
|
||||
}
|
||||
// if (o != null && o.code == 0){
|
||||
// queryBusRoutes();
|
||||
// isArrivedStation = true;
|
||||
// isGoingToNextStation = false;
|
||||
// arriveStationSuccess(arrivedStationIndex, departureStopName, arriveStation);
|
||||
// }
|
||||
//5s轮询核销乘客
|
||||
// startOrStopQueryPassengerWriteOff(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError() {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort(mContext.getString(R.string.network_error_tip));
|
||||
} else {
|
||||
ToastUtils.showShort(mContext.getString(R.string.request_error_tip));
|
||||
}
|
||||
// if (!NetworkUtils.isConnected(mContext)) {
|
||||
// ToastUtils.showShort(mContext.getString(R.string.network_error_tip));
|
||||
// } else {
|
||||
// ToastUtils.showShort(mContext.getString(R.string.request_error_tip));
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(int code, String failMsg) {
|
||||
if (ToastUtilsOch.isCustomFastClick(5000)) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
} else {
|
||||
if (isArrivedStation) return;
|
||||
ToastUtils.showShort(failMsg);
|
||||
}
|
||||
}
|
||||
// if (ToastUtilsOch.isCustomFastClick(5000)) {
|
||||
// if (!NetworkUtils.isConnected(mContext)) {
|
||||
// ToastUtils.showShort("网络异常,请稍后重试");
|
||||
// } else {
|
||||
// if (isArrivedStation) return;
|
||||
// ToastUtils.showShort(failMsg);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -706,9 +811,27 @@ public class OrderModel {
|
||||
, isLastStop);
|
||||
}
|
||||
|
||||
VoiceManager.INSTANCE.arrivedStation(arriveStation,arriveStationKr);
|
||||
VoiceManager.INSTANCE.arrivedStationBus(arriveStation,arriveStationKr);
|
||||
|
||||
sendArrivedStationToClient(arriveStation);
|
||||
|
||||
reBuildCacheRouteData(arrivedStationIndex, BusConst.STATION_STATUS_STOPPED,false);
|
||||
}
|
||||
|
||||
private void sendTaskDetailsToClients() {
|
||||
|
||||
BusTransferData data = new BusTransferData(LoginStatusManager.isLogin() ? 1:0,busRoutesResult);
|
||||
TaskDetailsMsg msg = new TaskDetailsMsg(GsonUtils.toJson(data));
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "sendTaskDetailsToClients = " + GsonUtils.toJson(msg));
|
||||
CallerTelematicManager.INSTANCE.sendMsgToAllClients(OchCommonConst.BUSINESS_STRING,
|
||||
GsonUtils.toJson(msg).getBytes());
|
||||
}
|
||||
|
||||
private void pushCacheTransferData(BusRoutesResult result) {
|
||||
BusTransferData data = new BusTransferData(LoginStatusManager.isLogin() ? 1:0,result);
|
||||
CacheDataManager.Companion.getInstance().putCacheData(mContext,
|
||||
BusCacheKey.BUS_LINE_CACHE,
|
||||
GsonUtils.toJson(data));
|
||||
}
|
||||
|
||||
private void sendArrivedStationToClient(String arriveStation) {
|
||||
@@ -720,28 +843,28 @@ public class OrderModel {
|
||||
}
|
||||
|
||||
private void sendStartStationToClient(String nextStation) {
|
||||
AppConnectMsg arrivedMsg = new AppConnectMsg(false,true,String.format(mContext
|
||||
AppConnectMsg startMsg = new AppConnectMsg(false,true,String.format(mContext
|
||||
.getString(R.string.bus_leave_station_tip),
|
||||
nextStation));
|
||||
UiThreadHandler.postDelayed(()->{
|
||||
CallerTelematicManager.INSTANCE.sendMsgToAllClients(OchCommonConst.BUSINESS_STRING,
|
||||
GsonUtils.toJson(arrivedMsg).getBytes());
|
||||
},DELAY_10S);
|
||||
|
||||
UiThreadHandler.postDelayed(()->
|
||||
CallerTelematicManager.INSTANCE.sendMsgToAllClients(OchCommonConst.BUSINESS_STRING,
|
||||
GsonUtils.toJson(startMsg).getBytes()),DELAY_10S);
|
||||
}
|
||||
|
||||
private void sendEndTaskToClient() {
|
||||
AppConnectMsg arrivedMsg = new AppConnectMsg(false,true,mContext
|
||||
AppConnectMsg endMsg = new AppConnectMsg(false,true,mContext
|
||||
.getString(R.string.bus_end_task_tip));
|
||||
|
||||
CallerTelematicManager.INSTANCE.sendMsgToAllClients(OchCommonConst.BUSINESS_STRING,
|
||||
GsonUtils.toJson(arrivedMsg).getBytes());
|
||||
GsonUtils.toJson(endMsg).getBytes());
|
||||
}
|
||||
|
||||
public void sendWriteOffNumToClient(String msg){
|
||||
AppConnectMsg arrivedMsg = new AppConnectMsg(false,true,msg);
|
||||
AppConnectMsg passengerMsg = new AppConnectMsg(false,true,msg);
|
||||
|
||||
CallerTelematicManager.INSTANCE.sendMsgToAllClients(OchCommonConst.BUSINESS_STRING,
|
||||
GsonUtils.toJson(arrivedMsg).getBytes());
|
||||
GsonUtils.toJson(passengerMsg).getBytes());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -758,6 +881,12 @@ public class OrderModel {
|
||||
final String currentStationName = stationList.get(backgroundCurrentStationIndex).getName();
|
||||
String finalNextStationName = nextStationName;
|
||||
String finalNextStationNameKr = nextStationNameKr;
|
||||
|
||||
isArrivedStation = false;
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-离站成功开往下一站====");
|
||||
leaveStationSuccess(backgroundCurrentStationIndex, currentStationName,
|
||||
finalNextStationName,finalNextStationNameKr);
|
||||
|
||||
OrderServiceManager.leaveStation(mContext,
|
||||
stationList.get(backgroundCurrentStationIndex).getSeq(),
|
||||
stationList.get(backgroundCurrentStationIndex).getSiteId(),
|
||||
@@ -765,32 +894,31 @@ public class OrderModel {
|
||||
new OchCommonServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
isArrivedStation = false;
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-离站成功开往下一站====");
|
||||
//需要更改当前站和下一站的状态 然后渲染
|
||||
//startOrStopQueryPassengerWriteOff(false);
|
||||
queryBusRoutes();
|
||||
leaveStationSuccess(backgroundCurrentStationIndex, currentStationName,
|
||||
finalNextStationName,finalNextStationNameKr);
|
||||
// isArrivedStation = false;
|
||||
// CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-离站成功开往下一站====");
|
||||
// //需要更改当前站和下一站的状态 然后渲染
|
||||
// //startOrStopQueryPassengerWriteOff(false);
|
||||
// queryBusRoutes();
|
||||
// leaveStationSuccess(backgroundCurrentStationIndex, currentStationName, finalNextStationName);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onError() {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort(mContext.getString(R.string.network_error_tip));
|
||||
} else {
|
||||
ToastUtils.showShort(mContext.getString(R.string.request_error_tip));
|
||||
}
|
||||
// if (!NetworkUtils.isConnected(mContext)) {
|
||||
// ToastUtils.showShort(mContext.getString(R.string.network_error_tip));
|
||||
// } else {
|
||||
// ToastUtils.showShort(mContext.getString(R.string.request_error_tip));
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(int code, String failMsg) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
} else {
|
||||
ToastUtils.showShort("离站上报失败:" + failMsg);
|
||||
}
|
||||
// if (!NetworkUtils.isConnected(mContext)) {
|
||||
// ToastUtils.showShort("网络异常,请稍后重试");
|
||||
// } else {
|
||||
// ToastUtils.showShort("离站上报失败:" + failMsg);
|
||||
// }
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -800,7 +928,7 @@ public class OrderModel {
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {//延迟10s播报
|
||||
VoiceManager.INSTANCE.leaveStation(nextStation,nextStationKr);
|
||||
VoiceManager.INSTANCE.leaveStationBus(nextStation,nextStationKr);
|
||||
}
|
||||
},DELAY_10S);
|
||||
|
||||
@@ -909,6 +1037,8 @@ public class OrderModel {
|
||||
slidePanelHideCallback.hideSlidePanel();
|
||||
}
|
||||
|
||||
sendTaskDetailsToClients();
|
||||
|
||||
//更新bus路线面板
|
||||
updateBusTaskStatus(stationList);
|
||||
|
||||
@@ -1047,7 +1177,7 @@ public class OrderModel {
|
||||
queryBusRoutes();// 重新获取任务
|
||||
removeTipRunnables();
|
||||
// startOrStopQueryPassengerWriteOff(false);
|
||||
VoiceManager.INSTANCE.endOrder();
|
||||
VoiceManager.INSTANCE.endOrderBus();
|
||||
sendEndTaskToClient();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.och.bus.bean.BusStationBean;
|
||||
import com.mogo.och.data.bean.BusStationBean;
|
||||
import com.mogo.och.bus.bean.WriteOffPassenger;
|
||||
import com.mogo.och.bus.callback.IBusADASStatusCallback;
|
||||
import com.mogo.och.bus.callback.IBusControllerStatusCallback;
|
||||
@@ -33,6 +33,7 @@ import com.mogo.och.common.module.biz.callback.ILoginCallback;
|
||||
import com.mogo.och.common.module.biz.constant.LoginStatusManager;
|
||||
import com.mogo.och.common.module.manager.OCHAdasAbilityManager;
|
||||
import com.mogo.och.common.module.voice.VoiceNotice;
|
||||
import com.mogo.och.data.manager.cache.CacheDataManager;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -70,6 +71,8 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
public void onCreate(@NonNull LifecycleOwner owner) {
|
||||
super.onCreate(owner);
|
||||
initModelListener();
|
||||
|
||||
OrderModel.getInstance().queryBusCacheRoutes();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -308,7 +311,8 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, " loginStatus =" + LoginStatusManager.isLogin());
|
||||
if(LoginStatusManager.isLogin()){
|
||||
OrderModel.getInstance().startOrStopOrderLoop(true);
|
||||
OrderModel.getInstance().queryBusRoutes();
|
||||
// OrderModel.getInstance().queryBusRoutes();
|
||||
OrderModel.getInstance().queryBusCacheRoutes();
|
||||
}else {
|
||||
BusTrajectoryManager.getInstance().stopTrajReqLoop();
|
||||
OrderModel.getInstance().startOrStopOrderLoop(false);
|
||||
|
||||
@@ -6,11 +6,10 @@ import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
|
||||
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.data.bean.BusRoutesResult;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
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;
|
||||
|
||||
|
||||
@@ -215,6 +215,25 @@ class OverMapView @JvmOverloads constructor(
|
||||
siteMarkerList = mAMap!!.addMarkers(markerOptionsList, false)
|
||||
}
|
||||
|
||||
@MainThread
|
||||
fun drawSiteMarkers(
|
||||
siteMarkers: List<SiteMarkerBean>?,
|
||||
) {
|
||||
if (siteMarkers.isNullOrEmpty()) return
|
||||
clearSiteMarkers()
|
||||
val markerOptionsList = ArrayList<MarkerOptions>()
|
||||
for (siteMarkerBean in siteMarkers) {
|
||||
val markerOption = MarkerOptions()
|
||||
markerOption.position(siteMarkerBean.latLng)
|
||||
markerOption.anchor(siteMarkerBean.anchorX, siteMarkerBean.anchorY)
|
||||
markerOption.icon(
|
||||
BitmapDescriptorFactory.fromBitmap(siteMarkerBean.bitmap)
|
||||
)
|
||||
markerOptionsList.add(markerOption)
|
||||
}
|
||||
siteMarkerList = mAMap!!.addMarkers(markerOptionsList, false)
|
||||
}
|
||||
|
||||
@MainThread
|
||||
fun clearSiteMarkers() {
|
||||
if (siteMarkerList != null) {
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.mogo.eagle.core.function.view
|
||||
|
||||
import android.graphics.Bitmap
|
||||
import com.amap.api.maps.model.LatLng
|
||||
|
||||
data class SiteMarkerBean(var latLng: LatLng, var bitmap: Bitmap, var anchorX: Float, var anchorY: Float)
|
||||
@@ -68,3 +68,4 @@ include ':OCH:mogo-och-charter'
|
||||
include ':OCH:mogo-och-charter-passenger'
|
||||
include ':OCH:mogo-och-shuttle'
|
||||
include ':OCH:mogo-och-shuttle-passenger'
|
||||
include ':OCH:mogo-och-data'
|
||||
|
||||